pub struct Attribute<'a, Spec: Specification = Raw> {
pub name: Name<'a, Spec>,
pub value: Value<'a, Spec>,
}Expand description
Fields§
§name: Name<'a, Spec>The name of the attribute.
value: Value<'a, Spec>The value of the attribute.
Implementations§
Source§impl<'a, Spec: Specification> Attribute<'a, Spec>
impl<'a, Spec: Specification> Attribute<'a, Spec>
Sourcepub fn validate<TargetSpec: Specification>(&self) -> Result<(), AttributeError>
pub fn validate<TargetSpec: Specification>(&self) -> Result<(), AttributeError>
Validate that the attribute conforms to a target specification.
§Errors
Returns an AttributeError if the attribute does not conform to the target specification.
Sourcepub fn into_spec<TargetSpec: Specification>(
self,
) -> Result<Attribute<'a, TargetSpec>, AttributeError>
pub fn into_spec<TargetSpec: Specification>( self, ) -> Result<Attribute<'a, TargetSpec>, AttributeError>
Convert the attribute into a target specification.
§Errors
Returns an AttributeError if the attribute does not conform to the target specification.
Sourcepub fn into_owned(self) -> Attribute<'static, Spec>
pub fn into_owned(self) -> Attribute<'static, Spec>
Convert this attribute into an owned ('static) variant.
Trait Implementations§
Source§impl<Spec: Specification> Display for Attribute<'_, Spec>
impl<Spec: Specification> Display for Attribute<'_, Spec>
Source§impl<'a, Spec: Specification> Serialize for Attribute<'a, Spec>
impl<'a, Spec: Specification> Serialize for Attribute<'a, Spec>
impl<'a, Spec: Eq + Specification> Eq for Attribute<'a, Spec>
impl<'a, Spec: Specification> StructuralPartialEq for Attribute<'a, Spec>
Auto Trait Implementations§
impl<'a, Spec> Freeze for Attribute<'a, Spec>
impl<'a, Spec> RefUnwindSafe for Attribute<'a, Spec>where
Spec: RefUnwindSafe,
impl<'a, Spec> Send for Attribute<'a, Spec>where
Spec: Send,
impl<'a, Spec> Sync for Attribute<'a, Spec>where
Spec: Sync,
impl<'a, Spec> Unpin for Attribute<'a, Spec>where
Spec: Unpin,
impl<'a, Spec> UnwindSafe for Attribute<'a, Spec>where
Spec: UnwindSafe,
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