pub struct Properties { /* private fields */ }
Expand description
Properties, commonly used for display options.
Implementations§
Source§impl Properties
impl Properties
Sourcepub fn finish(self, context: &CompileContext)
pub fn finish(self, context: &CompileContext)
Finish parsing these properties and submit all their errors.
Sourcepub fn get<T: FromProperty>(&mut self, property: &'static str) -> Property<T>
pub fn get<T: FromProperty>(&mut self, property: &'static str) -> Property<T>
Get a property value by its name.
Sourcepub fn add_if_not_present(
&mut self,
property: &'static str,
(key_span, value): (Span, PropertyValue),
)
pub fn add_if_not_present( &mut self, property: &'static str, (key_span, value): (Span, PropertyValue), )
Add a property along with a value if it is not present yet.
Sourcepub fn merge_with(self, other: Properties) -> Self
pub fn merge_with(self, other: Properties) -> Self
Merge the properties with other properties. Automatically finished the other properties.
If there are collisions, other
overwrites current values.
Trait Implementations§
Source§impl Clone for Properties
impl Clone for Properties
Source§impl Debug for Properties
impl Debug for Properties
Source§impl Default for Properties
impl Default for Properties
Source§impl Display for Properties
impl Display for Properties
Source§impl Drop for Properties
impl Drop for Properties
Source§impl From<Option<DisplayProperties>> for Properties
impl From<Option<DisplayProperties>> for Properties
Source§fn from(value: Option<DisplayProperties>) -> Self
fn from(value: Option<DisplayProperties>) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for Properties
impl RefUnwindSafe for Properties
impl Send for Properties
impl Sync for Properties
impl Unpin for Properties
impl UnwindSafe for Properties
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,
Source§impl<T> CloneWithNode for Twhere
T: Clone,
impl<T> CloneWithNode for Twhere
T: Clone,
Source§fn clone_with_node(&mut self) -> T
fn clone_with_node(&mut self) -> T
Clone
self
and take its node.Source§fn clone_without_node(&self) -> T
fn clone_without_node(&self) -> T
Clone
self
without taking its node.Source§impl<T> Convert for T
impl<T> Convert for T
Source§fn convert<U>(self, context: &CompileContext) -> Expr<U>where
U: ConvertFrom<T>,
fn convert<U>(self, context: &CompileContext) -> Expr<U>where
U: ConvertFrom<T>,
Convert
self
into a specific type. Read moreSource§fn can_convert<U>(&self) -> boolwhere
U: ConvertFrom<T>,
fn can_convert<U>(&self) -> boolwhere
U: ConvertFrom<T>,
Check if
self
can be converted into a specific type. Read more