Skip to main content

RowPatch

Struct RowPatch 

Source
pub struct RowPatch { /* private fields */ }
Expand description

Owned, ergonomic table-generic word patch builder that encodes directly into flat u32 words and implements FlatResource.

Implementations§

Source§

impl RowPatch

Source

pub const fn new() -> Self

Source

pub fn is_empty(&self) -> bool

Source

pub fn table_count(&self) -> usize

Source

pub fn has_table<T: NvTable>(&self) -> bool

Source

pub fn clear(&mut self)

Source

pub fn set<T: NvTable, V: ScalarField>( &mut self, prop: Prop<T, V>, value: V, ) -> &mut Self

Records a typed scalar, narrow-optional, wide-optional, or 64-bit property override for table T, coalescing packed sibling fields cleanly and setting word-0’s explicit bit on #[nv_table(inherited)] tables.

Source

pub fn with<T: NvTable, V: ScalarField>( self, prop: Prop<T, V>, value: V, ) -> Self

Fluent by-value counterpart to Self::set.

Source

pub fn set_res_id<T: NvTable, R: FlatResource>( &mut self, prop: ResProp<T, R>, id: ResourceId, ) -> &mut Self

Records a ResourceId override for a Res<R> field of table T (marking it as a refcounted child resource edge when id != ResourceId::NONE).

Source

pub fn with_res_id<T: NvTable, R: FlatResource>( self, prop: ResProp<T, R>, id: ResourceId, ) -> Self

Fluent by-value counterpart to Self::set_res_id.

Source

pub fn merge(&mut self, other: &Self)

Merges all operations from other on top of self (last-writer-wins cascade).

Source

pub fn merge_view(&mut self, other: RowPatchView<'_>)

Merges all operations from a zero-copy RowPatchView on top of self.

Source

pub fn apply_table<T: NvTable>(&self, out: &mut [Word]) -> bool

Applies every op targeting table T onto out (skipping string words and mismatched resource/scalar flags). Returns true if T was present in this patch.

Source

pub fn apply_table_with_mask<T: NvTable>( &self, out: &mut [Word], written_masks: &mut [u32], ) -> bool

Applies ops targeting table T onto out and ORs each op’s clear_mask into written_masks[w] so backends (e.g. Web CSS) know exactly which packed bits were patched.

Source

pub fn get_prop<T: NvTable, V: ScalarField>( &self, prop: Prop<T, V>, ) -> Option<V>

Reads prop if all bits/words belonging to prop were set in this patch.

Source

pub fn get_res_id<T: NvTable, R: FlatResource>( &self, prop: ResProp<T, R>, ) -> Option<ResourceId>

Reads the patched ResourceId for prop, if set in this patch.

Source

pub fn visit_resources(&self, visit: impl FnMut(ResourceId))

Visits every non-none ResourceId referenced by this owned patch.

Source

pub fn from_view(view: RowPatchView<'_>) -> Self

Decodes a RowPatchView back into an owned RowPatch.

Trait Implementations§

Source§

impl Clone for RowPatch

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for RowPatch

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for RowPatch

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Eq for RowPatch

Source§

impl FlatResource for RowPatch

Source§

const KIND: Key64

Stable kind identity (Key64::of("nv.res.box_shadows")).
Source§

type View<'a> = RowPatchView<'a>

Zero-copy borrowed view directly over the flat u32 slab words.
Source§

fn write_words(&self, out: &mut Vec<u32>) -> bool

Serializes self into flat u32 words in out (returning false if an encode-side limit is exceeded).
Source§

fn validate(words: &[u32]) -> bool

Validates tags, lengths, bounds, UTF-8, and nested payloads of words.
Source§

fn view<'a>(words: ValidatedWords<'a, Self>) -> Self::View<'a>

Constructs a zero-copy typed view over ingress-validated words.
Source§

fn child_resources(words: &[u32], visit: &mut dyn FnMut(ResourceId))

Visits every non-none nested ResourceId embedded in words so ResourceStore can retain/release transitive dependencies and topologically order NV02 DefineResources.
Source§

impl PartialEq for RowPatch

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for RowPatch

Auto Trait Implementations§

§

impl Forget for RowPatch

§

impl Freeze for RowPatch
where *const u8 is !null: Freeze, PhantomData<TablePatch>: Freeze,

§

impl Move for RowPatch

§

impl RefUnwindSafe for RowPatch

§

impl Send for RowPatch
where RawVecInner: Send,

§

impl Sync for RowPatch
where RawVecInner: Sync,

§

impl Unpin for RowPatch
where *const u8 is !null: Unpin,

§

impl UnsafeUnpin for RowPatch
where *const u8 is !null: UnsafeUnpin, PhantomData<TablePatch>: UnsafeUnpin,

§

impl UnwindSafe for RowPatch
where RawVecInner: UnwindSafe,

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.