[][src]Struct streaming_platform::MagicBall

pub struct MagicBall {
    pub addr: String,
    pub auth_token: Option<String>,
    pub auth_data: Option<Value>,
    pub write_tx: UnboundedSender<StreamUnit>,
    // some fields omitted
}

Fields

addr: Stringauth_token: Option<String>auth_data: Option<Value>write_tx: UnboundedSender<StreamUnit>

Implementations

impl MagicBall[src]

pub fn new(
    addr: String,
    write_tx: UnboundedSender<StreamUnit>,
    rpc_inbound_tx: UnboundedSender<RpcMsg>
) -> MagicBall
[src]

pub fn get_stream_id(&mut self) -> u64[src]

pub async fn write_vec<'_>(
    &'_ mut self,
    stream_id: u64,
    data: Vec<u8>,
    msg_meta_size: u64,
    payload_size: u64,
    attachments_sizes: Vec<u64>
) -> Result<(), ProcessError>
[src]

This function should be called for single message or parts of it (not for multiple messages inside vec) stream_id value MUST BE ACQUIRED with get_stream_id() function. stream_id generation can be implicit, however this will leads to less flexible API (if for example you need stream payload or attachments data).

pub async fn send_event<T, '_, '_, '_>(
    &'_ mut self,
    addr: &'_ str,
    key: &'_ str,
    payload: T
) -> Result<(), ProcessError> where
    T: Serialize,
    T: Deserialize<'de>,
    T: Debug
[src]

pub async fn send_event_with_route<T, '_, '_, '_>(
    &'_ mut self,
    addr: &'_ str,
    key: &'_ str,
    payload: T,
    __arg4: Route
) -> Result<(), ProcessError> where
    T: Serialize,
    T: Deserialize<'de>,
    T: Debug
[src]

pub async fn rpc<T, R, '_, '_, '_>(
    &'_ mut self,
    addr: &'_ str,
    key: &'_ str,
    payload: T
) -> Result<Message<R>, ProcessError> where
    T: Serialize,
    T: Debug,
    R: Deserialize<'de>,
    R: Debug
[src]

pub async fn rpc_with_route<T, R, '_, '_, '_>(
    &'_ mut self,
    addr: &'_ str,
    key: &'_ str,
    payload: T,
    __arg4: Route
) -> Result<Message<R>, ProcessError> where
    T: Serialize,
    T: Debug,
    R: Deserialize<'de>,
    R: Debug
[src]

pub async fn proxy_event<'_>(
    &'_ mut self,
    tx: String,
    __arg2: Vec<u8>
) -> Result<(), ProcessError>
[src]

pub async fn proxy_rpc<'_>(
    &'_ mut self,
    tx: String,
    __arg2: Vec<u8>
) -> Result<(MsgMeta, Vec<u8>), ProcessError>
[src]

pub async fn proxy_rpc_with_payload<T, '_>(
    &'_ mut self,
    tx: String,
    __arg2: Vec<u8>
) -> Result<(MsgMeta, T, Vec<u8>), ProcessError> where
    T: Deserialize<'de>,
    T: Debug
[src]

Trait Implementations

impl Clone for MagicBall[src]

Auto Trait Implementations

Blanket Implementations

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

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> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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>,