Skip to main content
← PSoXide SDK guides and examples · SDK f2fec1c301f1 · All Cargo features enabled; check feature gates before use.

FrameStorage

Struct FrameStorage 

Source
pub struct FrameStorage<const N: usize, S> { /* private fields */ }
Expand description

An ordering table together with the packet storage its frames link.

The unit draw_async and FramePair keep 'static while the GPU walks it. S is whatever holds the packets: an array, or a struct of arrays per packet type.

Implementations§

Source§

impl<const N: usize, S> FrameStorage<N, S>

Source

pub const fn new(packets: S) -> Self

An empty table and packets as the packet storage.

Source

pub fn packets_mut(&mut self) -> &mut S

The packet storage, outside any frame.

Source

pub fn draw_async<R>( &'static mut self, dma: GpuDma, build: impl for<'f> FnOnce(&mut OtFrame<'f, N>, &'f mut S) -> R, ) -> (InFlight<N, S>, R)

Build a frame with build, then kick it and return without waiting.

The storage and the DMA token move into the returned InFlight until InFlight::wait hands them back. build gets the frame and the packet storage for a lifetime it cannot leak.

Trait Implementations§

Source§

impl<const N: usize, S: Debug> Debug for FrameStorage<N, S>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<const N: usize, S> Freeze for FrameStorage<N, S>
where S: Freeze,

§

impl<const N: usize, S> RefUnwindSafe for FrameStorage<N, S>
where S: RefUnwindSafe,

§

impl<const N: usize, S> Send for FrameStorage<N, S>
where S: Send,

§

impl<const N: usize, S> Sync for FrameStorage<N, S>
where S: Sync,

§

impl<const N: usize, S> Unpin for FrameStorage<N, S>
where S: Unpin,

§

impl<const N: usize, S> UnsafeUnpin for FrameStorage<N, S>
where S: UnsafeUnpin,

§

impl<const N: usize, S> UnwindSafe for FrameStorage<N, S>
where S: UnwindSafe,

Blanket Implementations§

§

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

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

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

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

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

§

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

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

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

§

fn into(self) -> U

Calls U::from(self).

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

§

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

§

type Error = Infallible

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

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

Performs the conversion.
§

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

§

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

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

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

Performs the conversion.