pub struct ComponentNodeMetaData {
pub computed_data: Option<ComputedData>,
pub rel_position: Option<PxPosition>,
pub abs_position: Option<PxPosition>,
/* private fields */
}
Expand description
Contains metadata of the component node.
Fields§
§computed_data: Option<ComputedData>
The computed data (size) of the node. None if the node is not computed yet.
rel_position: Option<PxPosition>
The node’s start position, relative to its parent. None if the node is not placed yet.
abs_position: Option<PxPosition>
The node’s start position, relative to the root window. This will be computed during drawing command’s generation. None if the node is not drawn yet.
Implementations§
Source§impl ComponentNodeMetaData
impl ComponentNodeMetaData
Sourcepub fn push_draw_command(&mut self, command: impl DrawCommand + 'static)
pub fn push_draw_command(&mut self, command: impl DrawCommand + 'static)
Pushes a draw command to the node’s metadata.
Draw commands are responsible for rendering visual content (shapes, text, images).
This method wraps the command in the unified Command::Draw
variant and adds it
to the command queue. Commands are executed in the order they are added.
§Example
metadata.push_draw_command(ShapeCommand::Rect {
color: [1.0, 0.0, 0.0, 1.0],
corner_radius: 8.0,
shadow: None,
});
Sourcepub fn push_compute_command(&mut self, command: impl ComputeCommand + 'static)
pub fn push_compute_command(&mut self, command: impl ComputeCommand + 'static)
Pushes a compute command to the node’s metadata.
Compute commands perform GPU computation tasks (post-processing effects,
complex calculations). This method wraps the command in the unified
Command::Compute
variant and adds it to the command queue.
§Example
metadata.push_compute_command(BlurCommand {
radius: 5.0,
sigma: 2.0,
});
Trait Implementations§
Source§impl Default for ComponentNodeMetaData
impl Default for ComponentNodeMetaData
Source§fn default() -> ComponentNodeMetaData
fn default() -> ComponentNodeMetaData
Auto Trait Implementations§
impl Freeze for ComponentNodeMetaData
impl !RefUnwindSafe for ComponentNodeMetaData
impl Send for ComponentNodeMetaData
impl Sync for ComponentNodeMetaData
impl Unpin for ComponentNodeMetaData
impl !UnwindSafe for ComponentNodeMetaData
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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
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>
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 more§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian()
.