pub struct Argument<'a> { /* private fields */ }Expand description
A named value passed to a message without allocating a string for numbers.
Implementations§
Source§impl<'a> Argument<'a>
impl<'a> Argument<'a>
Sourcepub fn new(
name: &'static str,
value: impl Into<FluentValue<'a>>,
) -> Argument<'a>
pub fn new( name: &'static str, value: impl Into<FluentValue<'a>>, ) -> Argument<'a>
Borrows strings and preserves numeric values for Fluent plural selection.
Sourcepub fn take_owned(&mut self) -> Argument<'static>
pub fn take_owned(&mut self) -> Argument<'static>
Transfers owned values into a cache, copying only borrowed text that must outlive the call.
Sourcepub fn update_from(&mut self, source: &mut Argument<'_>)
pub fn update_from(&mut self, source: &mut Argument<'_>)
Updates an owned cache argument, reusing string storage when possible.
Trait Implementations§
impl<'a> StructuralPartialEq for Argument<'a>
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for Argument<'a>
impl<'a> !Sync for Argument<'a>
impl<'a> !UnwindSafe for Argument<'a>
impl<'a> Freeze for Argument<'a>
impl<'a> Send for Argument<'a>
impl<'a> Unpin for Argument<'a>
impl<'a> UnsafeUnpin for Argument<'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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
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