Struct arcdps_imgui::SuspendedContext
source · 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 = arcdps_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
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