pub struct NodeView<'a, V: FromAnyValue = ()> { /* private fields */ }
Expand description

A view into a NodeType with a mask that determines what is visible.

Implementations§

source§

impl<'a, V: FromAnyValue> NodeView<'a, V>

source

pub fn new( id: NodeId, node: &'a NodeType<V>, view: &'a NodeMask, height: u16 ) -> Self

Create a new NodeView from a VNode, and mask.

source

pub fn node_type(&self) -> &'a NodeType<V>

source

pub fn node_id(&self) -> NodeId

Get the node id of the node

source

pub fn height(&self) -> u16

Get the node height

source

pub fn tag(&self) -> Option<&'a TagName>

Get the tag of the node if the tag is enabled in the mask

source

pub fn attributes<'b>( &'b self ) -> Option<impl Iterator<Item = OwnedAttributeView<'a, V>> + 'b>

Get any attributes that are enabled in the mask

source

pub fn text(&self) -> Option<&str>

Get the text if it is enabled in the mask

Trait Implementations§

source§

impl<'a, V: Debug + FromAnyValue> Debug for NodeView<'a, V>

source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a, V> RefUnwindSafe for NodeView<'a, V>
where V: RefUnwindSafe,

§

impl<'a, V> Send for NodeView<'a, V>
where V: Sync,

§

impl<'a, V> Sync for NodeView<'a, V>
where V: Sync,

§

impl<'a, V> Unpin for NodeView<'a, V>

§

impl<'a, V> UnwindSafe for NodeView<'a, V>
where V: RefUnwindSafe,

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> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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.

§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T, O> SuperFrom<T> for O
where O: From<T>,

§

fn super_from(input: T) -> O

Convert from a type to another type.
§

impl<T, O, M> SuperInto<O, M> for T
where O: SuperFrom<T, M>,

§

fn super_into(self) -> O

Convert from a type to another type.
source§

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

§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

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

§

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.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more