[−][src]Struct openstack::compute::BlockDevice
A block device to attach to a server.
Fields (Non-exhaustive)
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]
source: BlockDeviceSource,
destination_type: BlockDeviceDestinationType
) -> BlockDevice
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]
I: Into<ImageRef>,
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]
V: Into<VolumeRef>,
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]
image: I,
size_gib: u32,
is_boot_device: bool
) -> BlockDevice where
I: Into<ImageRef>,
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]
fn clone(&self) -> BlockDevice
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
fn instrument(self, span: Span) -> Instrumented<Self>
[src]
fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T> Instrument for T
[src]
fn instrument(self, span: Span) -> Instrumented<Self>
[src]
fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,