[−][src]Struct misskey_websocket::WebSocketClient
Asynchronous WebSocket-based client for Misskey.
WebSocketClient
can be constructed using WebSocketClient::connect
or
WebSocketClientBuilder
.
The latter is more flexible and intuitive.
You do not have to wrap this in Arc
and Mutex
to share it because WebSocketClient
is already Clone
and every methods of WebSocketClient
takes &self
, i.e. they does not require mutability.
Implementations
impl WebSocketClient
[src]
pub async fn connect(url: Url) -> Result<WebSocketClient, Error>
[src]
Connects to Misskey using WebSocket, and returns WebSocketClient
.
pub async fn connect_with_config(
url: Url,
reconnect_config: ReconnectConfig
) -> Result<WebSocketClient, Error>
[src]
url: Url,
reconnect_config: ReconnectConfig
) -> Result<WebSocketClient, Error>
Connects to Misskey using WebSocket with a given reconnect configuration, and returns WebSocketClient
.
pub fn builder<T>(url: T) -> WebSocketClientBuilder where
T: TryInto<Url>,
T::Error: Into<Error>,
[src]
T: TryInto<Url>,
T::Error: Into<Error>,
Creates a new builder instance with url
.
All configurations are set to default.
This function is identical to WebSocketClientBuilder::new
.
pub fn subnote<E, Id>(
&self,
note_id: Id
) -> BoxFuture<'static, Result<SubNote<E>, Error>> where
E: SubNoteEvent,
Id: Into<String>,
[src]
&self,
note_id: Id
) -> BoxFuture<'static, Result<SubNote<E>, Error>> where
E: SubNoteEvent,
Id: Into<String>,
Captures the note specified by id
.
The returned SubNote
implements Stream
so that note events can be retrieved asynchronously via it.
pub fn channel<R>(
&self,
request: R
) -> BoxFuture<'static, Result<Channel<R::Incoming, R::Outgoing>, Error>> where
R: ConnectChannelRequest,
[src]
&self,
request: R
) -> BoxFuture<'static, Result<Channel<R::Incoming, R::Outgoing>, Error>> where
R: ConnectChannelRequest,
Connects to the channel using request
.
The returned Channel
implements Stream
and Sink
so that you can exchange messages with channels on it.
pub fn broadcast<E>(&self) -> BoxFuture<'static, Result<Broadcast<E>, Error>> where
E: BroadcastEvent,
[src]
E: BroadcastEvent,
Trait Implementations
impl Client for WebSocketClient
[src]
type Error = Error
The error type produced by the client when an error occurs.
pub fn request<R: Request>(
&self,
request: R
) -> BoxFuture<'_, Result<ApiResult<R::Response>, Error>>
[src]
&self,
request: R
) -> BoxFuture<'_, Result<ApiResult<R::Response>, Error>>
impl Clone for WebSocketClient
[src]
pub fn clone(&self) -> WebSocketClient
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for WebSocketClient
[src]
impl StreamingClient for WebSocketClient
[src]
type Error = Error
The error type produced by the client when an error occurs.
pub fn subnote<E>(
&self,
note_id: String
) -> BoxFuture<'_, Result<BoxStream<'_, Result<E, Error>>, Error>> where
E: SubNoteEvent,
[src]
&self,
note_id: String
) -> BoxFuture<'_, Result<BoxStream<'_, Result<E, Error>>, Error>> where
E: SubNoteEvent,
pub fn channel<R>(
&self,
request: R
) -> BoxFuture<'_, Result<ChannelStream<'_, R, Error>, Error>> where
R: ConnectChannelRequest,
[src]
&self,
request: R
) -> BoxFuture<'_, Result<ChannelStream<'_, R, Error>, Error>> where
R: ConnectChannelRequest,
pub fn broadcast<E>(
&self
) -> BoxFuture<'_, Result<BoxStream<'_, Result<E, Error>>, Error>> where
E: BroadcastEvent,
[src]
&self
) -> BoxFuture<'_, Result<BoxStream<'_, Result<E, Error>>, Error>> where
E: BroadcastEvent,
Auto Trait Implementations
impl !RefUnwindSafe for WebSocketClient
[src]
impl Send for WebSocketClient
[src]
impl Sync for WebSocketClient
[src]
impl Unpin for WebSocketClient
[src]
impl !UnwindSafe for WebSocketClient
[src]
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, 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> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
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>,