pub enum StackMargin {
Start,
Center,
End,
Between,
Evenly,
Around,
Manual(Box<UiValue<Vec4>>),
}Expand description
Stack margin - A special type to define margin subnodes should inherit. Contains a set of presets.
ยง๐ ๏ธ Example
let margin = StackMargin::Start; // -> Default, does nothing
let margin = StackMargin::Center; // -> Subnodes on sides will inherit 1sp on sides facing out
let margin = StackMargin::End; // -> First subnode will inherit 1sp on left side
let margin = StackMargin::Between;// -> All subnodes except 1st will inherit 1sp on left side
let margin = StackMargin::Evenly; // -> All subnodes will inherit 1sp on both sides except 1st
let margin = StackMargin::Around; // -> All subnodes will inherit 1sp on both sidesVariantsยง
Start
Default, does nothing.
Center
Subnodes on sides will inherit 1sp on sides facing out.
End
First subnode will inherit 1sp on left side.
Between
All subnodes except 1st will inherit 1sp on left side.
Evenly
All subnodes will inherit 1sp on both sides except 1st (only left).
Around
All subnodes will inherit 1sp on both sides.
Manual(Box<UiValue<Vec4>>)
Manually set margin for all subnodes.
Trait Implementationsยง
Sourceยงimpl Clone for StackMargin
impl Clone for StackMargin
Sourceยงfn clone(&self) -> StackMargin
fn clone(&self) -> StackMargin
Returns a duplicate of the value. Read more
1.0.0ยงfn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSourceยงimpl Debug for StackMargin
impl Debug for StackMargin
Sourceยงimpl Default for StackMargin
impl Default for StackMargin
Sourceยงfn default() -> StackMargin
fn default() -> StackMargin
Returns the โdefault valueโ for a type. Read more
Sourceยงimpl PartialEq for StackMargin
impl PartialEq for StackMargin
impl StructuralPartialEq for StackMargin
Auto Trait Implementationsยง
impl Freeze for StackMargin
impl RefUnwindSafe for StackMargin
impl Send for StackMargin
impl Sync for StackMargin
impl Unpin for StackMargin
impl UnwindSafe for StackMargin
Blanket Implementationsยง
Sourceยงimpl<T, U> AsBindGroupShaderType<U> for T
impl<T, U> AsBindGroupShaderType<U> for T
Sourceยงfn as_bind_group_shader_type(&self, _images: &RenderAssets<GpuImage>) -> U
fn as_bind_group_shader_type(&self, _images: &RenderAssets<GpuImage>) -> U
Return the
T ShaderType for self. When used in AsBindGroup
derives, it is safe to assume that all images in self exist.ยงimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
ยงfn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
ยงimpl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
ยงunsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
๐ฌThis is a nightly-only experimental API. (
clone_to_uninit)Sourceยงimpl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Sourceยงfn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
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.Sourceยงfn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Sourceยงfn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Anyโs vtable from &Traitโs.Sourceยงfn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Anyโs vtable from &mut Traitโs.Sourceยงimpl<T> DowncastSync for T
impl<T> DowncastSync for T
Sourceยงimpl<T> FromWorld for Twhere
T: Default,
impl<T> FromWorld for Twhere
T: Default,
Sourceยงfn from_world(_world: &mut World) -> T
fn from_world(_world: &mut World) -> T
Creates
Self using data from the given World.