Skip to main content

BindingRef

Struct BindingRef 

Source
pub struct BindingRef<'a, B> {
    pub slot: u32,
    pub buffer: &'a B,
    pub range: BufferRange,
    pub access: AccessMode,
}
Expand description

One borrowed program binding. The referenced buffer must remain alive until its event is reclaimed.

Program-visible buffers carry BufferProperties::DIRECT_BINDING. A backend must reject an incompatible buffer/program combination instead of copying the range into a hidden bounce allocation. Binding order is not semantic; command engines may present the slice in slot order.

Before Accelerator::submit, hosts must reject an AccessMode incompatible with the buffer’s declared BufferUsage (see Self::validate_for_submit).

Fields§

§slot: u32§buffer: &'a B§range: BufferRange§access: AccessMode

Implementations§

Source§

impl<'a, B> BindingRef<'a, B>

Source

pub fn validate_for_submit( bindings: &[Self], descs: &[BufferDesc], max_bindings: u32, ) -> Result<(), BackendError>

Slot/count checks plus BufferDesc::allows_access for each binding.

Hosts must call this before Accelerator::submit. descs[i] must be the descriptor for the buffer behind bindings[i].buffer (equal length alone is not enough). A usage mismatch returns BackendError::PermissionDenied.

Trait Implementations§

Source§

impl<'a, B: Debug> Debug for BindingRef<'a, B>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a, B> Freeze for BindingRef<'a, B>

§

impl<'a, B> RefUnwindSafe for BindingRef<'a, B>
where B: RefUnwindSafe,

§

impl<'a, B> Send for BindingRef<'a, B>
where B: Sync,

§

impl<'a, B> Sync for BindingRef<'a, B>
where B: Sync,

§

impl<'a, B> Unpin for BindingRef<'a, B>

§

impl<'a, B> UnsafeUnpin for BindingRef<'a, B>

§

impl<'a, B> UnwindSafe for BindingRef<'a, B>
where B: RefUnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.