struct GotifyStream {
ws: WebSocketStream<MaybeTlsStream<TcpStream>>,
}Expand description
An open Gotify receive stream.
Fields§
§ws: WebSocketStream<MaybeTlsStream<TcpStream>>Implementations§
Source§impl GotifyStream
impl GotifyStream
Sourceasync fn connect(cfg: &GotifyConfig) -> Result<Self>
async fn connect(cfg: &GotifyConfig) -> Result<Self>
Open {ws,wss}://<host>/stream?token=<client_token> - wss for
an https url, ws for http.
Sourceasync fn pump(
self,
tx: &Sender<GotifyEvent>,
shutdown: &mut Receiver<()>,
) -> PumpOutcome
async fn pump( self, tx: &Sender<GotifyEvent>, shutdown: &mut Receiver<()>, ) -> PumpOutcome
Forward frames to tx until shutdown, a read error/close, or a dead
path (no frame within IDLE_DEADLINE). Splits the socket so a
keepalive ping and the read run concurrently: any inbound frame counts
as liveness, so a healthy-but-quiet stream stays up while a half-open
one is detected and dropped for the reconnect loop to redial. Text
frames forward as messages; an unparseable one is skipped with a warn.
Auto Trait Implementations§
impl !Freeze for GotifyStream
impl !RefUnwindSafe for GotifyStream
impl !UnwindSafe for GotifyStream
impl Send for GotifyStream
impl Sync for GotifyStream
impl Unpin for GotifyStream
impl UnsafeUnpin for GotifyStream
Blanket Implementations§
§impl<T> AnySync for T
impl<T> AnySync for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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