Enum GridPlacement

Source
pub enum GridPlacement<S: CheapCloneStr = String> {
    Auto,
    Line(GridLine),
    NamedLine(S, i16),
    Span(u16),
    NamedSpan(S, u16),
}
Expand description

A grid line placement specification. Used for grid-[row/column]-[start/end]. Named tracks are not implemented.

Defaults to GridPlacement::Auto

Specification

Variants§

§

Auto

Place item according to the auto-placement algorithm, and the parent’s grid_auto_flow property

§

Line(GridLine)

Place item at specified line (column or row) index

§

NamedLine(S, i16)

Place item at specified named line (column or row)

§

Span(u16)

Item should span specified number of tracks (columns or rows)

§

NamedSpan(S, u16)

Item should span until the nth line named .

If there are less than n lines named in the specified direction then all implicit lines will be counted.

Implementations§

Source§

impl<S: CheapCloneStr> GridPlacement<S>

Source

pub fn into_origin_zero_placement_ignoring_named( &self, explicit_track_count: u16, ) -> GenericGridPlacement<OriginZeroLine>

Apply a mapping function if the GridPlacement is a Line. Otherwise return self unmodified.

Trait Implementations§

Source§

impl<S: Clone + CheapCloneStr> Clone for GridPlacement<S>

Source§

fn clone(&self) -> GridPlacement<S>

Returns a duplicate 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<S: Debug + CheapCloneStr> Debug for GridPlacement<S>

Source§

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

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

impl<S: CheapCloneStr> Default for GridPlacement<S>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<S: PartialEq + CheapCloneStr> PartialEq for GridPlacement<S>

Source§

fn eq(&self, other: &GridPlacement<S>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<S: CheapCloneStr> TaffyAuto for GridPlacement<S>

Source§

const AUTO: Self = Self::Auto

The auto value for type implementing TaffyAuto
Source§

impl<S: CheapCloneStr> TaffyGridLine for GridPlacement<S>

Source§

fn from_line_index(index: i16) -> Self

Converts an i16 into Self
Source§

impl<S: CheapCloneStr> TaffyGridSpan for GridPlacement<S>

Source§

fn from_span(span: u16) -> Self

Converts an u16 into Self
Source§

impl<S: CheapCloneStr> StructuralPartialEq for GridPlacement<S>

Auto Trait Implementations§

§

impl<S> Freeze for GridPlacement<S>
where S: Freeze,

§

impl<S> RefUnwindSafe for GridPlacement<S>
where S: RefUnwindSafe,

§

impl<S> Send for GridPlacement<S>
where S: Send,

§

impl<S> Sync for GridPlacement<S>
where S: Sync,

§

impl<S> Unpin for GridPlacement<S>
where S: Unpin,

§

impl<S> UnwindSafe for GridPlacement<S>
where S: UnwindSafe,

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

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

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.