Skip to main content

Event

Enum Event 

Source
pub enum Event<'a> {
Show 16 variants UpgradeTls, ScramNeeded { plus: bool, }, Connected, ParameterStatus { name: &'a str, value: &'a str, }, Fields { token: Token, fields: Fields<'a>, }, Row { token: Token, row: Row<'a>, }, CommandComplete { token: Token, tag: &'a str, row_count: Option<u64>, }, Error { token: Option<Token>, error: ServerError<'a>, }, Notice(ServerError<'a>), Notification { process_id: i32, channel: &'a str, payload: &'a str, }, CopyIn { token: Token, binary: bool, column_formats: &'a [u8], }, CopyOut { token: Token, binary: bool, column_formats: &'a [u8], }, CopyData { token: Token, data: &'a [u8], }, CopyDone { token: Token, }, Completed { token: Token, outcome: Outcome, transaction: TransactionStatus, }, Closed { reason: Error, },
}

Variants§

§

UpgradeTls

§

ScramNeeded

Build upstream ScramSha256 outside the core (its constructor reads entropy) from Connection::config().password, then call start_scram.

Fields

§plus: bool
§

Connected

§

ParameterStatus

Fields

§name: &'a str
§value: &'a str
§

Fields

Fields

§token: Token
§fields: Fields<'a>
§

Row

Fields

§token: Token
§row: Row<'a>
§

CommandComplete

Fields

§token: Token
§tag: &'a str
§row_count: Option<u64>
§

Error

Fields

§token: Option<Token>
§error: ServerError<'a>
§

Notice(ServerError<'a>)

§

Notification

Fields

§process_id: i32
§channel: &'a str
§payload: &'a str
§

CopyIn

Fields

§token: Token
§binary: bool
§column_formats: &'a [u8]
§

CopyOut

Fields

§token: Token
§binary: bool
§column_formats: &'a [u8]
§

CopyData

Fields

§token: Token
§data: &'a [u8]
§

CopyDone

Fields

§token: Token
§

Completed

Fields

§token: Token
§outcome: Outcome
§transaction: TransactionStatus
§

Closed

Fields

§reason: Error

Implementations§

Source§

impl Event<'_>

Source

pub fn into_owned(self) -> OwnedEvent

Copy the event out of the connection’s buffer. Only borrowed payloads allocate: each string, byte slice, row, field list or diagnostic once.

Trait Implementations§

Source§

impl<'a> Debug for Event<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for Event<'a>

§

impl<'a> RefUnwindSafe for Event<'a>

§

impl<'a> Send for Event<'a>

§

impl<'a> Sync for Event<'a>

§

impl<'a> Unpin for Event<'a>

§

impl<'a> UnsafeUnpin for Event<'a>

§

impl<'a> UnwindSafe for Event<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.