pub struct MetadataBuilder { /* private fields */ }Expand description
Builder for a serialized metadata struct
Inputs/Outputs must be added in the same order they’re defined in the bind group
Implementations§
Source§impl MetadataBuilder
impl MetadataBuilder
pub fn new(address_type: StorageType) -> Self
Sourcepub fn with_array(&mut self, buffer_len: u64, len: u64)
pub fn with_array(&mut self, buffer_len: u64, len: u64)
Add an array to a builder
Sourcepub fn with_tensor(
&mut self,
rank: u64,
buffer_len: u64,
len: u64,
shape: Vec<u64>,
strides: Vec<u64>,
)
pub fn with_tensor( &mut self, rank: u64, buffer_len: u64, len: u64, shape: Vec<u64>, strides: Vec<u64>, )
Add a tensor to a builder
Sourcepub fn finish(self) -> MetadataBinding
pub fn finish(self) -> MetadataBinding
Build the final serialized metadata struct
Auto Trait Implementations§
impl Freeze for MetadataBuilder
impl RefUnwindSafe for MetadataBuilder
impl Send for MetadataBuilder
impl Sync for MetadataBuilder
impl Unpin for MetadataBuilder
impl UnwindSafe for MetadataBuilder
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