Struct lignin::Attribute[][src]

pub struct Attribute<'a> {
    pub name: &'a str,
    pub value: &'a str,
}

Vdom Represents a single HTML Attr with name and value.

Fields

name: &'a str

The name.

Implementation Contract

Security

While applications should generally avoid it, Attribute::name may contain characters that are unexpected in this position.

Renderers may only process these verbatim iff they can expect this to not cause security issues.

For example: Passing an invalid attribute name to a DOM API isolated in a dedicated parameter is probably okay, as long as something along the way validates it doesn’t contain '\0'.

Serializing an invalid attribute name to HTML is a very bad idea, so renderers must never do so.

value: &'a str

The unescaped value.

Implementations

impl<'a> Attribute<'a>[src]

#[must_use]
pub fn deanonymize(self) -> Self
[src]

👎 Deprecated:

Call of .deanonymize() on named type.

When called on an opaque type, deanonymizes it into the underlying named type.

Both AutoSafe and Deanonymize must be in scope and the method must be called without qualification for this to work.

Calling this method on a named type returns the value and type unchanged and produces a deprecation warning.

#[must_use]
pub fn prefer_thread_safe(self) -> Self
[src]

👎 Deprecated:

Call of .prefer_thread_safe() on Attribute.

Gently nudges the compiler to choose the ThreadSafe version of a value if both are possible.

This method is by value, so it will resolve with higher priority than the by-reference method on the ThreadBound type.

Note that not all tooling will show the correct overload here, but the compiler knows which to pick.

Calling this method on Attribute produces a deprecation warning since the type is always ThreadSafe.

#[must_use]
pub fn prefer_thread_safe_ref(&self) -> &Self
[src]

👎 Deprecated:

Call of .prefer_thread_safe_ref() on Attribute.

Gently nudges the compiler to choose the ThreadSafe version of a reference if both are possible.

This method is once by single reference, so it will resolve with higher priority than the twice-by-reference method on the ThreadBound type.

Note that not all tooling will show the correct overload here, but the compiler knows which to pick.

Calling this method on Attribute produces a deprecation warning since the type is always ThreadSafe.

Trait Implementations

impl<'a> Clone for Attribute<'a>[src]

impl<'a> Copy for Attribute<'a>[src]

impl<'a> Debug for Attribute<'a>[src]

impl<'a> Eq for Attribute<'a>[src]

impl<'a> Hash for Attribute<'a>[src]

impl<'a> Ord for Attribute<'a>[src]

impl<'a> PartialEq<Attribute<'a>> for Attribute<'a>[src]

impl<'a> PartialOrd<Attribute<'a>> for Attribute<'a>[src]

impl<'a> StructuralEq for Attribute<'a>[src]

impl<'a> StructuralPartialEq for Attribute<'a>[src]

impl<'a> Vdom for Attribute<'a>[src]

Auto Trait Implementations

impl<'a> RefUnwindSafe for Attribute<'a>

impl<'a> Send for Attribute<'a>

impl<'a> Sync for Attribute<'a>

impl<'a> Unpin for Attribute<'a>

impl<'a> UnwindSafe for Attribute<'a>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.