pub struct App<H> { /* private fields */ }Expand description
A context-local command application. H is intentionally opaque so native
hosts can use guest functions while the Rust CLI uses Rust handlers against
exactly the same router.
Implementations§
Source§impl<H> App<H>
impl<H> App<H>
pub fn create(config: AppConfig) -> Result<Self, CommandError>
pub fn config(&self) -> AppConfig
pub fn closed(&self) -> bool
pub fn routes(&self) -> Result<Vec<RouteSpec>, CommandError>
pub fn install(&mut self, route: Route<H>) -> Result<RouteHandle, CommandError>
pub fn uninstall(&mut self, handle: RouteHandle) -> Result<bool, CommandError>
pub fn snapshot(&self) -> Result<Snapshot<H>, CommandError>where
H: Clone,
pub fn restore(&mut self, snapshot: Snapshot<H>) -> Result<(), CommandError>
pub fn reset(&mut self) -> Result<(), CommandError>
pub fn close(&mut self)
pub fn parse(&self, argv: Vec<String>) -> Result<Request, CommandError>
pub fn handler(&self, request: &Request) -> Result<&H, CommandError>
pub fn run<F>(&self, argv: Vec<String>, invoke: F) -> Response
Trait Implementations§
Auto Trait Implementations§
impl<H> Freeze for App<H>
impl<H> RefUnwindSafe for App<H>where
Vec<StoredRoute<H>>: RefUnwindSafe,
impl<H> Send for App<H>
impl<H> Sync for App<H>
impl<H> Unpin for App<H>
impl<H> UnsafeUnpin for App<H>where
Vec<StoredRoute<H>>: UnsafeUnpin,
impl<H> UnwindSafe for App<H>where
Vec<StoredRoute<H>>: UnwindSafe,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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