pub struct MainThreadRegistry<GL> {
    discoveries: Vec<Box<dyn DiscoveryAPI<GL>>>,
    sessions: Vec<Box<dyn MainThreadSession>>,
    mocks: Vec<Box<dyn MockDiscoveryAPI<GL>>>,
    sender: Sender<RegistryMsg>,
    receiver: Receiver<RegistryMsg>,
    waker: MainThreadWakerImpl,
    grand_manager: LayerGrandManager<GL>,
    next_session_id: u32,
}

Fields§

§discoveries: Vec<Box<dyn DiscoveryAPI<GL>>>§sessions: Vec<Box<dyn MainThreadSession>>§mocks: Vec<Box<dyn MockDiscoveryAPI<GL>>>§sender: Sender<RegistryMsg>§receiver: Receiver<RegistryMsg>§waker: MainThreadWakerImpl§grand_manager: LayerGrandManager<GL>§next_session_id: u32

Implementations§

source§

impl<GL: 'static + GLTypes> MainThreadRegistry<GL>

source

pub fn new( waker: Box<dyn MainThreadWaker>, grand_manager: LayerGrandManager<GL> ) -> Result<Self, Error>

source

pub fn registry(&self) -> Registry

source

pub fn register<D>(&mut self, discovery: D)
where D: DiscoveryAPI<GL>,

source

pub fn register_mock<D>(&mut self, discovery: D)
where D: MockDiscoveryAPI<GL>,

source

pub fn run_on_main_thread<S>(&mut self, session: S)

source

pub fn run_one_frame(&mut self)

source

pub fn running(&self) -> bool

source

fn handle_msg(&mut self, msg: RegistryMsg)

source

fn supports_session(&mut self, mode: SessionMode) -> Result<(), Error>

source

fn request_session( &mut self, mode: SessionMode, init: SessionInit, raf_sender: Sender<Frame> ) -> Result<Session, Error>

source

fn simulate_device_connection( &mut self, init: MockDeviceInit ) -> Result<Sender<MockDeviceMsg>, Error>

Auto Trait Implementations§

§

impl<GL> !Freeze for MainThreadRegistry<GL>

§

impl<GL> !RefUnwindSafe for MainThreadRegistry<GL>

§

impl<GL> !Send for MainThreadRegistry<GL>

§

impl<GL> !Sync for MainThreadRegistry<GL>

§

impl<GL> Unpin for MainThreadRegistry<GL>

§

impl<GL> !UnwindSafe for MainThreadRegistry<GL>

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> 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, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

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

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

Performs the conversion.
source§

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.
source§

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

Performs the conversion.