[][src]Struct subscript::program_sys::shell::Shell

pub struct Shell<S: Spec> { /* fields omitted */ }

It’s a reincarnated-bourne-again shell for your everyday web-app needs. :)

User-level commands are exposed or rather implemented as methods on the Shell type (so from your docs navigate to “methods” section).

Methods

impl<S: Spec + 'static> Shell<S>[src]

pub fn broadcast(&mut self, msg: impl Any)[src]

Heterogeneous value broadcasting system.

// lets broadcast some random messages (values) of different types
sh.broadcast(SomeType(...));
sh.broadcast(SomeOtherType(...));
sh.broadcast(UrlRequest(Page::Something));

pub fn message<T: Spec + 'static, V: Any>(&mut self, msg: V)[src]

Heterogeneous "component-to-component" value messaging system.

// This is perhaps impossible without types hehe
sh.message::<SomeComponentType>(message_value);
///         ^^^^^^^^^^^^^^^^^^^ sent a message to any component of the given type.

pub fn navigate(&mut self, path: impl UrlString)[src]

Update the browser’s URL (i.e. for SPAs).

sh.navigate("/account");

pub fn current_url(&self) -> Url[src]

Returns the current URL.

pub fn cache(&self) -> Cache[src]

Caching support.

pub fn http_client(&self) -> &HttpClient<S>[src]

Make http requests (e.g. for interacting with backend API services).

Auto Trait Implementations

impl<S> !Sync for Shell<S>

impl<S> !Send for Shell<S>

impl<S> Unpin for Shell<S> where
    S: Unpin

impl<S> !RefUnwindSafe for Shell<S>

impl<S> !UnwindSafe for Shell<S>

Blanket Implementations

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

impl<T> From<T> for 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.

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

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

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