Skip to main content

Node

Struct Node 

Source
pub struct Node<I, G = DAffine3> {
    pub id: Option<String>,
    pub item: Option<I>,
    pub children: Vec<Transformed<Node<I, G>, G>>,
}
Expand description

A node of a scene-graph tree: pure structure — an external id, an optional payload, and a list of placed children.

Placement is not stored on the node: each child sits inside a Transformed wrapper carrying its local-to-parent transform, so the doctrine “placement lives in Transformed only” holds for trees too. All pose algebra (composition, lerp, AABB corners, widening, root posing) comes from Transformed’s own implementations instead of being duplicated here, and a whole tree is placed by wrapping it: Transformed::new(tree, pose) or tree.transformed(pose).

This is the same division as reading a glTF scene structurally: the node’s name/mesh map to the payload and id, while its matrix|TRS maps to the wrapper around the node.

§Examples

Build trees with Node::leaf, Node::group, Node::branch, and the builders; place a child with transformed:

use ranim_core::core_item::transformed::TransformedExt;
use ranim_core::glam::dvec3;
use ranim_core::traits::Translation;
use ranim_items::hierarchy::Node;

let tree = Node {
    id: Some("outer".into()),
    item: None,
    children: vec![
        Node::leaf("geometry".to_string())
            .transformed(Translation(dvec3(1.0, 0.0, 0.0))),
    ],
};
assert_eq!(tree.children[0].inner.item(), Some(&"geometry".to_string()));

Fields§

§id: Option<String>

External identifier carried from the source format (e.g. SVG element id, glTF node name). Ignored by rendering/extraction beyond being transported: alignment preserves it, and lerping switches ids at the mid-point exactly like other front-loaded fields in ranim.

§item: Option<I>

The payload carried by this node, in canonical local coordinates.

§children: Vec<Transformed<Node<I, G>, G>>

The placed child nodes, living in this node’s local space. Stored in source order; extraction preserves that order depth-first so downstream consumers see painter’s-algorithm ordering, and a node’s own payload paints before its descendants.

Implementations§

Source§

impl<I, G> Node<I, G>

Source

pub fn new(item: Option<I>, children: Vec<Transformed<Self, G>>) -> Self

Pair a payload (if any) with placed children, without an external id.

Source

pub fn with_id(self, id: impl Into<String>) -> Self

Attach an external id, consuming and returning the node.

Source

pub fn is_leaf(&self) -> bool

Whether this node is a bare leaf: a payload with no children.

Source

pub fn is_group(&self) -> bool

Whether this node is a pure frame: no payload, only (possibly empty) children.

Source

pub fn item(&self) -> Option<&I>

The payload carried by this node, if any.

Source

pub fn item_mut(&mut self) -> Option<&mut I>

The payload mutably, if any.

Source

pub fn children(&self) -> &[Transformed<Self, G>]

The placed children.

Source

pub fn children_mut(&mut self) -> &mut [Transformed<Self, G>]

The placed children mutably.

Source

pub fn first_leaf(&self) -> Option<&I>

The first leaf payload in depth-first order, without composing any transforms. This backs the color/stroke-width getters; None means the tree has no payloads at all.

Source

pub fn get(&self, path: &[usize]) -> Option<&Transformed<Self, G>>

Look up a placement by walking child indices: [i] returns child i (including its pose), [i, j] returns child j of child i’s frame, and so on. Paths must be non-empty — the receiver is the frame itself, not a placement — and None is returned when an index is out of bounds.

Source

pub fn get_mut(&mut self, path: &[usize]) -> Option<&mut Transformed<Self, G>>

Mutable variant of Node::get.

Source

pub fn by_id(&self, id: &str) -> Option<&Transformed<Self, G>>

The first placement (depth-first preorder) whose id equals id.

Ids are external labels (SVG ids, glTF node names) and are not guaranteed unique, so duplicates resolve to the preorder-first match; see Node::by_ids for every match and Node::by_id_path for a reusable address. Placements are searched, not the receiver — the receiver is the frame they live in. None when no placement carries the id.

Source

pub fn by_id_mut(&mut self, id: &str) -> Option<&mut Transformed<Self, G>>

Mutable variant of Node::by_id.

Source

pub fn by_ids(&self, id: &str) -> Vec<&Transformed<Self, G>>

Every placement whose id equals id, in depth-first order.

Source

fn collect_by_id<'a>( &'a self, id: &str, matches: &mut Vec<&'a Transformed<Self, G>>, )

Source

pub fn by_id_path(&self, id: &str) -> Option<Vec<usize>>

The index path (see Node::get) of the first placement in depth-first order whose id equals id. Useful to reuse an address across frames without re-searching.

Source

pub fn first_leaf_mut(&mut self) -> Option<&mut I>

The first leaf payload in depth-first order, mutably.

Source

pub fn leaves(&self) -> Leaves<'_, I, G> ⓘ
where G: Clone + Into<DAffine3>,

Iterate over flattened leaf payloads with their accumulated world affine, yielding (world_affine, &item) pairs in depth-first order — i.e. painter’s-algorithm draw order.

The world affine composes top-down through every placement’s transform, starting from the identity at the receiver: the receiver is an unplaced frame, so wrapping the tree in Transformed places it (see PlacedLeaves). The same placement Extract composes into core items. Implemented with an explicit stack, so deep trees cannot overflow the call stack.

Source

pub fn leaves_mut(&mut self) -> LeavesMut<'_, I, G> ⓘ

Iterate over mutable references to all leaf payloads in depth-first order. Unlike Node::leaves, no transforms are composed: callers mutate canonical local data only.

Source

pub fn map_inner<U>(self, f: impl FnMut(I) -> U) -> Node<U, G>

Map every leaf payload to a new type, keeping ids, poses, and the tree shape unchanged. This is the recursive analog of Transformed::map_inner.

Source

pub fn map_transform<H>(self, f: impl FnMut(G) -> H) -> Node<I, H>

Map the transform storage of every placement to a new type while keeping everything else unchanged. This mirrors Transformed::map_transform and is the general form of converting between transform groups — including widening, which intentionally has no blanket From impl on Node.

Source§

impl<I, G: TransformGroup> Node<I, G>

Source

pub fn leaf(item: I) -> Self

Create a bare leaf — a payload with no children — without an id.

Source

pub fn group( children: impl IntoIterator<Item = impl Into<Transformed<Self, G>>>, ) -> Self

Create a pure frame — no payload — holding the placed children. Plain nodes passed in the iterator place with the identity pose.

Source

pub fn branch( item: I, children: impl IntoIterator<Item = impl Into<Transformed<Self, G>>>, ) -> Self

Create a branch — a payload and placed children — without an id. The payload paints before the children. Plain nodes passed in the iterator place with the identity pose.

Source

pub fn frame() -> Self

Create an empty pure anchor frame: no payload, no children.

Trait Implementations§

Source§

impl<I, G> Aabb for Node<I, G>
where I: Aabb, G: Clone + Into<DAffine3>,

Source§

fn aabb(&self) -> [DVec3; 2]

Union of the payload’s and the placed children’s AABBs — each placement’s wrapper already applies its own pose, so the result is in the receiver’s local frame. A node with no payload and no children warns and reports a degenerate box, mirroring the slice impl in ranim-core.

Source§

fn aabb_size(&self) -> DVec3

Get the size of the Aabb.
Source§

fn aabb_center(&self) -> DVec3

Get the center of the Aabb.
Source§

impl<I, G> Alignable for Node<I, G>
where I: Alignable + Opacity, G: Clone,

Source§

fn is_aligned(&self, other: &Self) -> bool

Whether both sides are already structurally compatible for direct interpolation: payload presence must match positionally, sibling counts must be equal, and every payload and child pair must satisfy Alignable::is_aligned. This mirrors the Vec<T> blanket’s pre-alignment contract; Alignable::align_with establishes this state from mismatched trees.

Source§

fn align_with(&mut self, other: &mut Self)

Align two trees for interpolation under one uniform rule: absence is filled with a transparent clone of the present side.

  1. Payload presence: when only one side carries an item, the other side receives a transparent (set_opacity(0.0)) clone of it, so lerping fades the payload in or out smoothly instead of jumping.
  2. Payload pairs: when both sides carry items, they align with each other (vertex-level padding for point data).
  3. Children: unequal child counts are padded on both sides. A non-empty list grows by repeating its own entries (resize_preserving_order_with_repeated_indices, matching the Vec<T>: Alignable blanket); an empty list has nothing of its own to repeat, so it grows with transparent clones of the other side’s children — the same absence rule as payloads. Pairs recurse.
Source§

impl<I: Clone, G: Clone> Clone for Node<I, G>

Source§

fn clone(&self) -> Self

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<I: Debug, G: Debug> Debug for Node<I, G>

Source§

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

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

impl<I, G> Empty for Node<I, G>
where I: Empty,

Source§

fn empty() -> Self

Getting an empty item
Source§

impl<I: Eq, G: Eq> Eq for Node<I, G>

Source§

impl<I, G> Extract for Node<I, G>
where I: Extract<Target = CoreItem>, G: Clone + Into<DAffine3>,

Source§

type Target = CoreItem

Extraction target.
Source§

fn extract_into(&self, buf: &mut Vec<Self::Target>)

Append extracted values to buf.
Source§

fn extract(&self) -> Vec<Self::Target>

Extract into a newly allocated vector.
Source§

impl<I, G> FillColor for Node<I, G>
where I: FillColor,

Source§

fn fill_color(&self) -> AlphaColor<Srgb>

The fill color of the first leaf in DFS order; an empty tree warns and reports white.

Source§

fn set_fill_color(&mut self, color: AlphaColor<Srgb>) -> &mut Self

Setting fill color(rgba) of an item
Source§

fn set_fill_opacity(&mut self, opacity: f32) -> &mut Self

Setting fill opacity of an item
Source§

impl<I, G: TransformGroup> From<Node<I, G>> for Transformed<Node<I, G>, G>

A bare Node places with the identity pose, so plain and wrapped nodes mix freely in the same vec![...] of children.

Source§

fn from(inner: Node<I, G>) -> Self

Converts to this type from the input type.
Source§

impl<I, G> Interpolatable for Node<I, G>

Source§

fn lerp(&self, target: &Self, t: f64) -> Self

Structural lerp: nodes interpolate positionally, payloads and node poses interpolate independently, and ids switch at the mid-point like other front-loaded fields in ranim. Callers must have aligned structures first (see Alignable): payload-presence mismatches panic, and unequal sibling counts follow Vec’s truncating-zip precedent.

Source§

impl<I, G> Locate<Node<I, G>> for Centroid
where Centroid: Locate<I>, G: Clone + Into<DAffine3>,

The centroid of a tree weights every flattened leaf equally: sum each leaf’s centroid mapped through its accumulated world affine and divide by the leaf count — NOT per-child weighting. An empty tree warns and returns zero instead of producing NaNs.

Source§

fn locate(&self, target: &Node<I, G>) -> DVec3

Locate self on the target
Source§

impl<I, G> Opacity for Node<I, G>
where I: Opacity,

Source§

fn set_opacity(&mut self, opacity: f32) -> &mut Self

Setting opacity of an item
Source§

impl<I, G> Partial for Node<I, G>
where I: Partial, G: Clone,

Source§

fn get_partial(&self, range: Range<f64>) -> Self

Getting a partial item
Source§

fn get_partial_closed(&self, range: Range<f64>) -> Self

Getting a partial item closed
Source§

impl<I: PartialEq, G: PartialEq> PartialEq for Node<I, G>

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl<I, G> StrokeColor for Node<I, G>
where I: StrokeColor,

Source§

fn stroke_color(&self) -> AlphaColor<Srgb>

The stroke color of the first leaf in DFS order; an empty tree warns and reports white.

Source§

fn set_stroke_color(&mut self, color: AlphaColor<Srgb>) -> &mut Self

Setting stroke color(rgba) of an item
Source§

fn set_stroke_opacity(&mut self, opacity: f32) -> &mut Self

Setting stroke opacity of an item
Source§

impl<I, G> StrokeWidth for Node<I, G>
where I: StrokeWidth,

Source§

fn stroke_width(&self) -> f32

The stroke width of the first leaf in DFS order; an empty tree warns and reports 0.0.

Source§

fn apply_stroke_func( &mut self, f: impl for<'a> Fn(&'a mut [Width]), ) -> &mut Self

Forward the stroke-width function to every leaf independently.

Source§

fn set_stroke_width(&mut self, width: f32) -> &mut Self

Setting stroke width of an item

Auto Trait Implementations§

§

impl<I, G> Freeze for Node<I, G>
where I: Freeze,

§

impl<I, G> RefUnwindSafe for Node<I, G>

§

impl<I, G> Send for Node<I, G>
where I: Send, G: Send,

§

impl<I, G> Sync for Node<I, G>
where I: Sync, G: Sync,

§

impl<I, G> Unpin for Node<I, G>
where I: Unpin, G: Unpin,

§

impl<I, G> UnsafeUnpin for Node<I, G>
where I: UnsafeUnpin,

§

impl<I, G> UnwindSafe for Node<I, G>
where I: UnwindSafe, G: UnwindSafe,

Blanket Implementations§

Source§

impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S
where T: Real + Zero + Arithmetics + Clone, Swp: WhitePoint<T>, Dwp: WhitePoint<T>, D: AdaptFrom<S, Swp, Dwp, T>,

Source§

fn adapt_into_using<M>(self, method: M) -> D
where M: TransformMatrix<T>,

Convert the source color to the destination color using the specified method.
Source§

fn adapt_into(self) -> D

Convert the source color to the destination color using the bradford method by default.
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> AnyExtractCoreItem for T
where T: Extract<Target = CoreItem> + Any + DynClone,

Source§

impl<T, C> ArraysFrom<C> for T
where C: IntoArrays<T>,

Source§

fn arrays_from(colors: C) -> T

Cast a collection of colors into a collection of arrays.
Source§

impl<T, C> ArraysInto<C> for T
where C: FromArrays<T>,

Source§

fn arrays_into(self) -> C

Cast this collection of arrays into a collection of colors.
Source§

impl<T> Az for T

Source§

fn az<Dst>(self) -> Dst
where T: Cast<Dst>,

Casts the value.
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<WpParam, T, U> Cam16IntoUnclamped<WpParam, T> for U
where T: FromCam16Unclamped<WpParam, U>,

Source§

type Scalar = <T as FromCam16Unclamped<WpParam, U>>::Scalar

The number type that’s used in parameters when converting.
Source§

fn cam16_into_unclamped( self, parameters: BakedParameters<WpParam, <U as Cam16IntoUnclamped<WpParam, T>>::Scalar>, ) -> T

Converts self into C, using the provided parameters.
Source§

impl<Src, Dst> CastFrom<Src> for Dst
where Src: Cast<Dst>,

Source§

fn cast_from(src: Src) -> Dst

Casts the value.
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CheckedAs for T

Source§

fn checked_as<Dst>(self) -> Option<Dst>
where T: CheckedCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> CheckedCastFrom<Src> for Dst
where Src: CheckedCast<Dst>,

Source§

fn checked_cast_from(src: Src) -> Option<Dst>

Casts the value.
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> Color for T
where T: FillColor + StrokeColor + ?Sized,

Source§

fn set_color(&mut self, color: AlphaColor<Srgb>) -> &mut Self

Setting color(rgba) of an item
Source§

impl<T, C> ComponentsFrom<C> for T
where C: IntoComponents<T>,

Source§

fn components_from(colors: C) -> T

Cast a collection of colors into a collection of color components.
§

impl<T> ConditionalSend for T
where T: Send,

Source§

impl<T> Discard for T

Source§

fn discard(&self)

Simply returns ()
Source§

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

§

impl<T> DynEq for T
where T: Any + Eq,

§

fn dyn_eq(&self, other: &(dyn DynEq + 'static)) -> bool

This method tests for self and other values to be equal. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FromAngle<T> for T

Source§

fn from_angle(angle: T) -> T

Performs a conversion from angle.
Source§

impl<T, U> FromStimulus<U> for T
where U: IntoStimulus<T>,

Source§

fn from_stimulus(other: U) -> T

Converts other into Self, while performing the appropriate scaling, rounding and clamping.
§

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, U> IntoAngle<U> for T
where U: FromAngle<T>,

Source§

fn into_angle(self) -> U

Performs a conversion into T.
Source§

impl<WpParam, T, U> IntoCam16Unclamped<WpParam, T> for U
where T: Cam16FromUnclamped<WpParam, U>,

Source§

type Scalar = <T as Cam16FromUnclamped<WpParam, U>>::Scalar

The number type that’s used in parameters when converting.
Source§

fn into_cam16_unclamped( self, parameters: BakedParameters<WpParam, <U as IntoCam16Unclamped<WpParam, T>>::Scalar>, ) -> T

Converts self into C, using the provided parameters.
Source§

impl<T, U> IntoColor<U> for T
where U: FromColor<T>,

Source§

fn into_color(self) -> U

Convert into T with values clamped to the color defined bounds Read more
Source§

impl<T, U> IntoColorUnclamped<U> for T
where U: FromColorUnclamped<T>,

Source§

fn into_color_unclamped(self) -> U

Convert into T. The resulting color might be invalid in its color space Read more
Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

impl<T> IntoResult<T> for T

§

fn into_result(self) -> Result<T, RunSystemError>

Converts this type into the system output type.
§

impl<F, T> IntoSample<T> for F
where T: FromSample<F>,

§

fn into_sample(self) -> T

Source§

impl<T> IntoStimulus<T> for T

Source§

fn into_stimulus(self) -> T

Converts self into T, while performing the appropriate scaling, rounding and clamping.
Source§

impl<T> OverflowingAs for T

Source§

fn overflowing_as<Dst>(self) -> (Dst, bool)
where T: OverflowingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> OverflowingCastFrom<Src> for Dst
where Src: OverflowingCast<Dst>,

Source§

fn overflowing_cast_from(src: Src) -> (Dst, bool)

Casts the value.
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> SaturatingAs for T

Source§

fn saturating_as<Dst>(self) -> Dst
where T: SaturatingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> SaturatingCastFrom<Src> for Dst
where Src: SaturatingCast<Dst>,

Source§

fn saturating_cast_from(src: Src) -> Dst

Casts the value.
§

impl<T, S> SimdFrom<T, S> for T
where S: Simd,

§

fn simd_from(_simd: S, value: T) -> T

§

impl<F, T, S> SimdInto<T, S> for F
where T: SimdFrom<F, S>, S: Simd,

§

fn simd_into(self, simd: S) -> T

Source§

impl<T> StaticAnim for T
where T: StaticAnimRequirement + 'static,

Source§

fn show(&self) -> Paramed<Static<T>>

Show this value.
Source§

fn hide(&self) -> Paramed<Static<T>>

Hide this value.
Source§

impl<T> StaticAnimRequirement for T

Source§

impl<T> StrictAs for T

Source§

fn strict_as<Dst>(self) -> Dst
where T: StrictCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> StrictCastFrom<Src> for Dst
where Src: StrictCast<Dst>,

Source§

fn strict_cast_from(src: Src) -> Dst

Casts the value.
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> TransformedExt for T

Source§

fn transformed<G>(self, transform: G) -> Transformed<Self, G>

Return self wrapped with transform stored exactly as G.
Source§

impl<T, C> TryComponentsInto<C> for T
where C: TryFromComponents<T>,

Source§

type Error = <C as TryFromComponents<T>>::Error

The error for when try_into_colors fails to cast.
Source§

fn try_components_into(self) -> Result<C, <T as TryComponentsInto<C>>::Error>

Try to cast this collection of color components into a collection of colors. 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.
Source§

impl<T, U> TryIntoColor<U> for T
where U: TryFromColor<T>,

Source§

fn try_into_color(self) -> Result<U, OutOfBounds<U>>

Convert into T, returning ok if the color is inside of its defined range, otherwise an OutOfBounds error is returned which contains the unclamped color. Read more
Source§

impl<C, U> UintsFrom<C> for U
where C: IntoUints<U>,

Source§

fn uints_from(colors: C) -> U

Cast a collection of colors into a collection of unsigned integers.
Source§

impl<C, U> UintsInto<C> for U
where C: FromUints<U>,

Source§

fn uints_into(self) -> C

Cast this collection of unsigned integers into a collection of colors.
Source§

impl<T> UnwrappedAs for T

Source§

fn unwrapped_as<Dst>(self) -> Dst
where T: UnwrappedCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> UnwrappedCastFrom<Src> for Dst
where Src: UnwrappedCast<Dst>,

Source§

fn unwrapped_cast_from(src: Src) -> Dst

Casts the value.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

Source§

impl<T> With for T

Source§

fn with(self, f: impl Fn(&mut Self)) -> Self
where Self: Sized,

Mutating a value in place
§

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

impl<T> WrappingAs for T

Source§

fn wrapping_as<Dst>(self) -> Dst
where T: WrappingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> WrappingCastFrom<Src> for Dst
where Src: WrappingCast<Dst>,

Source§

fn wrapping_cast_from(src: Src) -> Dst

Casts the value.