Struct kas_core::layout::AxisInfo

source ·
pub struct AxisInfo { /* private fields */ }
Expand description

Information on which axis is being resized

Also conveys the size of the other axis, if fixed.

Implementations§

source§

impl AxisInfo

source

pub fn new(vertical: bool, fixed: Option<i32>, align: Option<Align>) -> Self

Construct with direction and an optional value for the other axis

This method is usually not required by user code.

source

pub fn with_align_hints(self, hints: AlignHints) -> Self

Construct a copy using the given alignment hints

source

pub fn is_vertical(self) -> bool

True if the current axis is vertical

source

pub fn is_horizontal(self) -> bool

True if the current axis is horizontal

source

pub fn align(self) -> Option<Align>

Get align parameter

source

pub fn set_align(&mut self, align: Option<Align>)

Set align parameter

source

pub fn set_default_align(&mut self, align: Align)

Set default alignment

If the optional alignment parameter is None, replace with align.

source

pub fn set_default_align_hv(&mut self, horiz: Align, vert: Align)

Set default alignment

If the optional alignment parameter is None, replace with either horiz or vert depending on this axis’ orientation.

source

pub fn align_or_default(self) -> Align

Get align parameter, defaulting to Align::Default

source

pub fn align_or_center(self) -> Align

Get align parameter, defaulting to Align::Center

source

pub fn align_or_stretch(self) -> Align

Get align parameter, defaulting to Align::Stretch

source

pub fn other(&self) -> Option<i32>

Size of other axis, if fixed

source

pub fn size_other_if_fixed(&self, vertical: bool) -> Option<i32>

Size of other axis, if fixed and vertical matches this axis.

source

pub fn sub_other(&mut self, x: i32)

Subtract x from size of other axis (if applicable)

Trait Implementations§

source§

impl Clone for AxisInfo

source§

fn clone(&self) -> AxisInfo

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for AxisInfo

source§

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

Formats the value using the given formatter. Read more
source§

impl Directional for AxisInfo

§

type Flipped = AxisInfo

Direction flipped over diagonal (i.e. Down ↔ Right) Read more
§

type Reversed = AxisInfo

Direction reversed along axis (i.e. Left ↔ Right) Read more
source§

fn flipped(self) -> Self::Flipped

Flip over diagonal (i.e. Down ↔ Right)
source§

fn reversed(self) -> Self::Reversed

Reverse along axis (i.e. Left ↔ Right)
source§

fn as_direction(self) -> Direction

Convert to the Direction enum
source§

fn is_vertical(self) -> bool

Up or Down
source§

fn is_horizontal(self) -> bool

Left or Right
source§

fn is_reversed(self) -> bool

Left or Up
source§

impl From<AxisInfo> for Directions

source§

fn from(axis: AxisInfo) -> Directions

Converts to this type from the input type.
source§

impl Copy for AxisInfo

Auto Trait Implementations§

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<S, T> Cast<T> for S
where T: Conv<S>,

source§

fn cast(self) -> T

Cast from Self to T Read more
source§

fn try_cast(self) -> Result<T, Error>

Try converting from Self to T Read more
source§

impl<S, T> CastApprox<T> for S
where T: ConvApprox<S>,

source§

fn try_cast_approx(self) -> Result<T, Error>

Try approximate conversion from Self to T Read more
source§

fn cast_approx(self) -> T

Cast approximately from Self to T Read more
source§

impl<S, T> CastFloat<T> for S
where T: ConvFloat<S>,

source§

fn cast_trunc(self) -> T

Cast to integer, truncating Read more
source§

fn cast_nearest(self) -> T

Cast to the nearest integer Read more
source§

fn cast_floor(self) -> T

Cast the floor to an integer Read more
source§

fn cast_ceil(self) -> T

Cast the ceiling to an integer Read more
source§

fn try_cast_trunc(self) -> Result<T, Error>

Try converting to integer with truncation Read more
source§

fn try_cast_nearest(self) -> Result<T, Error>

Try converting to the nearest integer Read more
source§

fn try_cast_floor(self) -> Result<T, Error>

Try converting the floor to an integer Read more
source§

fn try_cast_ceil(self) -> Result<T, Error>

Try convert the ceiling to an integer Read more
§

impl<T> Downcast for T
where T: 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.
§

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

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

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

impl<T> DowncastSync for T
where T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
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.

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

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