pub struct Presence {
http: Client,
url: String,
api_key: Sensitive<String>,
}Expand description
HTTP client for querying Centrifugo channel presence.
Fields§
§http: Client§url: String§api_key: Sensitive<String>Implementations§
Source§impl Presence
impl Presence
Sourcepub fn new(url: impl Into<String>, api_key: impl Into<String>) -> Self
pub fn new(url: impl Into<String>, api_key: impl Into<String>) -> Self
Creates a presence client for a Centrifugo HTTP API endpoint.
Sourcepub async fn get_online(
&self,
channel: &str,
) -> Result<FastSet<NodePublicKey>, Error>
pub async fn get_online( &self, channel: &str, ) -> Result<FastSet<NodePublicKey>, Error>
Returns the node keys currently present on channel.
§Errors
Returns an error if the HTTP request, response decoding, or Centrifugo API operation fails.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Presence
impl !RefUnwindSafe for Presence
impl Send for Presence
impl Sync for Presence
impl Unpin for Presence
impl UnsafeUnpin for Presence
impl !UnwindSafe for Presence
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more