pub struct ControlParagraph<'a> { /* private fields */ }
Expand description
A paragraph in a control file.
A paragraph is an ordered series of control fields.
Implementations§
Source§impl<'a> ControlParagraph<'a>
impl<'a> ControlParagraph<'a>
Sourcepub fn add_field(&mut self, field: ControlField<'a>)
pub fn add_field(&mut self, field: ControlField<'a>)
Add a ControlField
to this instance.
Sourcepub fn add_field_from_string(
&mut self,
name: Cow<'a, str>,
value: Cow<'a, str>,
) -> Result<(), ControlError>
pub fn add_field_from_string( &mut self, name: Cow<'a, str>, value: Cow<'a, str>, ) -> Result<(), ControlError>
Add a field defined via strings.
Sourcepub fn has_field(&self, name: &str) -> bool
pub fn has_field(&self, name: &str) -> bool
Whether a named field is present in this paragraph.
Sourcepub fn get_field(&self, name: &str) -> Option<&ControlField<'_>>
pub fn get_field(&self, name: &str) -> Option<&ControlField<'_>>
Obtain the first field with a given name in this paragraph.
Sourcepub fn get_field_mut(&mut self, name: &str) -> Option<&'a mut ControlField<'_>>
pub fn get_field_mut(&mut self, name: &str) -> Option<&'a mut ControlField<'_>>
Obtain a mutable reference to the first field with a given name.
Trait Implementations§
Source§impl<'a> Clone for ControlParagraph<'a>
impl<'a> Clone for ControlParagraph<'a>
Source§fn clone(&self) -> ControlParagraph<'a>
fn clone(&self) -> ControlParagraph<'a>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<'a> Debug for ControlParagraph<'a>
impl<'a> Debug for ControlParagraph<'a>
Source§impl<'a> Default for ControlParagraph<'a>
impl<'a> Default for ControlParagraph<'a>
Source§fn default() -> ControlParagraph<'a>
fn default() -> ControlParagraph<'a>
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl<'a> Freeze for ControlParagraph<'a>
impl<'a> RefUnwindSafe for ControlParagraph<'a>
impl<'a> Send for ControlParagraph<'a>
impl<'a> Sync for ControlParagraph<'a>
impl<'a> Unpin for ControlParagraph<'a>
impl<'a> UnwindSafe for ControlParagraph<'a>
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