Skip to main content

SectionMut

Struct SectionMut 

Source
pub struct SectionMut<'e, G: Group> { /* private fields */ }
Expand description

The edit of one section of the named group G.

ConfigEdit::section_mut gives it.

Implementations§

Source§

impl<G: Group> SectionMut<'_, G>

Source

pub fn name(&self) -> &str

Returns the name of the section.

Source

pub fn set<K: Key<G>>(&mut self, value: K::Value) -> Result<(), ConfigError>

Sets the key K of the section to value.

If the section is absent, the call adds it at the end of the document. The key takes its position as ConfigEdit::set states.

§Errors

ConfigError::Core if the text of the value cannot be in a key file, for example a text with a line break. The document then does not change.

Source

pub fn remove<K: Key<G>>(&mut self) -> bool

Removes the key K of the section, and returns true if the key was present.

Auto Trait Implementations§

§

impl<'e, G> !UnwindSafe for SectionMut<'e, G>

§

impl<'e, G> Forget for SectionMut<'e, G>

§

impl<'e, G> Freeze for SectionMut<'e, G>
where &'e mut KeyFile: Freeze, *const u8 is !null: Freeze, PhantomData<u8>: Freeze, PhantomData<fn() -> G>: Freeze,

§

impl<'e, G> Move for SectionMut<'e, G>

§

impl<'e, G> RefUnwindSafe for SectionMut<'e, G>

§

impl<'e, G> Send for SectionMut<'e, G>
where RawVecInner: Send, RawTable<(String, usize)>: Send,

§

impl<'e, G> Sync for SectionMut<'e, G>
where RawVecInner: Sync, RawTable<(String, usize)>: Sync,

§

impl<'e, G> Unpin for SectionMut<'e, G>
where &'e mut KeyFile: Unpin, *const u8 is !null: Unpin,

§

impl<'e, G> UnsafeUnpin for SectionMut<'e, G>

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> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.