Struct Parse2

Source
pub struct Parse2<'a> { /* private fields */ }
Expand description

The Parse struct represents a parse message from the client.

Available fields:

Implementations§

Source§

impl<'a> Parse2<'a>

Source

pub const fn is_buffer(buf: &'a [u8]) -> bool

Checks the constant values for this struct to determine whether this message matches.

Source

pub fn new(buf: &'a [u8]) -> Result<Self, ParseError>

Creates a new instance of this struct from a given buffer.

Source

pub fn mtype(&self) -> u8

Identifies the message as parse.

Source

pub fn mlen(&self) -> Length

Length of message contents in bytes, including self.

Source

pub fn annotations(&self) -> Array<'a, i16, Annotation<'a>>

Message annotations.

Source

pub fn allowed_capabilities(&self) -> u64

A bit mask of allowed capabilities.

Source

pub fn compilation_flags(&self) -> u64

A bit mask of query options.

Source

pub fn implicit_limit(&self) -> u64

Implicit LIMIT clause on returned sets.

Source

pub fn output_format(&self) -> IoFormat

Data output format.

Source

pub fn expected_cardinality(&self) -> u8

Expected result cardinality.

Source

pub fn command_text(&self) -> LString<'a>

Command text.

Source

pub fn state_typedesc_id(&self) -> Uuid

State data descriptor ID.

Source

pub fn state_data(&self) -> Array<'a, u32, u8>

Encoded state data.

Source

pub fn to_vec(self) -> Vec<u8>

Trait Implementations§

Source§

impl AsRef<[u8]> for Parse2<'_>

Source§

fn as_ref(&self) -> &[u8]

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl<'a> Clone for Parse2<'a>

Source§

fn clone(&self) -> Parse2<'a>

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl<'a> DataType for Parse2<'a>

Source§

impl Debug for Parse2<'_>

Source§

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

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

impl<'a> DecoderFor<'a, Parse2<'a>> for Parse2<'a>

Source§

fn decode_for(buf: &mut &'a [u8]) -> Result<Self, ParseError>

Source§

impl<'a> Default for Parse2<'a>

Source§

fn default() -> Parse2<'a>

Returns the “default value” for a type. Read more
Source§

impl<ANNOTATIONS, ALLOWED_CAPABILITIES, COMPILATION_FLAGS, IMPLICIT_LIMIT, OUTPUT_FORMAT, EXPECTED_CARDINALITY, COMMAND_TEXT, STATE_TYPEDESC_ID, STATE_DATA> EncoderFor<Parse2<'static>> for &Parse2Builder<ANNOTATIONS, ALLOWED_CAPABILITIES, COMPILATION_FLAGS, IMPLICIT_LIMIT, OUTPUT_FORMAT, EXPECTED_CARDINALITY, COMMAND_TEXT, STATE_TYPEDESC_ID, STATE_DATA>
where ANNOTATIONS: EncoderFor<Array<'static, i16, Annotation<'static>>>, ALLOWED_CAPABILITIES: EncoderFor<u64>, COMPILATION_FLAGS: EncoderFor<u64>, IMPLICIT_LIMIT: EncoderFor<u64>, OUTPUT_FORMAT: EncoderFor<IoFormat>, EXPECTED_CARDINALITY: EncoderFor<u8>, COMMAND_TEXT: EncoderFor<LString<'static>>, STATE_TYPEDESC_ID: EncoderFor<Uuid>, STATE_DATA: EncoderFor<Array<'static, u32, u8>>,

Source§

fn encode_for(&self, buf: &mut BufWriter<'_>)

Source§

impl<'a> EncoderFor<Parse2<'static>> for Parse2<'a>

Source§

fn encode_for(&self, buf: &mut BufWriter<'_>)

Source§

impl<ANNOTATIONS, ALLOWED_CAPABILITIES, COMPILATION_FLAGS, IMPLICIT_LIMIT, OUTPUT_FORMAT, EXPECTED_CARDINALITY, COMMAND_TEXT, STATE_TYPEDESC_ID, STATE_DATA> EncoderFor<Parse2<'static>> for Parse2Builder<ANNOTATIONS, ALLOWED_CAPABILITIES, COMPILATION_FLAGS, IMPLICIT_LIMIT, OUTPUT_FORMAT, EXPECTED_CARDINALITY, COMMAND_TEXT, STATE_TYPEDESC_ID, STATE_DATA>
where ANNOTATIONS: EncoderFor<Array<'static, i16, Annotation<'static>>>, ALLOWED_CAPABILITIES: EncoderFor<u64>, COMPILATION_FLAGS: EncoderFor<u64>, IMPLICIT_LIMIT: EncoderFor<u64>, OUTPUT_FORMAT: EncoderFor<IoFormat>, EXPECTED_CARDINALITY: EncoderFor<u8>, COMMAND_TEXT: EncoderFor<LString<'static>>, STATE_TYPEDESC_ID: EncoderFor<Uuid>, STATE_DATA: EncoderFor<Array<'static, u32, u8>>,

Source§

fn encode_for(&self, buf: &mut BufWriter<'_>)

Source§

impl PartialEq for Parse2<'_>

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

const 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<'a> StructMeta for Parse2<'a>

Implements a trait containing the fields of the struct, allowing us to compute some useful things.

Source§

const FIELDS: StructFields

Source§

type Struct<'__struct> = Parse2<'__struct>

Source§

fn new<'__next_lifetime>( buf: &'__next_lifetime [u8], ) -> Result<Self::Struct<'__next_lifetime>, ParseError>

Source§

fn to_vec(&self) -> Vec<u8>

Source§

const FIELD_COUNT: usize = _

Source§

const IS_FIXED_SIZE: bool = _

Source§

const FIXED_SIZE: Option<usize> = _

Source§

const LENGTH_FIELD_INDEX: Option<usize> = _

Source§

const HAS_LENGTH_FIELD: bool = _

Source§

impl<'a> Copy for Parse2<'a>

Source§

impl Eq for Parse2<'_>

Source§

impl StructAttributeFieldCount<{<$name<'_> as $crate::prelude::StructMeta>::FIELD_COUNT}> for Parse2<'_>

Implements a trait indicating that the struct has a field count.

Source§

impl StructAttributeFixedSize<{<$name<'_> as $crate::prelude::StructMeta>::IS_FIXED_SIZE}> for Parse2<'_>

Implements a trait indicating that the struct has a fixed size. This needs to be a trait-generic rather than and associated constant for us to use elsewhere.

Source§

impl StructAttributeHasLengthField<{<$name<'_> as $crate::prelude::StructMeta>::HAS_LENGTH_FIELD}> for Parse2<'_>

Implements a trait indicating that the struct has a length field.

Auto Trait Implementations§

§

impl<'a> Freeze for Parse2<'a>

§

impl<'a> RefUnwindSafe for Parse2<'a>

§

impl<'a> Send for Parse2<'a>

§

impl<'a> Sync for Parse2<'a>

§

impl<'a> Unpin for Parse2<'a>

§

impl<'a> UnwindSafe for Parse2<'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> 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> EncoderFor<Rest<'static>> for T
where T: AsRef<[u8]>,

Source§

fn encode_for(&self, buf: &mut BufWriter<'_>)

Source§

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

Source§

fn to_vec<F>(&self) -> Vec<u8>
where F: 'static, Self: EncoderFor<F>,

Convert this builder into a vector of bytes. This is generally not the most efficient way to perform serialization.
Source§

fn encode_buffer<F>(&self, buf: &mut [u8]) -> Result<usize, usize>
where F: 'static, Self: EncoderFor<F>,

Encode this builder into a given buffer. If the buffer is too small, the function will return the number of bytes required to encode the builder.
Source§

fn encode_buffer_uninit<'a, F>( &self, buf: &'a mut [MaybeUninit<u8>], ) -> Result<&'a mut [u8], usize>
where F: 'static, Self: EncoderFor<F>,

Encode this builder into a given buffer. If the buffer is too small, the function will return the number of bytes required to encode the builder.
Source§

fn measure<F>(&self) -> usize
where F: 'static, Self: EncoderFor<F>,

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> StructLength for T

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.