pub enum PGMessage {
Notify(PGNotifyMessage),
Raise(PGRaiseMessage),
Reconnect {
timestamp: Timestamp,
attempts: u32,
max_attempts: u32,
},
Connected {
timestamp: Timestamp,
},
Timeout {
timestamp: Timestamp,
duration: Duration,
},
Cancelled {
timestamp: Timestamp,
success: bool,
},
FailedToReconnect {
timestamp: Timestamp,
attempts: u32,
},
Disconnected {
timestamp: Timestamp,
reason: String,
},
}Expand description
Type used to represent any of the messages that can be received by the client callback.
Variants§
Notify(PGNotifyMessage)
Raise(PGRaiseMessage)
Reconnect
Connected
Timeout
Cancelled
FailedToReconnect
Disconnected
Implementations§
Source§impl PGMessage
impl PGMessage
pub fn reconnect(attempts: u32, max_attempts: u32) -> Self
pub fn connected() -> Self
pub fn timeout(duration: Duration) -> Self
pub fn cancelled(success: bool) -> Self
pub fn failed_to_reconnect(attempts: u32) -> Self
pub fn disconnected(reason: impl Into<String>) -> Self
Trait Implementations§
Source§impl From<Notification> for PGMessage
impl From<Notification> for PGMessage
Source§fn from(note: Notification) -> Self
fn from(note: Notification) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for PGMessage
impl RefUnwindSafe for PGMessage
impl Send for PGMessage
impl Sync for PGMessage
impl Unpin for PGMessage
impl UnwindSafe for PGMessage
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