pub enum NotCurrentContext {
Egl(NotCurrentContext),
Glx(NotCurrentContext),
}
Expand description
A context that is known to be not current on the current thread.
This type is a safe wrapper around the context to indicate that it could be
Send
to the different thread, since the context must be not current before
doing so.
fn test_send<T: Send>() {}
test_send::<glutin::context::NotCurrentContext>();
However it’s not Sync
.
ⓘ
fn test_sync<T: Sync>() {}
test_sync::<glutin::context::NotCurrentContext>();
Variants§
Trait Implementations§
Source§impl AsRawContext for NotCurrentContext
impl AsRawContext for NotCurrentContext
Source§fn raw_context(&self) -> RawContext
fn raw_context(&self) -> RawContext
Get the raw context handle.
Source§impl Debug for NotCurrentContext
impl Debug for NotCurrentContext
Source§impl GetGlConfig for NotCurrentContext
impl GetGlConfig for NotCurrentContext
Source§impl GetGlDisplay for NotCurrentContext
impl GetGlDisplay for NotCurrentContext
Source§impl GlContext for NotCurrentContext
impl GlContext for NotCurrentContext
Source§fn context_api(&self) -> ContextApi
fn context_api(&self) -> ContextApi
Get the
ContextApi
used by the context. Read moreSource§impl NotCurrentGlContext for NotCurrentContext
impl NotCurrentGlContext for NotCurrentContext
Source§type PossiblyCurrentContext = PossiblyCurrentContext
type PossiblyCurrentContext = PossiblyCurrentContext
The type of possibly current context.
Source§type Surface<T: SurfaceTypeTrait> = Surface<T>
type Surface<T: SurfaceTypeTrait> = Surface<T>
The surface supported by the context.
Source§fn treat_as_possibly_current(self) -> Self::PossiblyCurrentContext
fn treat_as_possibly_current(self) -> Self::PossiblyCurrentContext
Treat the not current context as possibly current. The operation is safe
because the possibly current context is more restricted and not
guaranteed to be current.
Source§fn make_current<T: SurfaceTypeTrait>(
self,
surface: &Self::Surface<T>,
) -> Result<Self::PossiblyCurrentContext>
fn make_current<T: SurfaceTypeTrait>( self, surface: &Self::Surface<T>, ) -> Result<Self::PossiblyCurrentContext>
Make
Self::Surface
on the calling thread producing the
Self::PossiblyCurrentContext
indicating that the context could
be current on the thread. Read moreSource§fn make_current_draw_read<T: SurfaceTypeTrait>(
self,
surface_draw: &Self::Surface<T>,
surface_read: &Self::Surface<T>,
) -> Result<Self::PossiblyCurrentContext>
fn make_current_draw_read<T: SurfaceTypeTrait>( self, surface_draw: &Self::Surface<T>, surface_read: &Self::Surface<T>, ) -> Result<Self::PossiblyCurrentContext>
The same as
Self::make_current
, but provides a way to set read and
draw surfaces. Read moreAuto Trait Implementations§
impl Freeze for NotCurrentContext
impl RefUnwindSafe for NotCurrentContext
impl Send for NotCurrentContext
impl !Sync for NotCurrentContext
impl Unpin for NotCurrentContext
impl UnwindSafe for NotCurrentContext
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more