pub struct SuspendedContext(/* private fields */);
Expand description
A suspended imgui-rs context.
A suspended context retains its state, but is not usable without activating it first.
§Examples
Suspended contexts are not directly very useful, but you can activate them:
let suspended = imgui::SuspendedContext::create();
match suspended.activate() {
Ok(ctx) => {
// ctx is now the active context
},
Err(suspended) => {
// activation failed, so you get the suspended context back
}
}
Implementations§
Source§impl SuspendedContext
impl SuspendedContext
Sourcepub fn create() -> SuspendedContext
pub fn create() -> SuspendedContext
Creates a new suspended imgui-rs context.
Creates a new suspended imgui-rs context with a shared font atlas.
Sourcepub fn activate(self) -> Result<Context, SuspendedContext>
pub fn activate(self) -> Result<Context, SuspendedContext>
Attempts to activate this suspended context.
If there is no active context, this suspended context is activated and Ok
is returned,
containing the activated context.
If there is already an active context, nothing happens and Err
is returned, containing
the original suspended context.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for SuspendedContext
impl !RefUnwindSafe for SuspendedContext
impl !Send for SuspendedContext
impl !Sync for SuspendedContext
impl Unpin for SuspendedContext
impl !UnwindSafe for SuspendedContext
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more