pub struct RowPatchView<'a>(/* private fields */);Expand description
Zero-copy borrowed view over flat RowPatch u32 words.
Implementations§
Source§impl<'a> RowPatchView<'a>
impl<'a> RowPatchView<'a>
pub const EMPTY: Self
Sourcepub fn from_words(words: &'a [u32]) -> Option<Self>
pub fn from_words(words: &'a [u32]) -> Option<Self>
Validates words via RowPatch::validate and returns a zero-copy view on success.
pub const fn raw_words(self) -> &'a [u32]
pub const fn table_count(self) -> usize
pub const fn is_empty(self) -> bool
pub fn tables(self) -> TableOpsIter<'a> ⓘ
Sourcepub fn table_ops(self, key: TableKey) -> Option<TableOpsView<'a>>
pub fn table_ops(self, key: TableKey) -> Option<TableOpsView<'a>>
Finds the operations for table key, if present.
pub fn has_table<T: NvTable>(self) -> bool
Sourcepub fn apply_table<T: NvTable>(self, out: &mut [Word]) -> bool
pub fn apply_table<T: NvTable>(self, out: &mut [Word]) -> bool
Branchless masked apply onto out for table T. Returns true if T was present.
Sourcepub fn apply_table_with_mask<T: NvTable>(
self,
out: &mut [Word],
written_masks: &mut [u32],
) -> bool
pub fn apply_table_with_mask<T: NvTable>( self, out: &mut [Word], written_masks: &mut [u32], ) -> bool
Masked apply onto out for table T, also recording every written bit in written_masks.
Sourcepub fn get_prop<T: NvTable, V: ScalarField>(self, prop: Prop<T, V>) -> Option<V>
pub fn get_prop<T: NvTable, V: ScalarField>(self, prop: Prop<T, V>) -> Option<V>
Reads prop directly from this flat view if all its words/bits are patched.
Sourcepub fn get_res_id<T: NvTable, R: FlatResource>(
self,
prop: ResProp<T, R>,
) -> Option<ResourceId>
pub fn get_res_id<T: NvTable, R: FlatResource>( self, prop: ResProp<T, R>, ) -> Option<ResourceId>
Reads the patched ResourceId for prop, if set.
Sourcepub fn visit_resources(self, visit: &mut dyn FnMut(ResourceId))
pub fn visit_resources(self, visit: &mut dyn FnMut(ResourceId))
Visits every non-none embedded ResourceId across all tables in this patch.
Trait Implementations§
Source§impl<'a> Clone for RowPatchView<'a>
impl<'a> Clone for RowPatchView<'a>
impl<'a> Copy for RowPatchView<'a>
Source§impl<'a> Debug for RowPatchView<'a>
impl<'a> Debug for RowPatchView<'a>
impl<'a> Eq for RowPatchView<'a>
Source§impl<'a> PartialEq for RowPatchView<'a>
impl<'a> PartialEq for RowPatchView<'a>
impl<'a> StructuralPartialEq for RowPatchView<'a>
Auto Trait Implementations§
impl<'a> Forget for RowPatchView<'a>
impl<'a> Freeze for RowPatchView<'a>
impl<'a> Move for RowPatchView<'a>
impl<'a> RefUnwindSafe for RowPatchView<'a>
impl<'a> Send for RowPatchView<'a>
impl<'a> Sync for RowPatchView<'a>
impl<'a> Unpin for RowPatchView<'a>
impl<'a> UnsafeUnpin for RowPatchView<'a>where
&'a [u32]: UnsafeUnpin,
impl<'a> UnwindSafe for RowPatchView<'a>where
&'a [u32]: UnwindSafe,
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