pub struct EntryBuilder { /* private fields */ }Expand description
Builder for Entry with ergonomic construction of optional fields.
Created via Entry::builder(). All fields are optional except spec,
file, and vfstype, which are required by build.
§Examples
let entry = Entry::builder()
.spec(Spec::parse("/dev/sda1").unwrap())
.file(MountPoint::new("/").unwrap())
.vfstype(FsType::parse("ext4").unwrap())
.comment("# Root")
.build()
.unwrap();Implementations§
Source§impl EntryBuilder
impl EntryBuilder
Sourcepub fn file(self, file: MountPoint) -> Self
pub fn file(self, file: MountPoint) -> Self
Set the mount point (required).
Sourcepub fn build(self) -> Result<Entry, EntryBuilderError>
pub fn build(self) -> Result<Entry, EntryBuilderError>
Build the Entry, consuming the builder.
§Errors
Returns EntryBuilderError if any required fields (spec, file,
vfstype) are missing.
Trait Implementations§
Source§impl Clone for EntryBuilder
impl Clone for EntryBuilder
Source§fn clone(&self) -> EntryBuilder
fn clone(&self) -> EntryBuilder
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for EntryBuilder
impl Debug for EntryBuilder
Source§impl Default for EntryBuilder
impl Default for EntryBuilder
Source§fn default() -> EntryBuilder
fn default() -> EntryBuilder
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for EntryBuilder
impl<'de> Deserialize<'de> for EntryBuilder
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for EntryBuilder
impl RefUnwindSafe for EntryBuilder
impl Send for EntryBuilder
impl Sync for EntryBuilder
impl Unpin for EntryBuilder
impl UnsafeUnpin for EntryBuilder
impl UnwindSafe for EntryBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more