pub(crate) struct AttrStrRef<'a>(Option<AttrStrRefInner<'a>>);Expand description
A reference to an attribute string value as that keeps the element’s attributes
borrowed while it is still alive. To convert this value to a &str use
value().as_ref().
This contains an Option in able to support the Default attribute, which allows
treating a missing attribute as an empty string. This is kind of value is only
created by Default, never returned from the attribute getter.
Tuple Fields§
§0: Option<AttrStrRefInner<'a>>Implementations§
Source§impl<'a> AttrStrRef<'a>
impl<'a> AttrStrRef<'a>
Sourcepub(in dom::element) fn maybe_new(
attrs: AttributesBorrow<'a>,
namespace: &Namespace,
local_name: &LocalName,
) -> Option<AttrStrRef<'a>>
pub(in dom::element) fn maybe_new( attrs: AttributesBorrow<'a>, namespace: &Namespace, local_name: &LocalName, ) -> Option<AttrStrRef<'a>>
Create a new AttrStrRef for the attribute named by local_name. Returns None
if the attribute was not found.
Sourcepub(crate) fn as_attr_ref<'b>(&'b self) -> AttrRef<'b>
pub(crate) fn as_attr_ref<'b>(&'b self) -> AttrRef<'b>
Return the AttrRef from the AttrStrRef.
Sourcepub(crate) fn value(&self) -> AttrValueRef<'_>
pub(crate) fn value(&self) -> AttrValueRef<'_>
Return the AttrValueRef that underlies this AttrStrRef.
pub(crate) fn is_empty(&self) -> bool
pub(crate) fn eq_ignore_ascii_case(&self, other: &str) -> bool
Trait Implementations§
Source§impl<'a> Default for AttrStrRef<'a>
impl<'a> Default for AttrStrRef<'a>
Source§fn default() -> AttrStrRef<'a>
fn default() -> AttrStrRef<'a>
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for AttrStrRef<'a>
impl<'a> !Send for AttrStrRef<'a>
impl<'a> !Sync for AttrStrRef<'a>
impl<'a> !UnwindSafe for AttrStrRef<'a>
impl<'a> Freeze for AttrStrRef<'a>
impl<'a> Unpin for AttrStrRef<'a>
impl<'a> UnsafeUnpin for AttrStrRef<'a>
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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> MaybeBoxed<Box<T>> for T
impl<T> MaybeBoxed<Box<T>> for T
Source§fn maybe_boxed(self) -> Box<T>
fn maybe_boxed(self) -> Box<T>
Convert
Source§impl<T> MaybeBoxed<T> for T
impl<T> MaybeBoxed<T> for T
Source§fn maybe_boxed(self) -> T
fn maybe_boxed(self) -> T
Convert