pub struct Fluent { /* private fields */ }
Implementations§
Source§impl Fluent
impl Fluent
Sourcepub fn from(attributes: HashMap<String, Value>) -> Self
pub fn from(attributes: HashMap<String, Value>) -> Self
Create a fluent instance from the given attributes.
Sourcepub fn set(&mut self, key: &str, value: impl Into<Value>)
pub fn set(&mut self, key: &str, value: impl Into<Value>)
Set an attribute on the fluent instance using “dot” notation.
Sourcepub fn get(&self, key: &str) -> Option<&Value>
pub fn get(&self, key: &str) -> Option<&Value>
Get an attribute from the fluent instance using “dot” notation.
Sourcepub fn get_as_str(&self, key: &str) -> Option<&str>
pub fn get_as_str(&self, key: &str) -> Option<&str>
Get a value off the instance and cast to str.
Sourcepub fn fill(&mut self, attributes: HashMap<String, Value>) -> &mut Self
pub fn fill(&mut self, attributes: HashMap<String, Value>) -> &mut Self
Fill the fluent instance with the attributes.
Sourcepub fn value(&self, key: &str, default: Value) -> Value
pub fn value(&self, key: &str, default: Value) -> Value
Get and attribute from the fluent instance.
Sourcepub fn scope(&self, key: &str, default: Value) -> Self
pub fn scope(&self, key: &str, default: Value) -> Self
Wrap the value of key in a new fluent instance.
Sourcepub fn get_attributes(&self) -> &HashMap<String, Value>
pub fn get_attributes(&self) -> &HashMap<String, Value>
Get the attributes on the fluent instance.
Trait Implementations§
Source§impl JsonSerializable for Fluent
impl JsonSerializable for Fluent
impl Eq for Fluent
impl StructuralPartialEq for Fluent
Auto Trait Implementations§
impl Freeze for Fluent
impl RefUnwindSafe for Fluent
impl Send for Fluent
impl Sync for Fluent
impl Unpin for Fluent
impl UnwindSafe for Fluent
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