Skip to main content

VBlank

Struct VBlank 

Source
#[non_exhaustive]
pub struct VBlank { /* private fields */ }
Expand description

A light weight VBlank handle.

Will set up the VBlank interrupt handler such that the VBlank interrupt can be waited for. Has internal logic to make missing the VBlank less of an issue by keeping track of the number of VBlanks that has occurred.

use agb::interrupt::VBlank;

let vblank = VBlank::get();

vblank.wait_for_vblank();

Implementations§

Source§

impl VBlank

Source

pub fn get() -> Self

Handles setting up everything required to be able to use the wait for interrupt syscall.

Source

pub fn wait_for_vblank(&self)

Pauses CPU until vblank interrupt is triggered where code execution is resumed.

Not available in embassy mode - use embassy-agb’s async wait_for_vblank instead.

Auto Trait Implementations§

§

impl !Freeze for VBlank

§

impl !RefUnwindSafe for VBlank

§

impl Send for VBlank

§

impl !Sync for VBlank

§

impl Unpin for VBlank

§

impl UnwindSafe for VBlank

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.

Source§

impl<T, W> HasTypeWitness<W> for T
where W: MakeTypeWitness<Arg = T>, T: ?Sized,

Source§

const WITNESS: W = W::MAKE

A constant of the type witness
Source§

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

Source§

const TYPE_EQ: TypeEq<T, <T as Identity>::Type> = TypeEq::NEW

Proof that Self is the same type as Self::Type, provides methods for casting between Self and Self::Type.
Source§

type Type = T

The same type as Self, used to emulate type equality bounds (T == U) with associated type equality constraints (T: Identity<Type = U>).
§

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.