Skip to main content

MessageKind

Enum MessageKind 

Source
#[repr(u8)]
pub enum MessageKind {
Show 44 variants Query = 1, Result = 2, Error = 3, BulkInsert = 4, BulkOk = 5, BulkInsertBinary = 6, QueryBinary = 7, BulkInsertPrevalidated = 8, BulkStreamStart = 9, BulkStreamRows = 10, BulkStreamCommit = 11, BulkStreamAck = 12, Prepare = 13, PreparedOk = 14, ExecutePrepared = 15, Hello = 16, HelloAck = 17, AuthRequest = 18, AuthResponse = 19, AuthOk = 20, AuthFail = 21, Bye = 22, Ping = 23, Pong = 24, Get = 25, Delete = 26, DeleteOk = 27, Cancel = 32, Compress = 33, SetSession = 34, Notice = 35, RowDescription = 36, StreamEnd = 37, VectorSearch = 38, GraphTraverse = 39, QueryWithParams = 40, OpenStream = 41, OpenAck = 42, StreamChunk = 43, StreamError = 44, StreamCancel = 45, QueueWaitOpen = 46, QueueEventPush = 47, QueueWaitTimeout = 48,
}
Expand description

Single-byte message-kind discriminator. Numeric values are part of the wire spec — never repurpose a value once shipped.

Variants§

§

Query = 1

§

Result = 2

§

Error = 3

§

BulkInsert = 4

§

BulkOk = 5

§

BulkInsertBinary = 6

§

QueryBinary = 7

§

BulkInsertPrevalidated = 8

§

BulkStreamStart = 9

§

BulkStreamRows = 10

§

BulkStreamCommit = 11

§

BulkStreamAck = 12

§

Prepare = 13

§

PreparedOk = 14

§

ExecutePrepared = 15

§

Hello = 16

§

HelloAck = 17

§

AuthRequest = 18

§

AuthResponse = 19

§

AuthOk = 20

§

AuthFail = 21

§

Bye = 22

§

Ping = 23

§

Pong = 24

§

Get = 25

§

Delete = 26

§

DeleteOk = 27

§

Cancel = 32

§

Compress = 33

§

SetSession = 34

§

Notice = 35

§

RowDescription = 36

§

StreamEnd = 37

§

VectorSearch = 38

§

GraphTraverse = 39

§

QueryWithParams = 40

§

OpenStream = 41

§

OpenAck = 42

§

StreamChunk = 43

§

StreamError = 44

§

StreamCancel = 45

§

QueueWaitOpen = 46

§

QueueEventPush = 47

§

QueueWaitTimeout = 48

Implementations§

Source§

impl MessageKind

Source

pub fn class(&self) -> MessageClass

Routing class derived from the comment-grouped wire ranges.

Source

pub fn allowed_flags(&self) -> Flags

Bitset of Flags values this kind may legitimately carry.

Pinned conservatively: MORE_FRAMES is universal (any frame may be split), but COMPRESSED is whitelisted only on kinds whose payloads are big enough to benefit from compression. Handshake/lifecycle payloads (Hello, AuthRequest, Ping, …) are tiny and stay uncompressed today; future contributors who want to flip that decision must update both the matrix and the unit tests that pin it.

Source

pub fn is_handshake(&self) -> bool

true when this kind belongs to the handshake/lifecycle group (Hello, AuthRequest, AuthOk, …, Bye, Ping, Pong). Equivalent to class() == MessageClass::Handshake and exists so dispatch sites can read the predicate without importing MessageClass.

Source

pub fn permits_flags(&self, flags: Flags) -> bool

true when every flag bit in flags is in allowed_flags(). The catalog is the single source of truth for which flag bits a kind may carry; both the codec (decode side) and the builder (encode side) consult this so a misframed frame fails at the boundary rather than reaching the dispatch arms.

Source

pub fn direction(&self) -> MessageDirection

Which peer is allowed to originate this kind.

Source

pub fn from_u8(byte: u8) -> Option<Self>

Trait Implementations§

Source§

impl Clone for MessageKind

Source§

fn clone(&self) -> MessageKind

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for MessageKind

Source§

impl Debug for MessageKind

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Eq for MessageKind

Source§

impl PartialEq for MessageKind

Source§

fn eq(&self, other: &MessageKind) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for MessageKind

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.