pub struct VShapeStore {
pub shape_count: u8,
pub shapes: [VShapeDef; 8],
}Expand description
A store of DynShape definitions.
Shapes are stored in an array and referenced by index (DynShapeHandle). This allows shapes to reference other shapes (nested structs) without creating recursive type definitions.
Fields§
§shape_count: u8Number of shapes in the store.
shapes: [VShapeDef; 8]Shape definitions (only first shape_count entries are valid).
Implementations§
Source§impl VShapeStore
impl VShapeStore
Sourcepub fn add(&mut self, shape: VShapeDef) -> VShapeHandle
pub fn add(&mut self, shape: VShapeDef) -> VShapeHandle
Add a shape to the store and return its handle.
Sourcepub fn get_def(&self, handle: VShapeHandle) -> &VShapeDef
pub fn get_def(&self, handle: VShapeHandle) -> &VShapeDef
Get a shape definition by handle.
Sourcepub fn view(&self, handle: VShapeHandle) -> VShapeView<'_, Self>
pub fn view(&self, handle: VShapeHandle) -> VShapeView<'_, Self>
Get a view into a shape.
Trait Implementations§
Source§impl Clone for VShapeStore
impl Clone for VShapeStore
Source§fn clone(&self) -> VShapeStore
fn clone(&self) -> VShapeStore
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for VShapeStore
Source§impl Debug for VShapeStore
impl Debug for VShapeStore
Source§impl Default for VShapeStore
impl Default for VShapeStore
impl Eq for VShapeStore
Source§impl IShapeStore for VShapeStore
impl IShapeStore for VShapeStore
Source§type Handle = VShapeHandle
type Handle = VShapeHandle
The handle type used to reference shapes in this store.
Source§type View<'a> = VShapeView<'a, VShapeStore>
where
Self: 'a
type View<'a> = VShapeView<'a, VShapeStore> where Self: 'a
The view type produced by this store.
Source§impl IShapeStore for &'static VShapeStore
impl IShapeStore for &'static VShapeStore
Source§type Handle = VShapeHandle
type Handle = VShapeHandle
The handle type used to reference shapes in this store.
Source§type View<'a> = VShapeView<'a, VShapeStore>
where
Self: 'a
type View<'a> = VShapeView<'a, VShapeStore> where Self: 'a
The view type produced by this store.
Source§impl PartialEq for VShapeStore
impl PartialEq for VShapeStore
Source§fn eq(&self, other: &VShapeStore) -> bool
fn eq(&self, other: &VShapeStore) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for VShapeStore
Auto Trait Implementations§
impl Freeze for VShapeStore
impl RefUnwindSafe for VShapeStore
impl Send for VShapeStore
impl Sync for VShapeStore
impl Unpin for VShapeStore
impl UnsafeUnpin for VShapeStore
impl UnwindSafe for VShapeStore
Blanket Implementations§
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