[][src]Struct imgui::SuspendedContext

pub struct SuspendedContext(_);

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

impl SuspendedContext[src]

pub fn create() -> Self[src]

Creates a new suspended imgui-rs context.

pub fn create_with_shared_font_atlas(
    shared_font_atlas: Rc<RefCell<SharedFontAtlas>>
) -> Self
[src]

Creates a new suspended imgui-rs context with a shared font atlas.

pub fn activate(self) -> Result<Context, SuspendedContext>[src]

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

impl Debug for SuspendedContext[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.