Enum nannou::draw::properties::spatial::dimension::Dimension [−][src]
pub enum Dimension<S = DefaultScalar> { Absolute(S), Relative(Index, Relative<S>), }
The length of a Node over either the x or y axes.
This type is used to represent the different ways in which a dimension may be sized.
Variants
Absolute(S)
Some specific length has been given.
Relative(Index, Relative<S>)
The dimension is described as relative to the node at the given index.
Methods
impl<S> Dimension<S> where
S: BaseFloat,
[src]
impl<S> Dimension<S> where
S: BaseFloat,
pub fn to_scalar<F>(&self, dimension_of: F) -> S where
F: FnOnce(&Index) -> S,
[src]
pub fn to_scalar<F>(&self, dimension_of: F) -> S where
F: FnOnce(&Index) -> S,
Return the Dimension as a scalar value.
Relative dimensions are produced by accessing the dimension of some relative node via the
given dimension_of
function.
Trait Implementations
impl<S: Copy> Copy for Dimension<S>
[src]
impl<S: Copy> Copy for Dimension<S>
impl<S: Clone> Clone for Dimension<S>
[src]
impl<S: Clone> Clone for Dimension<S>
fn clone(&self) -> Dimension<S>
[src]
fn clone(&self) -> Dimension<S>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0
[src]Performs copy-assignment from source
. Read more
impl<S: Debug> Debug for Dimension<S>
[src]
impl<S: Debug> Debug for Dimension<S>
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl<S: PartialEq> PartialEq for Dimension<S>
[src]
impl<S: PartialEq> PartialEq for Dimension<S>