Struct display_as::FormattedString
source · pub struct FormattedString<F> { /* private fields */ }
Expand description
A String
that is formatted in F
The serde1`` feature flag enables a [
FormattedString`] to be
serialized and deserialized by serde.
Implementations
sourceimpl<F: Format> FormattedString<F>
impl<F: Format> FormattedString<F>
sourcepub fn from_formatted<S: Into<String>>(s: S) -> Self
pub fn from_formatted<S: Into<String>>(s: S) -> Self
Create a new FormattedString
from an already-formatted String
.
sourcepub fn into_string(self) -> String
pub fn into_string(self) -> String
Convert back into a string
Trait Implementations
sourceimpl<F: Clone> Clone for FormattedString<F>
impl<F: Clone> Clone for FormattedString<F>
sourcefn clone(&self) -> FormattedString<F>
fn clone(&self) -> FormattedString<F>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl<F: Format> Debug for FormattedString<F>
impl<F: Format> Debug for FormattedString<F>
sourceimpl<'de, F> Deserialize<'de> for FormattedString<F>where
F: Format,
impl<'de, F> Deserialize<'de> for FormattedString<F>where
F: Format,
sourcefn 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
sourceimpl<F: Format> DisplayAs<F> for FormattedString<F>
impl<F: Format> DisplayAs<F> for FormattedString<F>
sourceimpl<F: Hash> Hash for FormattedString<F>
impl<F: Hash> Hash for FormattedString<F>
sourceimpl<F: Ord> Ord for FormattedString<F>
impl<F: Ord> Ord for FormattedString<F>
sourcefn cmp(&self, other: &FormattedString<F>) -> Ordering
fn cmp(&self, other: &FormattedString<F>) -> Ordering
1.21.0 · sourcefn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 · sourcefn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl<F: PartialEq> PartialEq<FormattedString<F>> for FormattedString<F>
impl<F: PartialEq> PartialEq<FormattedString<F>> for FormattedString<F>
sourcefn eq(&self, other: &FormattedString<F>) -> bool
fn eq(&self, other: &FormattedString<F>) -> bool
sourceimpl<F> PartialEq<FormattedString<F>> for str
impl<F> PartialEq<FormattedString<F>> for str
sourcefn eq(&self, other: &FormattedString<F>) -> bool
fn eq(&self, other: &FormattedString<F>) -> bool
sourceimpl<F: PartialOrd> PartialOrd<FormattedString<F>> for FormattedString<F>
impl<F: PartialOrd> PartialOrd<FormattedString<F>> for FormattedString<F>
sourcefn partial_cmp(&self, other: &FormattedString<F>) -> Option<Ordering>
fn partial_cmp(&self, other: &FormattedString<F>) -> Option<Ordering>
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresourceimpl<F> Serialize for FormattedString<F>
impl<F> Serialize for FormattedString<F>
impl<F: Eq> Eq for FormattedString<F>
impl<F> StructuralEq for FormattedString<F>
impl<F> StructuralPartialEq for FormattedString<F>
Auto Trait Implementations
impl<F> RefUnwindSafe for FormattedString<F>where
F: RefUnwindSafe,
impl<F> Send for FormattedString<F>where
F: Send,
impl<F> Sync for FormattedString<F>where
F: Sync,
impl<F> Unpin for FormattedString<F>where
F: Unpin,
impl<F> UnwindSafe for FormattedString<F>where
F: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.