[][src]Struct openstack::compute::BlockDevice

#[non_exhaustive]pub struct BlockDevice {
    pub boot_index: Option<u16>,
    pub delete_on_termination: bool,
    pub destination_type: BlockDeviceDestinationType,
    pub guest_format: Option<String>,
    pub size_gib: Option<u32>,
    pub source: Option<BlockDeviceSource>,
}

A block device to attach to a server.

Fields (Non-exhaustive)

Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
boot_index: Option<u16>

Boot index of the device if it's intended to be bootable.

Note

Not all backends support values other than None and Some(0).

delete_on_termination: bool

Whether to delete the created volume on termination (defaults to false).

destination_type: BlockDeviceDestinationType

A type of the destination: local disk or persistent volume.

guest_format: Option<String>

Format of the target device if it needs to be formatted.

size_gib: Option<u32>

The size (in GiB) of the created volume (if any).

Note

This is only mandatory when creating source is None.

source: Option<BlockDeviceSource>

A source for this block device (if any).

Implementations

impl BlockDevice[src]

pub fn new(
    source: BlockDeviceSource,
    destination_type: BlockDeviceDestinationType
) -> BlockDevice
[src]

Create a block device from the specified source.

pub fn swap(size_gib: u32) -> BlockDevice[src]

Create a swap device.

pub fn from_image<I>(image: I) -> BlockDevice where
    I: Into<ImageRef>, 
[src]

Attach an image.

This is used for the entry referring to the image that the instance is being booted with. Boot index 0 is used for it.

Use from_new_volume to create a volume from any image.

pub fn from_volume<V>(volume: V, is_boot_device: bool) -> BlockDevice where
    V: Into<VolumeRef>, 
[src]

Attach a remote volume.

The volume will be the first bootable device if is_boot_device is true.

pub fn from_empty_volume(size_gib: u32) -> BlockDevice[src]

Create a new empty volume.

pub fn from_new_volume<I>(
    image: I,
    size_gib: u32,
    is_boot_device: bool
) -> BlockDevice where
    I: Into<ImageRef>, 
[src]

Create a volume from an image.

The volume will be the first bootable device if is_boot_device is true.

Trait Implementations

impl Clone for BlockDevice[src]

impl Debug for BlockDevice[src]

impl Serialize for BlockDevice[src]

Auto Trait Implementations

impl RefUnwindSafe for BlockDevice

impl Send for BlockDevice

impl Sync for BlockDevice

impl Unpin for BlockDevice

impl UnwindSafe for BlockDevice

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.