Struct libqaul::api::Messages [−][src]
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]
&self,
user: UserAuth,
mode: Mode,
id_type: IdType,
service: S,
tags: T,
payload: Vec<u8>
) -> Result<MsgId> where
S: Into<String>,
T: Into<TagSet>,
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]
&self,
user: UserAuth,
service: S,
tags: T
) -> Result<Subscription<Message>> where
S: Into<Service>,
T: Into<TagSet>,
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]
&self,
user: UserAuth,
service: impl Into<Service>,
query: MsgQuery
) -> Result<QueryResult<Message>>
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,
pub fn vzip(self) -> V
impl<T> WithSubscriber for T
[src]
pub fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
[src]
S: Into<Dispatch>,