Struct kioto::runtime::Runtime [−][src]
A Runtime handles the application event loop and connects to the various device drivers.
Examples
use kioto::runtime; fn main() { let mut runtime = runtime::Runtime::new(); runtime.run_with(|runtime| { runtime.shutdown(); Ok(()) }); }
Implementations
impl Runtime
[src]
pub fn new() -> Self
[src]
Create a new runtime with the default configuration.
Examples
use kioto::runtime; fn main() { let runtime = runtime::Runtime::new(); }
pub fn run_with<F>(&mut self, callback: F) -> Result<(), Error> where
F: Fn(&mut Runtime) -> Result<(), Error>,
[src]
F: Fn(&mut Runtime) -> Result<(), Error>,
Run the runtime loop with the given callback which is called once per tick until shutdown.
Examples
use kioto::runtime; fn main() { let mut runtime = runtime::Runtime::new(); runtime.run_with(|runtime| { runtime.shutdown(); Ok(()) }); }
pub fn shutdown(&mut self)
[src]
Schedules the loop for termination after the next tick completes.
Examples
use kioto::runtime; fn main() { let mut runtime = runtime::Runtime::new(); runtime.run_with(|runtime| { runtime.shutdown(); Ok(()) }); }
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Runtime
[src]
impl Send for Runtime
[src]
impl Sync for Runtime
[src]
impl Unpin for Runtime
[src]
impl UnwindSafe for Runtime
[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>,