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

StaticPacket

Struct StaticPacket 

Source
pub struct StaticPacket<const W: usize> { /* private fields */ }
Expand description

One immutable linked-list node: W GP0 words, then the end of the list.

Built in a static, it is a chain that stays valid for the whole run, so crate::Gpu::submit_static can kick it from safe code without waiting.

use psx_gpu::chain::StaticPacket;
// GP0(E1h) draw mode, then GP0(1Fh).
static MODE_THEN_IRQ: StaticPacket<2> = StaticPacket::new([0xE100_0000, 0x1F00_0000]);
assert_eq!(MODE_THEN_IRQ.words(), &[0xE100_0000, 0x1F00_0000]);

Implementations§

Source§

impl<const W: usize> StaticPacket<W>

Source

pub const fn new(words: [u32; W]) -> Self

A node carrying words that ends the list.

Source

pub const fn words(&self) -> &[u32; W]

The payload words.

Source

pub fn as_ptr(&self) -> *const u32

The node’s tag word, the address a chain links to.

Trait Implementations§

Source§

impl<const W: usize> Debug for StaticPacket<W>

Source§

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

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

impl<const W: usize> StaticChain for StaticPacket<W>

Source§

fn head(&self) -> *const u32

Address of the first node’s tag.

Auto Trait Implementations§

§

impl<const W: usize> Freeze for StaticPacket<W>

§

impl<const W: usize> RefUnwindSafe for StaticPacket<W>

§

impl<const W: usize> Send for StaticPacket<W>

§

impl<const W: usize> Sync for StaticPacket<W>

§

impl<const W: usize> Unpin for StaticPacket<W>

§

impl<const W: usize> UnsafeUnpin for StaticPacket<W>

§

impl<const W: usize> UnwindSafe for StaticPacket<W>

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.