Skip to main content

DetailedGridInfo

Struct DetailedGridInfo 

Source
pub struct DetailedGridInfo<S: CheapCloneStr = String> {
    pub rows: DetailedGridTracksInfo<S>,
    pub columns: DetailedGridTracksInfo<S>,
    pub items: Vec<DetailedGridItemsInfo>,
}
Expand description

Information from the computation of grid

Fields§

§rows: DetailedGridTracksInfo<S>§columns: DetailedGridTracksInfo<S>§items: Vec<DetailedGridItemsInfo>

Implementations§

Source§

impl<S: CheapCloneStr> DetailedGridInfo<S>

Source

pub fn write_grid_template_rows(&self, out: &mut impl Write) -> Result

Write the used row track sizes and line names to the passed writer in the resolved value format of the grid-template-rows property (see https://www.w3.org/TR/css-grid-1/#resolved-track-list)

Source

pub fn write_grid_template_columns(&self, out: &mut impl Write) -> Result

Write the used column track sizes and line names to the passed writer in the resolved value format of the grid-template-columns property (see https://www.w3.org/TR/css-grid-1/#resolved-track-list)

Source

pub fn grid_template_rows(&self) -> String

Serialize the used row track sizes and line names in the resolved value format of the grid-template-rows property (see https://www.w3.org/TR/css-grid-1/#resolved-track-list)

Source

pub fn grid_template_columns(&self) -> String

Serialize the used column track sizes and line names in the resolved value format of the grid-template-columns property (see https://www.w3.org/TR/css-grid-1/#resolved-track-list)

Source

pub fn resolve_absolute_grid_area( &self, grid_row: Line<GridPlacement<S>>, grid_column: Line<GridPlacement<S>>, direction: Direction, padding_box: Rect<f32>, ) -> Rect<f32>

Resolve the physical grid area for an absolutely positioned box from its grid placement. The padding box and returned area use coordinates relative to the grid container’s border box.

Source

pub fn item_grid_area( &self, item_index: usize, ) -> Option<(Point<f32>, Size<f32>)>

Compute the location and size of the grid area occupied by the item at item_index (an index into DetailedGridInfo::items), relative to the grid container’s border box.

The edges resolve to the edges of the tracks bounding the item’s grid area (a start line resolves to the start of the track that follows it and an end line to the end of the track that precedes it), so the area excludes any gutter or content-alignment spacing around it.

Returns None if item_index is out of bounds.

Trait Implementations§

Source§

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

Source§

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

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl<S: Debug + CheapCloneStr> Debug for DetailedGridInfo<S>

Source§

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

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

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

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · 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> StructuralPartialEq for DetailedGridInfo<S>

Auto Trait Implementations§

§

impl<S> Freeze for DetailedGridInfo<S>

§

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

§

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

§

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

§

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

§

impl<S> UnsafeUnpin for DetailedGridInfo<S>

§

impl<S> UnwindSafe for DetailedGridInfo<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.