Skip to main content

OpenNode

Struct OpenNode 

Source
pub struct OpenNode<'b> {
    pub tag: NodeStr<'b>,
    pub attrs: AttrsRef<'b>,
    pub content: OpenContent<'b>,
}
Expand description

The head of a node the stream has descended into.

Borrows the stream’s buffer, so it lives until the stream’s next call; anything kept longer is copied out.

Fields§

§tag: NodeStr<'b>§attrs: AttrsRef<'b>§content: OpenContent<'b>

Implementations§

Source§

impl<'b> OpenNode<'b>

Source

pub fn get_attr(&self, key: &str) -> Option<&ValueRef<'b>>

Look up a single attribute by key.

Source

pub fn attr_str(&self, key: &str) -> Option<Cow<'_, str>>

An attribute as text, whatever its wire form.

Source

pub fn child_count(&self) -> usize

How many children the node has still to offer, when its content is a list of nodes.

Trait Implementations§

Source§

impl<'b> Debug for OpenNode<'b>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'b> Forget for OpenNode<'b>

§

impl<'b> Freeze for OpenNode<'b>
where &'b str: Freeze, *const (): Freeze, *const [(NodeStr<'b>, ValueRef<'b>)] is !null: Freeze, PhantomData<[(NodeStr<'b>, ValueRef<'b>)]>: Freeze, &'b [u8]: Freeze, Vec<u8>: Freeze, *const [NodeRef<'b>] is !null: Freeze, PhantomData<[NodeRef<'b>]>: Freeze,

§

impl<'b> Move for OpenNode<'b>

§

impl<'b> RefUnwindSafe for OpenNode<'b>

§

impl<'b> Send for OpenNode<'b>
where &'b str: Send, Repr: Send, BoxRaw<[(NodeStr<'b>, ValueRef<'b>)]>: Send, &'b [u8]: Send, Vec<u8>: Send, BoxRaw<[NodeRef<'b>]>: Send,

§

impl<'b> Sync for OpenNode<'b>
where Repr: Sync, BoxRaw<[(NodeStr<'b>, ValueRef<'b>)]>: Sync, Vec<u8>: Sync, BoxRaw<[NodeRef<'b>]>: Sync,

§

impl<'b> Unpin for OpenNode<'b>
where &'b str: Unpin, *const (): Unpin, Box<[(NodeStr<'b>, ValueRef<'b>)]>: Unpin, &'b [u8]: Unpin, Vec<u8>: Unpin, Box<[NodeRef<'b>]>: Unpin,

§

impl<'b> UnsafeUnpin for OpenNode<'b>

§

impl<'b> UnwindSafe for OpenNode<'b>
where &'b str: UnwindSafe, *const (): UnwindSafe, BoxRaw<[(NodeStr<'b>, ValueRef<'b>)]>: UnwindSafe, &'b [u8]: UnwindSafe, Vec<u8>: UnwindSafe, BoxRaw<[NodeRef<'b>]>: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.