Struct glyph_ui::Runtime [−][src]
Runtime for a Glyph User Interface application
Implementations
impl<T, A> Runtime<T, A> where
T: Send + 'static,
A: Gui<Event = T>,
[src]
T: Send + 'static,
A: Gui<Event = T>,
pub fn new<S, H>(app: A, spawn: S) -> Self where
S: FnOnce(Pin<Box<dyn Future<Output = ()> + Send>>) -> H,
[src]
S: FnOnce(Pin<Box<dyn Future<Output = ()> + Send>>) -> H,
Create a new runtime
spawn
must be be able to spawn a future on the async runtime being
used. For example, |task| tokio::spawn(task)
will work.
pub async fn run(self)
[src]
Run the event loop
This will also initialize the terminal for rendering views. In particular, raw mode is enabled then an alternate screen is entered and then cleared. Note however that the location of the cursor is undefined. When the event loop is destroyed, the alternate screen is exited and raw mode is disabled.
Auto Trait Implementations
impl<T, A> !RefUnwindSafe for Runtime<T, A>
[src]
impl<T, A> Send for Runtime<T, A> where
A: Send,
T: Send,
[src]
A: Send,
T: Send,
impl<T, A> Sync for Runtime<T, A> where
A: Sync,
T: Send,
[src]
A: Sync,
T: Send,
impl<T, A> Unpin for Runtime<T, A> where
A: Unpin,
[src]
A: Unpin,
impl<T, A> !UnwindSafe for Runtime<T, A>
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V> ViewExt for V
[src]
impl<'a, T, M, V> ViewExt<'a, T, M> for V
[src]
fn into_element(self) -> View<'a, T, M> where
Self: ViewTrait<T, M> + Sized + 'a,
[src]
Self: ViewTrait<T, M> + Sized + 'a,
impl<'a, T, O, M, F, V> ViewExt<'a, T, O, M, F> for V where
F: Fn(O) -> M + Clone + 'static,
M: 'static,
O: 'static,
[src]
F: Fn(O) -> M + Clone + 'static,
M: 'static,
O: 'static,
impl<V> ViewExt for V
[src]
impl<V> ViewExt for V
[src]
fn on_event<F, A, B, C>(self, f: F) -> View<Self, F> where
Self: Sized,
F: Fn(&Event<A>, B) -> Box<dyn Iterator<Item = C>>,
[src]
Self: Sized,
F: Fn(&Event<A>, B) -> Box<dyn Iterator<Item = C>>,