pub struct CompositeTransform {
pub dimensionality: usize,
pub description: String,
pub transforms: Vec<TransformDescription>,
}Expand description
Ordered composite transform: applied first-to-last.
point → T[0] → T[1] → … → T[n-1]
§Invariants
dimensionality ∈ {2, 3}(enforced by convention, not by the type system, to allow forward-compatible payloads).- Every element of
transformsmust have parameter lengths consistent withdimensionality.
Fields§
§dimensionality: usizeSpatial dimensionality (2 or 3).
description: StringHuman-readable description (optional metadata).
transforms: Vec<TransformDescription>Ordered list of transforms.
Implementations§
Source§impl CompositeTransform
impl CompositeTransform
Sourcepub fn new(dimensionality: usize) -> Self
pub fn new(dimensionality: usize) -> Self
Create a new empty composite transform for the given dimensionality.
Sourcepub fn push(&mut self, transform: TransformDescription)
pub fn push(&mut self, transform: TransformDescription)
Append a transform description to the chain.
Sourcepub fn save_json<P: AsRef<Path>>(&self, path: P) -> Result<(), Error>
pub fn save_json<P: AsRef<Path>>(&self, path: P) -> Result<(), Error>
Write to a JSON file at path.
Creates or truncates the file. Parent directories must already exist.
Sourcepub fn load_json<P: AsRef<Path>>(path: P) -> Result<Self, Error>
pub fn load_json<P: AsRef<Path>>(path: P) -> Result<Self, Error>
Read from a JSON file at path.
Sourcepub fn validate_dimensionality(&self) -> Vec<usize>
pub fn validate_dimensionality(&self) -> Vec<usize>
Validate that every transform’s implied dimensionality matches
self.dimensionality.
Returns the indices of any mismatched transforms. An empty Vec
indicates a fully consistent composite.
Trait Implementations§
Source§impl Clone for CompositeTransform
impl Clone for CompositeTransform
Source§impl Debug for CompositeTransform
impl Debug for CompositeTransform
Source§impl<'de> Deserialize<'de> for CompositeTransform
impl<'de> Deserialize<'de> for CompositeTransform
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for CompositeTransform
impl PartialEq for CompositeTransform
Source§impl Serialize for CompositeTransform
impl Serialize for CompositeTransform
impl StructuralPartialEq for CompositeTransform
Auto Trait Implementations§
impl Forget for CompositeTransform
impl Freeze for CompositeTransform
impl Move for CompositeTransform
impl RefUnwindSafe for CompositeTransform
impl Send for CompositeTransform
impl Sync for CompositeTransform
impl Unpin for CompositeTransform
impl UnsafeUnpin for CompositeTransform
impl UnwindSafe for CompositeTransform
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Returns the layout of the type.
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Returns whether the given value has been niched. Read more
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
Writes data to
out indicating that a T is niched.