FsDevLocalBuilder

Struct FsDevLocalBuilder 

Source
pub struct FsDevLocalBuilder<S: State = Empty> { /* private fields */ }
Expand description

Use builder syntax to set the inputs and finish with build().

Implementations§

Source§

impl<S: State> FsDevLocalBuilder<S>

Source

pub fn build(self) -> FsDevLocal
where S: IsComplete,

Finish building and return the requested object

Source

pub fn id(self, value: String) -> FsDevLocalBuilder<SetId<S>>
where S::Id: IsUnset,

Required.

Specifies identifier for this device.

Source

pub fn path(self, value: PathBuf) -> FsDevLocalBuilder<SetPath<S>>
where S::Path: IsUnset,

Required.

Specifies the export path for the file system device. Files under this path will be available to the 9p client on the guest.

Source

pub fn security_model( self, value: SecurityModel, ) -> FsDevLocalBuilder<SetSecurityModel<S>>
where S::SecurityModel: IsUnset,

Required.

Specifies the security model to be used for this export path. Supported security models are “passthrough”, “mapped-xattr”, “mapped-file” and “none”. In “passthrough” security model, files are stored using the same credentials as they are created on the guest. This requires QEMU to run as root. In “mapped-xattr” security model, some of the file attributes like uid, gid, mode bits and link target are stored as file attributes. For “mapped-file” these attributes are stored in the hidden .virtfs_metadata directory. Directories exported by this security model cannot interact with other unix tools. “none” security model is same as passthrough except the sever won’t report failures if it fails to set file attributes like ownership. Security model is mandatory only for local fsdriver.

Source

pub fn writeout(self, value: ()) -> FsDevLocalBuilder<SetWriteout<S>>
where S::Writeout: IsUnset,

Optional (Some / Option setters).

This is an optional argument. The only supported value is “immediate”. This means that host page cache will be used to read and write data but write notification will be sent to the guest only when the data has been reported as written by the storage subsystem.

Source

pub fn maybe_writeout( self, value: Option<()>, ) -> FsDevLocalBuilder<SetWriteout<S>>
where S::Writeout: IsUnset,

Optional (Some / Option setters).

This is an optional argument. The only supported value is “immediate”. This means that host page cache will be used to read and write data but write notification will be sent to the guest only when the data has been reported as written by the storage subsystem.

Source

pub fn readonly(self, value: ()) -> FsDevLocalBuilder<SetReadonly<S>>
where S::Readonly: IsUnset,

Optional (Some / Option setters).

Enables exporting 9p share as a readonly mount for guests. By default read-write access is given.

Source

pub fn maybe_readonly( self, value: Option<()>, ) -> FsDevLocalBuilder<SetReadonly<S>>
where S::Readonly: IsUnset,

Optional (Some / Option setters).

Enables exporting 9p share as a readonly mount for guests. By default read-write access is given.

Source

pub fn fmode(self, value: String) -> FsDevLocalBuilder<SetFmode<S>>
where S::Fmode: IsUnset,

Optional (Some / Option setters).

Specifies the default mode for newly created files on the host. Works only with security models “mapped-xattr” and “mapped-file”.

Source

pub fn maybe_fmode( self, value: Option<String>, ) -> FsDevLocalBuilder<SetFmode<S>>
where S::Fmode: IsUnset,

Optional (Some / Option setters).

Specifies the default mode for newly created files on the host. Works only with security models “mapped-xattr” and “mapped-file”.

Source

pub fn dmode(self, value: String) -> FsDevLocalBuilder<SetDmode<S>>
where S::Dmode: IsUnset,

Optional (Some / Option setters).

Specifies the default mode for newly created directories on the host. Works only with security models “mapped-xattr” and “mapped-file”.

Source

pub fn maybe_dmode( self, value: Option<String>, ) -> FsDevLocalBuilder<SetDmode<S>>
where S::Dmode: IsUnset,

Optional (Some / Option setters).

Specifies the default mode for newly created directories on the host. Works only with security models “mapped-xattr” and “mapped-file”.

Source

pub fn throttling_bps_total( self, value: usize, ) -> FsDevLocalBuilder<SetThrottlingBpsTotal<S>>
where S::ThrottlingBpsTotal: IsUnset,

Optional (Some / Option setters).

Specify bandwidth throttling limits in bytes per second, either for all request types or for reads or writes only.

Source

pub fn maybe_throttling_bps_total( self, value: Option<usize>, ) -> FsDevLocalBuilder<SetThrottlingBpsTotal<S>>
where S::ThrottlingBpsTotal: IsUnset,

Optional (Some / Option setters).

Specify bandwidth throttling limits in bytes per second, either for all request types or for reads or writes only.

Source

pub fn throttling_bps_read( self, value: usize, ) -> FsDevLocalBuilder<SetThrottlingBpsRead<S>>
where S::ThrottlingBpsRead: IsUnset,

Optional (Some / Option setters).

Source

pub fn maybe_throttling_bps_read( self, value: Option<usize>, ) -> FsDevLocalBuilder<SetThrottlingBpsRead<S>>
where S::ThrottlingBpsRead: IsUnset,

Optional (Some / Option setters).

Source

pub fn throttling_bps_write( self, value: usize, ) -> FsDevLocalBuilder<SetThrottlingBpsWrite<S>>
where S::ThrottlingBpsWrite: IsUnset,

Optional (Some / Option setters).

Source

pub fn maybe_throttling_bps_write( self, value: Option<usize>, ) -> FsDevLocalBuilder<SetThrottlingBpsWrite<S>>
where S::ThrottlingBpsWrite: IsUnset,

Optional (Some / Option setters).

Source

pub fn throttling_bps_total_max( self, value: usize, ) -> FsDevLocalBuilder<SetThrottlingBpsTotalMax<S>>
where S::ThrottlingBpsTotalMax: IsUnset,

Optional (Some / Option setters).

Specify bursts in bytes per second, either for all request types or for reads or writes only. Bursts allow the guest I/O to spike above the limit temporarily.

Source

pub fn maybe_throttling_bps_total_max( self, value: Option<usize>, ) -> FsDevLocalBuilder<SetThrottlingBpsTotalMax<S>>
where S::ThrottlingBpsTotalMax: IsUnset,

Optional (Some / Option setters).

Specify bursts in bytes per second, either for all request types or for reads or writes only. Bursts allow the guest I/O to spike above the limit temporarily.

Source

pub fn bps_read_max(self, value: usize) -> FsDevLocalBuilder<SetBpsReadMax<S>>
where S::BpsReadMax: IsUnset,

Optional (Some / Option setters).

Source

pub fn maybe_bps_read_max( self, value: Option<usize>, ) -> FsDevLocalBuilder<SetBpsReadMax<S>>
where S::BpsReadMax: IsUnset,

Optional (Some / Option setters).

Source

pub fn bps_write_max(self, value: usize) -> FsDevLocalBuilder<SetBpsWriteMax<S>>
where S::BpsWriteMax: IsUnset,

Optional (Some / Option setters).

Source

pub fn maybe_bps_write_max( self, value: Option<usize>, ) -> FsDevLocalBuilder<SetBpsWriteMax<S>>
where S::BpsWriteMax: IsUnset,

Optional (Some / Option setters).

Source

pub fn throttling_iops_total( self, value: usize, ) -> FsDevLocalBuilder<SetThrottlingIopsTotal<S>>
where S::ThrottlingIopsTotal: IsUnset,

Optional (Some / Option setters).

Specify request rate limits in requests per second, either for all request types or for reads or writes only.

Source

pub fn maybe_throttling_iops_total( self, value: Option<usize>, ) -> FsDevLocalBuilder<SetThrottlingIopsTotal<S>>
where S::ThrottlingIopsTotal: IsUnset,

Optional (Some / Option setters).

Specify request rate limits in requests per second, either for all request types or for reads or writes only.

Source

pub fn throttling_iops_read( self, value: usize, ) -> FsDevLocalBuilder<SetThrottlingIopsRead<S>>
where S::ThrottlingIopsRead: IsUnset,

Optional (Some / Option setters).

Source

pub fn maybe_throttling_iops_read( self, value: Option<usize>, ) -> FsDevLocalBuilder<SetThrottlingIopsRead<S>>
where S::ThrottlingIopsRead: IsUnset,

Optional (Some / Option setters).

Source

pub fn throttling_iops_write( self, value: usize, ) -> FsDevLocalBuilder<SetThrottlingIopsWrite<S>>
where S::ThrottlingIopsWrite: IsUnset,

Optional (Some / Option setters).

Source

pub fn maybe_throttling_iops_write( self, value: Option<usize>, ) -> FsDevLocalBuilder<SetThrottlingIopsWrite<S>>
where S::ThrottlingIopsWrite: IsUnset,

Optional (Some / Option setters).

Source

pub fn throttling_iops_total_max( self, value: usize, ) -> FsDevLocalBuilder<SetThrottlingIopsTotalMax<S>>
where S::ThrottlingIopsTotalMax: IsUnset,

Optional (Some / Option setters).

Specify bursts in requests per second, either for all request types or for reads or writes only. Bursts allow the guest I/O to spike above the limit temporarily.

Source

pub fn maybe_throttling_iops_total_max( self, value: Option<usize>, ) -> FsDevLocalBuilder<SetThrottlingIopsTotalMax<S>>
where S::ThrottlingIopsTotalMax: IsUnset,

Optional (Some / Option setters).

Specify bursts in requests per second, either for all request types or for reads or writes only. Bursts allow the guest I/O to spike above the limit temporarily.

Source

pub fn throttling_iops_read_max( self, value: usize, ) -> FsDevLocalBuilder<SetThrottlingIopsReadMax<S>>
where S::ThrottlingIopsReadMax: IsUnset,

Optional (Some / Option setters).

Source

pub fn maybe_throttling_iops_read_max( self, value: Option<usize>, ) -> FsDevLocalBuilder<SetThrottlingIopsReadMax<S>>
where S::ThrottlingIopsReadMax: IsUnset,

Optional (Some / Option setters).

Source

pub fn throttling_iops_write_max( self, value: usize, ) -> FsDevLocalBuilder<SetThrottlingIopsWriteMax<S>>
where S::ThrottlingIopsWriteMax: IsUnset,

Optional (Some / Option setters).

Source

pub fn maybe_throttling_iops_write_max( self, value: Option<usize>, ) -> FsDevLocalBuilder<SetThrottlingIopsWriteMax<S>>
where S::ThrottlingIopsWriteMax: IsUnset,

Optional (Some / Option setters).

Source

pub fn throttling_iops_size( self, value: usize, ) -> FsDevLocalBuilder<SetThrottlingIopsSize<S>>
where S::ThrottlingIopsSize: IsUnset,

Optional (Some / Option setters).

Let every is bytes of a request count as a new request for iops throttling purposes.

Source

pub fn maybe_throttling_iops_size( self, value: Option<usize>, ) -> FsDevLocalBuilder<SetThrottlingIopsSize<S>>
where S::ThrottlingIopsSize: IsUnset,

Optional (Some / Option setters).

Let every is bytes of a request count as a new request for iops throttling purposes.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.