Struct libqaul::api::Messages[][src]

pub struct Messages<'chain> { /* fields omitted */ }

Interface to access messages from the network

Implementations

impl<'qaul> Messages<'qaul>[src]

pub fn drop(&'qaul self) -> &'qaul Qaul[src]

Drop this scope and return back to global Qaul scope

pub async fn send<S, T>(
    &self,
    user: UserAuth,
    mode: Mode,
    id_type: IdType,
    service: S,
    tags: T,
    payload: Vec<u8>
) -> Result<MsgId> where
    S: Into<String>,
    T: Into<TagSet>, 
[src]

Send a message with arbitrary payload into the network

Because the term Message is overloaded slightly in libqaul, here is a small breakdown of what a message means in this context.

The Service API provides an interface to communicate with other users on a qaul network. These messages are relatively low-level, meaning that their payload (for example) is simply a Vec, and it’s left to a service to do anything meaningful with it.

However when users write text-messages to each other in qaul, these are being sent via the messaging service, which implements it’s own Message, on top of libqaul. In that case a message is plain text and can have binary attachments.

Underlying libqaul, the routing layer (RATMAN) uses the term Message to refer to the same concept as a Service API message, with some more raw data inlined, such as signatures and checksums. Fundamentally they share the same idea of what a payload or recipient is however, and payloads that are unsecured in a Service API message will have been encrypted by the time that RATMAN handles them.

pub async fn subscribe<S, T>(
    &self,
    user: UserAuth,
    service: S,
    tags: T
) -> Result<Subscription<Message>> where
    S: Into<Service>,
    T: Into<TagSet>, 
[src]

Subscribe to a stream of future message updates

pub async fn query(
    &self,
    user: UserAuth,
    service: impl Into<Service>,
    query: MsgQuery
) -> Result<QueryResult<Message>>
[src]

Query for messages in the store, according to some parameters

A query is always user authenticated, and normally associated to a service, but it doesn’t have to be, if god-mode is enabled in the libqaul instance.

The query parameters can be specified via the [Query] builder type which allows for very selective constraints. The return of this function is a Wrapper around a result iterator that can return batches, or skip items dynamically.

Auto Trait Implementations

impl<'chain> !RefUnwindSafe for Messages<'chain>

impl<'chain> Send for Messages<'chain>

impl<'chain> Sync for Messages<'chain>

impl<'chain> Unpin for Messages<'chain>

impl<'chain> !UnwindSafe for Messages<'chain>

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> Instrument for T[src]

impl<T> Instrument for T[src]

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

impl<T> Same<T> for T

type Output = T

Should always be Self

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

impl<T> WithSubscriber for T[src]