pub struct KeFormatter<'s, Storage>where
Storage: IKeFormatStorage<'s>,{ /* private fields */ }
Expand description
An active formatter for a KeFormat
.
Implementations§
Source§impl<'s, Storage> KeFormatter<'s, Storage>where
Storage: IKeFormatStorage<'s>,
impl<'s, Storage> KeFormatter<'s, Storage>where
Storage: IKeFormatStorage<'s>,
Sourcepub fn clear(&mut self) -> &mut KeFormatter<'s, Storage>
pub fn clear(&mut self) -> &mut KeFormatter<'s, Storage>
Clear the formatter of previously set values, without deallocating its internal formatting buffer.
Sourcepub fn build(&self) -> Result<OwnedKeyExpr, Box<dyn Error + Sync + Send>>
pub fn build(&self) -> Result<OwnedKeyExpr, Box<dyn Error + Sync + Send>>
Build a key-expression according to the format and the currently set values.
This doesn’t clear the formatter of already set values, allowing to reuse the builder and only change a subset of its properties before building a new key-expression again.
Sourcepub fn set<S>(
&mut self,
id: &str,
value: S,
) -> Result<&mut KeFormatter<'s, Storage>, FormatSetError>where
S: Display,
pub fn set<S>(
&mut self,
id: &str,
value: S,
) -> Result<&mut KeFormatter<'s, Storage>, FormatSetError>where
S: Display,
Trait Implementations§
Source§impl<'s, Storage> Clone for KeFormatter<'s, Storage>where
Storage: Clone + IKeFormatStorage<'s>,
<Storage as IKeFormatStorage<'s>>::ValuesStorage<Option<(u32, NonMaxU32)>>: Clone,
impl<'s, Storage> Clone for KeFormatter<'s, Storage>where
Storage: Clone + IKeFormatStorage<'s>,
<Storage as IKeFormatStorage<'s>>::ValuesStorage<Option<(u32, NonMaxU32)>>: Clone,
Source§fn clone(&self) -> KeFormatter<'s, Storage>
fn clone(&self) -> KeFormatter<'s, Storage>
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<'s, Storage> Debug for KeFormatter<'s, Storage>where
Storage: IKeFormatStorage<'s>,
impl<'s, Storage> Debug for KeFormatter<'s, Storage>where
Storage: IKeFormatStorage<'s>,
Source§impl<'s, Storage> TryFrom<&KeFormatter<'s, Storage>> for OwnedKeyExprwhere
Storage: IKeFormatStorage<'s>,
impl<'s, Storage> TryFrom<&KeFormatter<'s, Storage>> for OwnedKeyExprwhere
Storage: IKeFormatStorage<'s>,
Source§type Error = Box<dyn Error + Sync + Send>
type Error = Box<dyn Error + Sync + Send>
The type returned in the event of a conversion error.
Source§fn try_from(
value: &KeFormatter<'s, Storage>,
) -> Result<OwnedKeyExpr, <OwnedKeyExpr as TryFrom<&KeFormatter<'s, Storage>>>::Error>
fn try_from( value: &KeFormatter<'s, Storage>, ) -> Result<OwnedKeyExpr, <OwnedKeyExpr as TryFrom<&KeFormatter<'s, Storage>>>::Error>
Performs the conversion.
Source§impl<'s, Storage> TryFrom<&mut KeFormatter<'s, Storage>> for OwnedKeyExprwhere
Storage: IKeFormatStorage<'s>,
impl<'s, Storage> TryFrom<&mut KeFormatter<'s, Storage>> for OwnedKeyExprwhere
Storage: IKeFormatStorage<'s>,
Source§type Error = Box<dyn Error + Sync + Send>
type Error = Box<dyn Error + Sync + Send>
The type returned in the event of a conversion error.
Source§fn try_from(
value: &mut KeFormatter<'s, Storage>,
) -> Result<OwnedKeyExpr, <OwnedKeyExpr as TryFrom<&mut KeFormatter<'s, Storage>>>::Error>
fn try_from( value: &mut KeFormatter<'s, Storage>, ) -> Result<OwnedKeyExpr, <OwnedKeyExpr as TryFrom<&mut KeFormatter<'s, Storage>>>::Error>
Performs the conversion.
Auto Trait Implementations§
impl<'s, Storage> Freeze for KeFormatter<'s, Storage>
impl<'s, Storage> RefUnwindSafe for KeFormatter<'s, Storage>where
<Storage as IKeFormatStorage<'s>>::ValuesStorage<Option<(u32, NonMaxU32)>>: RefUnwindSafe,
Storage: RefUnwindSafe,
impl<'s, Storage> Send for KeFormatter<'s, Storage>where
<Storage as IKeFormatStorage<'s>>::ValuesStorage<Option<(u32, NonMaxU32)>>: Send,
Storage: Sync,
impl<'s, Storage> Sync for KeFormatter<'s, Storage>where
<Storage as IKeFormatStorage<'s>>::ValuesStorage<Option<(u32, NonMaxU32)>>: Sync,
Storage: Sync,
impl<'s, Storage> Unpin for KeFormatter<'s, Storage>
impl<'s, Storage> UnwindSafe for KeFormatter<'s, Storage>where
<Storage as IKeFormatStorage<'s>>::ValuesStorage<Option<(u32, NonMaxU32)>>: UnwindSafe,
Storage: RefUnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more