pub struct DocumentAccessorSource<'a> { /* private fields */ }Expand description
Accessor source backed by a Document and its resolved resources.
Implementations§
Source§impl<'a> DocumentAccessorSource<'a>
impl<'a> DocumentAccessorSource<'a>
Sourcepub fn new(document: &'a Document, resources: &'a ResourceStore) -> Self
pub fn new(document: &'a Document, resources: &'a ResourceStore) -> Self
Creates an accessor source over a document and resolved buffers.
Sourcepub fn read_buffer_view(&self, index: usize) -> Result<Vec<u8>>
pub fn read_buffer_view(&self, index: usize) -> Result<Vec<u8>>
Copies one complete buffer view from the resolved resource store.
The returned bytes retain the buffer view’s original layout, including
accessor stride or padding. Use Self::read_accessor when a tightly
packed, sparse-materialized accessor payload is needed.
Sourcepub fn read_accessor(&self, index: usize) -> Result<AccessorData>
pub fn read_accessor(&self, index: usize) -> Result<AccessorData>
Reads and materializes one accessor by zero-based index.
Trait Implementations§
Source§impl AccessorSource for DocumentAccessorSource<'_>
impl AccessorSource for DocumentAccessorSource<'_>
Source§fn read_attribute(
&self,
index: usize,
expected: &[&str],
allowed: &[u32],
) -> Result<DecodedAccessor, GltfError>
fn read_attribute( &self, index: usize, expected: &[&str], allowed: &[u32], ) -> Result<DecodedAccessor, GltfError>
Reads one attribute accessor, validating its glTF type against
expected_types (e.g. ["VEC3"]) and component type against
allowed_component_types (glTF component-type constants).Auto Trait Implementations§
impl<'a> Freeze for DocumentAccessorSource<'a>
impl<'a> RefUnwindSafe for DocumentAccessorSource<'a>
impl<'a> Send for DocumentAccessorSource<'a>
impl<'a> Sync for DocumentAccessorSource<'a>
impl<'a> Unpin for DocumentAccessorSource<'a>
impl<'a> UnsafeUnpin for DocumentAccessorSource<'a>
impl<'a> UnwindSafe for DocumentAccessorSource<'a>
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