pub struct MessageContract {
pub message: &'static str,
pub attribute: Option<&'static str>,
pub vars: &'static [&'static str],
pub bool_vars: &'static [&'static str],
pub elements: &'static [ElementContract],
}Expand description
The compiled contract of one generated message accessor: which message (or
attribute) it resolves, which arguments it fills, and — for structured
messages — the exact (Element) marker sequence it splits on.
Instances are emitted by the build step into the generated file’s
MESSAGE_CONTRACTS static; there is no reason to construct one by hand.
Fields§
§message: &'static strThe Fluent message id.
attribute: Option<&'static str>The attribute of the message, for an attribute accessor.
vars: &'static [&'static str]The argument names the accessor fills ($variable names).
bool_vars: &'static [&'static str]Variables encoded from Rust bool as Fluent "true" / "false".
elements: &'static [ElementContract]The (Element) markers, in pattern order. Empty for plain messages.
Trait Implementations§
Source§impl Clone for MessageContract
impl Clone for MessageContract
Source§fn clone(&self) -> MessageContract
fn clone(&self) -> MessageContract
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for MessageContract
Source§impl Debug for MessageContract
impl Debug for MessageContract
impl Eq for MessageContract
Source§impl PartialEq for MessageContract
impl PartialEq for MessageContract
impl StructuralPartialEq for MessageContract
Auto Trait Implementations§
impl Freeze for MessageContract
impl RefUnwindSafe for MessageContract
impl Send for MessageContract
impl Sync for MessageContract
impl Unpin for MessageContract
impl UnsafeUnpin for MessageContract
impl UnwindSafe for MessageContract
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