pub struct FormatHints { /* private fields */ }Expand description
Format hints configuration.
Implementations§
Source§impl FormatHints
impl FormatHints
Sourcepub fn hints(&self) -> &[FormatHint]
pub fn hints(&self) -> &[FormatHint]
Get all hints (sorted by priority, highest first).
Sourcepub fn default_format(&self) -> &str
pub fn default_format(&self) -> &str
Get the default format.
Sourcepub fn set_default_format(&mut self, format: impl Into<String>)
pub fn set_default_format(&mut self, format: impl Into<String>)
Set the default format.
Sourcepub fn add(&mut self, hint: FormatHint)
pub fn add(&mut self, hint: FormatHint)
Add a hint (maintains sorted order).
Sourcepub fn remove(&mut self, pattern: &str) -> bool
pub fn remove(&mut self, pattern: &str) -> bool
Remove a hint by pattern. Returns true if removed.
Sourcepub fn get(&self, pattern: &str) -> Option<&FormatHint>
pub fn get(&self, pattern: &str) -> Option<&FormatHint>
Find a hint by pattern.
Trait Implementations§
Source§impl Clone for FormatHints
impl Clone for FormatHints
Source§fn clone(&self) -> FormatHints
fn clone(&self) -> FormatHints
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 Debug for FormatHints
impl Debug for FormatHints
Source§impl Default for FormatHints
impl Default for FormatHints
Source§fn default() -> FormatHints
fn default() -> FormatHints
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for FormatHints
impl RefUnwindSafe for FormatHints
impl Send for FormatHints
impl Sync for FormatHints
impl Unpin for FormatHints
impl UnsafeUnpin for FormatHints
impl UnwindSafe for FormatHints
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