pub struct BindingPlan {
pub bindings: Vec<Binding>,
pub input_indices: Vec<usize>,
pub output_indices: Vec<usize>,
pub shared_indices: Vec<usize>,
}Expand description
Deterministic ABI plan for a VYRE program.
Fields§
§bindings: Vec<Binding>Ordered binding descriptors, sorted by VYRE binding number.
input_indices: Vec<usize>Original program buffer indices that consume host inputs.
output_indices: Vec<usize>Original program buffer indices that produce host outputs.
Original program buffer indices that are workgroup-local.
Implementations§
Source§impl BindingPlan
impl BindingPlan
Sourcepub fn build(program: &Program) -> Result<Self, BackendError>
pub fn build(program: &Program) -> Result<Self, BackendError>
Build a binding plan from a VYRE program without host input checks.
§Errors
Returns when memory/access combinations or static byte sizing cannot be represented by a concrete backend ABI.
Sourcepub fn from_program(
program: &Program,
inputs: &[Vec<u8>],
) -> Result<Self, BackendError>
pub fn from_program( program: &Program, inputs: &[Vec<u8>], ) -> Result<Self, BackendError>
Build and validate a binding plan from a VYRE program.
§Errors
Returns when input count, input byte lengths, buffer alignment, or memory/access combinations do not match the backend ABI contract.
Sourcepub fn from_borrowed_inputs(
program: &Program,
inputs: &[&[u8]],
) -> Result<Self, BackendError>
pub fn from_borrowed_inputs( program: &Program, inputs: &[&[u8]], ) -> Result<Self, BackendError>
Build and validate a binding plan from borrowed input buffers.
§Errors
Returns when input count, input byte lengths, buffer alignment, or memory/access combinations do not match the backend ABI contract.
Sourcepub fn from_input_lengths(
program: &Program,
input_lengths: &[usize],
) -> Result<Self, BackendError>
pub fn from_input_lengths( program: &Program, input_lengths: &[usize], ) -> Result<Self, BackendError>
Build and validate a binding plan from backend-resident input byte lengths.
§Errors
Returns when resident input counts are wrong or byte lengths are smaller than the program ABI requires.
Sourcepub fn validate_input_byte_lengths(
&self,
input_lengths: &[usize],
) -> Result<(), BackendError>
pub fn validate_input_byte_lengths( &self, input_lengths: &[usize], ) -> Result<(), BackendError>
Verifies backend-resident input byte lengths satisfy this binding plan.
§Errors
Returns when the caller supplies the wrong number of resident inputs or a resident input is smaller than the buffer declaration captured in this plan.
Sourcepub fn validate_inputs(&self, inputs: &[Vec<u8>]) -> Result<(), BackendError>
pub fn validate_inputs(&self, inputs: &[Vec<u8>]) -> Result<(), BackendError>
Verifies dynamic input slices match the expected plan.
§Errors
Returns when the caller supplies the wrong number of inputs or an input length violates the buffer declaration.
Sourcepub fn validate_borrowed_inputs(
&self,
inputs: &[&[u8]],
) -> Result<(), BackendError>
pub fn validate_borrowed_inputs( &self, inputs: &[&[u8]], ) -> Result<(), BackendError>
Verifies borrowed dynamic input slices match the expected plan.
§Errors
Returns when the caller supplies the wrong number of inputs or an input length violates the buffer declaration.
Trait Implementations§
Source§impl Clone for BindingPlan
impl Clone for BindingPlan
Source§fn clone(&self) -> BindingPlan
fn clone(&self) -> BindingPlan
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for BindingPlan
impl Debug for BindingPlan
impl Eq for BindingPlan
Source§impl PartialEq for BindingPlan
impl PartialEq for BindingPlan
Source§fn eq(&self, other: &BindingPlan) -> bool
fn eq(&self, other: &BindingPlan) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for BindingPlan
Auto Trait Implementations§
impl Freeze for BindingPlan
impl RefUnwindSafe for BindingPlan
impl Send for BindingPlan
impl Sync for BindingPlan
impl Unpin for BindingPlan
impl UnsafeUnpin for BindingPlan
impl UnwindSafe for BindingPlan
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.