pub struct Node {Show 24 fields
pub kind: i32,
pub name: String,
pub x: f32,
pub y: f32,
pub width: f32,
pub height: f32,
pub opacity: f32,
pub on_click: String,
pub fill: Option<Color>,
pub stroke: Option<Color>,
pub stroke_width: f32,
pub radius: Vec<f32>,
pub shadow: Option<Shadow>,
pub clip: bool,
pub layout: i32,
pub gap: f32,
pub padding: Vec<f32>,
pub align: i32,
pub justify: i32,
pub text: Option<Text>,
pub children: Vec<Node>,
pub gradient: Option<Gradient>,
pub vector: Option<Vector>,
pub image: Option<Image>,
}Expand description
One node of a scene, every attribute resolved. A size is pixels, or -1
for hug and -2 for fill. A fill is fill (one color) or gradient, never
both.
Fields§
§kind: i32§name: String§x: f32§y: f32§width: f32§height: f32§opacity: f32§on_click: String§fill: Option<Color>§stroke: Option<Color>§stroke_width: f32§radius: Vec<f32>§shadow: Option<Shadow>§clip: bool§layout: i32§gap: f32§padding: Vec<f32>§align: i32§justify: i32§text: Option<Text>§children: Vec<Node>§gradient: Option<Gradient>§vector: Option<Vector>§image: Option<Image>Implementations§
Source§impl Node
impl Node
Sourcepub fn kind(&self) -> Kind
pub fn kind(&self) -> Kind
Returns the enum value of kind, or the default if the field is set to an invalid enum value.
Sourcepub fn layout(&self) -> Layout
pub fn layout(&self) -> Layout
Returns the enum value of layout, or the default if the field is set to an invalid enum value.
Sourcepub fn set_layout(&mut self, value: Layout)
pub fn set_layout(&mut self, value: Layout)
Sets layout to the provided enum value.
Sourcepub fn align(&self) -> Align
pub fn align(&self) -> Align
Returns the enum value of align, or the default if the field is set to an invalid enum value.
Sourcepub fn justify(&self) -> Align
pub fn justify(&self) -> Align
Returns the enum value of justify, or the default if the field is set to an invalid enum value.
Sourcepub fn set_justify(&mut self, value: Align)
pub fn set_justify(&mut self, value: Align)
Sets justify to the provided enum value.
Trait Implementations§
Source§impl Message for Node
impl Message for Node
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Returns the encoded length of the message without a length delimiter.
Source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
Encodes the message to a buffer. Read more
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Encodes the message to a newly allocated buffer.
Source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
Encodes the message with a length-delimiter to a buffer. Read more
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Encodes the message with a length-delimiter to a newly allocated buffer.
Source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Decodes an instance of the message from a buffer. Read more
Source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Decodes a length-delimited instance of the message from the buffer.
Source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
Decodes an instance of the message from a buffer, and merges it into
self. Read moreSource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
Decodes a length-delimited instance of the message from buffer, and
merges it into
self.impl StructuralPartialEq for Node
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> 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