Skip to main content

Node

Struct Node 

Source
pub struct Node {
    pub parent: Option<NodeId>,
    pub children: Vec<NodeId>,
    pub transform: Affine2D,
    pub clip: bool,
    pub z_order: i32,
    pub opacity: f32,
    pub content: NodeContent,
    pub key: Option<MarkKey>,
}
Expand description

A node in the scene graph.

Fields§

§parent: Option<NodeId>

Parent node.

§children: Vec<NodeId>

Child nodes.

§transform: Affine2D

Local transform.

§clip: bool

Whether this node clips its children to its bounds.

§z_order: i32

Z-order for sibling sorting.

§opacity: f32

Opacity multiplier [0, 1].

§content: NodeContent

The visual content of this node.

§key: Option<MarkKey>

Optional key for scene diffing (transitions).

Implementations§

Source§

impl Node

Source

pub fn container() -> Self

Create a container node.

Source

pub fn with_mark(mark: Mark) -> Self

Create a node wrapping a single mark.

Source

pub fn with_batch(batch: MarkBatch) -> Self

Create a node wrapping a mark batch.

Source

pub fn transform(self, t: Affine2D) -> Self

Set the transform and return self.

Source

pub fn z_order(self, z: i32) -> Self

Set z_order and return self.

Source

pub fn key(self, k: MarkKey) -> Self

Set the key and return self.

Auto Trait Implementations§

§

impl Freeze for Node

§

impl RefUnwindSafe for Node

§

impl Send for Node

§

impl Sync for Node

§

impl Unpin for Node

§

impl UnsafeUnpin for Node

§

impl UnwindSafe for Node

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.

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 = 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>,

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.