[][src]Struct sp_yew::hub::Hub

pub struct Hub {
    pub spec: CmpSpec,
    pub cfg: HubCfg,
    // some fields omitted
}

This struct is attached to components and used for communication between components and also a sever.

Fields

spec: CmpSpeccfg: HubCfg

Implementations

impl Hub[src]

pub fn new(spec: CmpSpec, cfg: HubCfg, callback: Callback<Response>) -> Hub[src]

pub fn new_no_auth(
    spec: CmpSpec,
    cfg: HubCfg,
    callback: Callback<Response>
) -> Hub
[src]

pub fn auth(&mut self, spec: CmpSpec, cfg: HubCfg)[src]

pub fn rpc(&mut self, addr: &str, key: &str, payload: Value)[src]

Sends rpc request to the server

pub fn rpc_with_client(
    &mut self,
    addr: &str,
    key: &str,
    payload: Value,
    client_addr: String
)
[src]

Sends rpc request to the server, but result will forwarded to component with client_addr

pub fn rpc_with_domain(&mut self, addr: &str, key: &str, payload: Value)[src]

Sends rpc request to the server, iserting domain value form config in to target addr.

pub fn rpc_with_segment(
    &mut self,
    segment: &str,
    addr: &str,
    key: &str,
    payload: Value
)
[src]

Sends rpc request to the server, iserting url segment to the resulting url.

pub fn send_event_local(&mut self, addr: &str, key: &str, payload: Value)[src]

Sends message marked as event to other component.

pub fn send_rpc_local(&mut self, rx: &str, key: &str, payload: Value)[src]

Sends message marked as rpc request to other component.

pub fn proxy_msg_local(&mut self, rx: &str, msg_meta: MsgMeta, payload: Value)[src]

Forwards current message to other component.

pub fn send_event_tx(&mut self, key: &str, payload: Value)[src]

Sends message marked as event to component with addr held inside tx variable of component spec (which is stored in a hub struct).

pub fn send_rpc_tx(&mut self, key: &str, payload: Value)[src]

Sends message marked as rpc request to component with addr held inside tx variable of component spec (which is stored in a hub struct).

pub fn proxy_msg_tx(&mut self, msg_meta: MsgMeta, payload: Value)[src]

Forwards current message to component with addr held inside tx variable of component spec (which is stored in a hub struct).

pub fn rpc_post_string(&mut self, payload: String)[src]

Function for making request without using protocol described in sp-dto crate. Simple wrapper around fetch API.

pub fn rpc_post_binary(&mut self, payload: Vec<u8>)[src]

Function for making request without using protocol described in sp-dto crate. Simple wrapper around fetch API.

pub fn rpc_post_string_custom_url(&mut self, url: String, payload: String)[src]

Function for making request without using protocol described in sp-dto crate. Simple wrapper around fetch API.

pub fn rpc_post_binary_custom_url(&mut self, url: String, payload: Vec<u8>)[src]

Function for making request without using protocol described in sp-dto crate. Simple wrapper around fetch API.

pub fn rpc_get_string_custom_url(&mut self, url: String)[src]

Function for making request without using protocol described in sp-dto crate. Simple wrapper around fetch API.

pub fn rpc_get_binary_custom_url(&mut self, url: String)[src]

Function for making request without using protocol described in sp-dto crate. Simple wrapper around fetch API.

Auto Trait Implementations

impl !RefUnwindSafe for Hub

impl !Send for Hub

impl !Sync for Hub

impl Unpin for Hub

impl !UnwindSafe for Hub

Blanket Implementations

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

impl<T> Any for T where
    T: Any

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.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,