pub struct Attribute {
pub id: Identifier,
pub commands: Vec<AttributeCommand>,
pub is_inner: bool,
pub src_ref: SrcRef,
}Expand description
An attribute item.
Fields§
§id: IdentifierThe id of the attribute.
commands: Vec<AttributeCommand>Attribute commands: width, height(30mm).
is_inner: boolTells if the attribute is an inner attribute: #[...] (outer) vs #![...] (inner).
src_ref: SrcRefSource reference
Implementations§
Source§impl Attribute
impl Attribute
Sourcepub fn single_command(&self) -> Option<&AttributeCommand>
pub fn single_command(&self) -> Option<&AttributeCommand>
Return some command it is the only one in the list.
Trait Implementations§
Source§impl Eval<Option<Color>> for Attribute
impl Eval<Option<Color>> for Attribute
Source§fn eval(&self, context: &mut EvalContext) -> EvalResult<Option<Color>>
fn eval(&self, context: &mut EvalContext) -> EvalResult<Option<Color>>
Evaluate a syntax element into a type
T.Source§impl Eval<Option<ResolutionAttribute>> for Attribute
impl Eval<Option<ResolutionAttribute>> for Attribute
Source§fn eval(
&self,
context: &mut EvalContext,
) -> EvalResult<Option<ResolutionAttribute>>
fn eval( &self, context: &mut EvalContext, ) -> EvalResult<Option<ResolutionAttribute>>
Evaluate a syntax element into a type
T.Source§impl Eval<Option<Size2>> for Attribute
impl Eval<Option<Size2>> for Attribute
Source§fn eval(&self, context: &mut EvalContext) -> EvalResult<Option<Size2>>
fn eval(&self, context: &mut EvalContext) -> EvalResult<Option<Size2>>
Evaluate a syntax element into a type
T.Source§impl Eval<Vec<Attribute>> for Attribute
impl Eval<Vec<Attribute>> for Attribute
Source§fn eval(&self, context: &mut EvalContext) -> EvalResult<Vec<Attribute>>
fn eval(&self, context: &mut EvalContext) -> EvalResult<Vec<Attribute>>
Evaluate a syntax element into a type
T.Source§impl Eval<Vec<CustomCommand>> for Attribute
impl Eval<Vec<CustomCommand>> for Attribute
Source§fn eval(&self, context: &mut EvalContext) -> EvalResult<Vec<CustomCommand>>
fn eval(&self, context: &mut EvalContext) -> EvalResult<Vec<CustomCommand>>
Evaluate a syntax element into a type
T.Source§impl Eval<Vec<ExportCommand>> for Attribute
impl Eval<Vec<ExportCommand>> for Attribute
Source§fn eval(&self, context: &mut EvalContext) -> EvalResult<Vec<ExportCommand>>
fn eval(&self, context: &mut EvalContext) -> EvalResult<Vec<ExportCommand>>
Evaluate a syntax element into a type
T.Source§impl Eval<Vec<MeasureCommand>> for Attribute
impl Eval<Vec<MeasureCommand>> for Attribute
Source§fn eval(&self, context: &mut EvalContext) -> EvalResult<Vec<MeasureCommand>>
fn eval(&self, context: &mut EvalContext) -> EvalResult<Vec<MeasureCommand>>
Evaluate a syntax element into a type
T.Source§impl SrcReferrer for Attribute
impl SrcReferrer for Attribute
Source§impl TreeDisplay for Attribute
impl TreeDisplay for Attribute
Source§fn tree_print(&self, f: &mut Formatter<'_>, depth: TreeState) -> Result
fn tree_print(&self, f: &mut Formatter<'_>, depth: TreeState) -> Result
Write item into
f and use {:depth$} syntax in front of your single line
output to get proper indention.Source§fn display_tree(&self, f: &mut Formatter<'_>) -> Result
fn display_tree(&self, f: &mut Formatter<'_>) -> Result
Display as tree starting at depth
0.Source§fn debug_tree(&self, f: &mut Formatter<'_>) -> Result
fn debug_tree(&self, f: &mut Formatter<'_>) -> Result
Display as tree starting at given depth in debug mode
Auto Trait Implementations§
impl Freeze for Attribute
impl RefUnwindSafe for Attribute
impl !Send for Attribute
impl !Sync for Attribute
impl Unpin for Attribute
impl UnwindSafe for Attribute
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> 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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
Fallible version of
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
Converts the given value to a
CompactString. Read more