pub struct RefInstance {
pub ty: Type,
pub space: AddressSpace,
pub access: AccessMode,
pub view: MemView,
pub ptr: Rc<RefCell<Instance>>,
}Expand description
Instance of a ref<AS,T,AM> type.
Reference: https://www.w3.org/TR/WGSL/#ref-ptr-types
Fields§
§ty: TypeInner type
space: AddressSpace§access: AccessMode§view: MemView§ptr: Rc<RefCell<Instance>>Implementations§
Source§impl RefInstance
impl RefInstance
pub fn new(inst: Instance, space: AddressSpace, access: AccessMode) -> Self
Source§impl RefInstance
impl RefInstance
Sourcepub fn view_member(&self, comp: String) -> Result<Self, Error>
pub fn view_member(&self, comp: String) -> Result<Self, Error>
Get a reference to a struct or vec member.
Sourcepub fn view_index(&self, index: usize) -> Result<Self, Error>
pub fn view_index(&self, index: usize) -> Result<Self, Error>
Get a reference to an array, vec or mat component.
pub fn read<'a>(&'a self) -> Result<Ref<'a, Instance>, Error>
pub fn write(&self, value: Instance) -> Result<(), Error>
pub fn read_write<'a>(&'a self) -> Result<RefMut<'a, Instance>, Error>
Trait Implementations§
Source§impl Clone for RefInstance
impl Clone for RefInstance
Source§fn clone(&self) -> RefInstance
fn clone(&self) -> RefInstance
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RefInstance
impl Debug for RefInstance
Source§impl Display for RefInstance
impl Display for RefInstance
Source§impl From<PtrInstance> for RefInstance
impl From<PtrInstance> for RefInstance
Source§fn from(p: PtrInstance) -> Self
fn from(p: PtrInstance) -> Self
Converts to this type from the input type.
Source§impl From<RefInstance> for Instance
impl From<RefInstance> for Instance
Source§fn from(value: RefInstance) -> Self
fn from(value: RefInstance) -> Self
Converts to this type from the input type.
Source§impl From<RefInstance> for PtrInstance
impl From<RefInstance> for PtrInstance
Source§fn from(r: RefInstance) -> Self
fn from(r: RefInstance) -> Self
Converts to this type from the input type.
Source§impl PartialEq for RefInstance
impl PartialEq for RefInstance
Source§impl Ty for RefInstance
impl Ty for RefInstance
impl StructuralPartialEq for RefInstance
Auto Trait Implementations§
impl Freeze for RefInstance
impl !RefUnwindSafe for RefInstance
impl !Send for RefInstance
impl !Sync for RefInstance
impl Unpin for RefInstance
impl !UnwindSafe for RefInstance
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more