Skip to main content

ScratchBuf

Enum ScratchBuf 

Source
pub enum ScratchBuf {
Show 13 variants F32(Vec<f32>), F64(Vec<f64>), F16(Vec<f16>), I8(Vec<i8>), I16(Vec<i16>), I32(Vec<i32>), I64(Vec<i64>), Str(Vec<u8>), Bytes(Vec<u8>), Value(Vec<Value>), Slots(Vec<u64>), Kernels(BodyKernels), State(NodeState),
}
Expand description

One kernel-owned scratch buffer. A Ref2 output port’s (ptr, len) buffer slots view its scratch — the kernel owns the allocation, so the pointer is valid exactly as long as the producing step doesn’t rerun (and a rerun rewrites the slots before any consumer reads them). No Arc traffic, no allocation after warmup: a string or byte string is rewritten in place, a value is replaced.

Variants§

§

F32(Vec<f32>)

An f32 buffer.

§

F64(Vec<f64>)

An f64 buffer.

§

F16(Vec<f16>)

An f16 buffer.

§

I8(Vec<i8>)

An i8 buffer.

§

I16(Vec<i16>)

An i16 buffer.

§

I32(Vec<i32>)

An i32 buffer.

§

I64(Vec<i64>)

An i64 buffer.

§

Str(Vec<u8>)

The UTF-8 bytes of a string.

§

Bytes(Vec<u8>)

The bytes of a byte string.

§

Value(Vec<Value>)

One value held by reference; empty until the step first runs.

§

Slots(Vec<u64>)

A buffer of 64-bit slots (a native cone’s own).

§

Kernels(BodyKernels)

The kernels a tile render keeps over its projection bodies. A clone is empty: a new state builds its own.

§

State(NodeState)

State a node defines for itself, per kernel state. A clone is empty: a new state derives its own.

Implementations§

Source§

impl ScratchBuf

Source

pub fn ptr_len(&self) -> (u64, u64)

The (ptr, len) pair this entry currently publishes — the ground truth axiom S9(a)’s validator compares buffer slots against.

Source

pub fn to_value(&self) -> Value

What this entry holds as an owned Value, copied out: the typed read of a Ref2 output on a compiled kernel, which is what the interpreter’s pull returns for the same port. A value entry that has not been written reads as None.

Source

pub fn node_state(&mut self) -> &mut NodeState

The node-defined state this entry holds. The entry must be a State entry.

Source

pub fn set_str(&mut self, s: &str)

Replace the string this entry holds, reusing its allocation. The entry must be a Str entry.

Source

pub fn set_bytes(&mut self, b: &[u8])

Replace the byte string this entry holds, reusing its allocation. The entry must be a Bytes entry.

Source

pub fn set_value(&mut self, value: Value)

Replace the value this entry holds. The entry must be a Value entry.

Source

pub fn new(elem: ScratchElem) -> Self

An empty buffer of the element type.

Trait Implementations§

Source§

impl Clone for ScratchBuf

Source§

fn clone(&self) -> ScratchBuf

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 ScratchBuf

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

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

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more