pub enum ConnectionEvent {
Idle,
Authenticating,
Connected,
Endpoint(Box<ServerEndpoint>),
List(Vec<ServerEndpoint>),
Acknowledged,
Error(String),
Closed,
}
Expand description
Представляет различные события, происходящие в течение жизненного цикла соединения.
События генерируются асинхронно при изменении состояния соединения или
в ответ на операции. Используйте Connection::wait_for_event()
для ожидания
конкретных событий.
§Поток событий
Idle
→ Начальное состояние (редко видно пользователям)Authenticating
→ Когда начинается аутентификацияConnected
→ Успешно аутентифицирован и готов к операциямEndpoint
→ Ответ на операции с конечной точкой (register, publish)List
→ Ответ на операции листингаAcknowledged
→ Операция успешно завершенаError
→ Операция завершилась с ошибкойClosed
→ Соединение прервано
Variants§
Idle
Начальное состояние перед установлением соединения. Это состояние обычно не наблюдается пользователями.
Authenticating
Идет аутентификация. Это событие генерируется, когда клиент начинает аутентификацию с сервером.
Connected
Успешно аутентифицирован и подключен к серверу. После этого события соединение готово к операциям.
Endpoint(Box<ServerEndpoint>)
Результат операции конечной точки (register, publish, ping). Содержит детали конечной точки, включая ее GUID и URL.
List(Vec<ServerEndpoint>)
Результат операции листинга. Содержит все зарегистрированные конечные точки с их текущим статусом.
Acknowledged
Операция была подтверждена сервером. Генерируется для операций, таких как stop, unpublish и clean.
Error(String)
Произошла ошибка во время операции. Содержит сообщение об ошибке от сервера.
Closed
Соединение было закрыто. Это может произойти из-за проблем с сетью, отключения сервера или явного разрыва соединения.
Trait Implementations§
Source§impl Clone for ConnectionEvent
impl Clone for ConnectionEvent
Source§fn clone(&self) -> ConnectionEvent
fn clone(&self) -> ConnectionEvent
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for ConnectionEvent
impl Debug for ConnectionEvent
Source§impl PartialEq for ConnectionEvent
impl PartialEq for ConnectionEvent
impl StructuralPartialEq for ConnectionEvent
Auto Trait Implementations§
impl Freeze for ConnectionEvent
impl RefUnwindSafe for ConnectionEvent
impl Send for ConnectionEvent
impl Sync for ConnectionEvent
impl Unpin for ConnectionEvent
impl UnwindSafe for ConnectionEvent
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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>
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>
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