pub struct FunctionCall<'a> { /* private fields */ }Expand description
The FunctionCall struct represents a message to call a function.
Available fields:
-
mtype: Identifies the message as a function call. (value ='F') -
mlen: Length of message contents in bytes, including self. -
function_id: OID of the function to execute. -
format_codes: The parameter format codes. -
args: Array of args and their lengths. -
result_format_code: The format code for the result.
Implementations§
Source§impl<'a> FunctionCall<'a>
impl<'a> FunctionCall<'a>
Sourcepub const fn is_buffer(buf: &'a [u8]) -> bool
pub const fn is_buffer(buf: &'a [u8]) -> bool
Checks the constant values for this struct to determine whether this message matches.
Sourcepub fn new(buf: &'a [u8]) -> Result<Self, ParseError>
pub fn new(buf: &'a [u8]) -> Result<Self, ParseError>
Creates a new instance of this struct from a given buffer.
Sourcepub fn function_id(&self) -> i32
pub fn function_id(&self) -> i32
OID of the function to execute.
Sourcepub fn format_codes(&self) -> Array<'a, i16, FormatCode>
pub fn format_codes(&self) -> Array<'a, i16, FormatCode>
The parameter format codes.
Sourcepub fn result_format_code(&self) -> FormatCode
pub fn result_format_code(&self) -> FormatCode
The format code for the result.
pub fn to_vec(self) -> Vec<u8> ⓘ
Trait Implementations§
Source§impl AsRef<[u8]> for FunctionCall<'_>
impl AsRef<[u8]> for FunctionCall<'_>
Source§impl<'a> Clone for FunctionCall<'a>
impl<'a> Clone for FunctionCall<'a>
Source§fn clone(&self) -> FunctionCall<'a>
fn clone(&self) -> FunctionCall<'a>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<'a> DataType for FunctionCall<'a>
impl<'a> DataType for FunctionCall<'a>
const META: StructFieldMeta
fn encode_usize(buf: &mut BufWriter<'_>, value: usize)
fn decode_usize(buf: &mut &[u8]) -> Result<usize, ParseError>
Source§impl Debug for FunctionCall<'_>
impl Debug for FunctionCall<'_>
Source§impl<'a> DecoderFor<'a, FunctionCall<'a>> for FunctionCall<'a>
impl<'a> DecoderFor<'a, FunctionCall<'a>> for FunctionCall<'a>
fn decode_for(buf: &mut &'a [u8]) -> Result<Self, ParseError>
Source§impl<'a> Default for FunctionCall<'a>
impl<'a> Default for FunctionCall<'a>
Source§fn default() -> FunctionCall<'a>
fn default() -> FunctionCall<'a>
Source§impl<FUNCTION_ID, FORMAT_CODES, ARGS, RESULT_FORMAT_CODE> EncoderFor<FunctionCall<'static>> for &FunctionCallBuilder<FUNCTION_ID, FORMAT_CODES, ARGS, RESULT_FORMAT_CODE>where
FUNCTION_ID: EncoderFor<i32>,
FORMAT_CODES: EncoderFor<Array<'static, i16, FormatCode>>,
ARGS: EncoderFor<Array<'static, i16, Encoded<'static>>>,
RESULT_FORMAT_CODE: EncoderFor<FormatCode>,
impl<FUNCTION_ID, FORMAT_CODES, ARGS, RESULT_FORMAT_CODE> EncoderFor<FunctionCall<'static>> for &FunctionCallBuilder<FUNCTION_ID, FORMAT_CODES, ARGS, RESULT_FORMAT_CODE>where
FUNCTION_ID: EncoderFor<i32>,
FORMAT_CODES: EncoderFor<Array<'static, i16, FormatCode>>,
ARGS: EncoderFor<Array<'static, i16, Encoded<'static>>>,
RESULT_FORMAT_CODE: EncoderFor<FormatCode>,
fn encode_for(&self, buf: &mut BufWriter<'_>)
Source§impl<'a> EncoderFor<FunctionCall<'static>> for FunctionCall<'a>
impl<'a> EncoderFor<FunctionCall<'static>> for FunctionCall<'a>
fn encode_for(&self, buf: &mut BufWriter<'_>)
Source§impl<FUNCTION_ID, FORMAT_CODES, ARGS, RESULT_FORMAT_CODE> EncoderFor<FunctionCall<'static>> for FunctionCallBuilder<FUNCTION_ID, FORMAT_CODES, ARGS, RESULT_FORMAT_CODE>where
FUNCTION_ID: EncoderFor<i32>,
FORMAT_CODES: EncoderFor<Array<'static, i16, FormatCode>>,
ARGS: EncoderFor<Array<'static, i16, Encoded<'static>>>,
RESULT_FORMAT_CODE: EncoderFor<FormatCode>,
impl<FUNCTION_ID, FORMAT_CODES, ARGS, RESULT_FORMAT_CODE> EncoderFor<FunctionCall<'static>> for FunctionCallBuilder<FUNCTION_ID, FORMAT_CODES, ARGS, RESULT_FORMAT_CODE>where
FUNCTION_ID: EncoderFor<i32>,
FORMAT_CODES: EncoderFor<Array<'static, i16, FormatCode>>,
ARGS: EncoderFor<Array<'static, i16, Encoded<'static>>>,
RESULT_FORMAT_CODE: EncoderFor<FormatCode>,
fn encode_for(&self, buf: &mut BufWriter<'_>)
Source§impl PartialEq for FunctionCall<'_>
impl PartialEq for FunctionCall<'_>
Source§impl<'a> StructMeta for FunctionCall<'a>
Implements a trait containing the fields of the struct, allowing
us to compute some useful things.
impl<'a> StructMeta for FunctionCall<'a>
Implements a trait containing the fields of the struct, allowing us to compute some useful things.
const FIELDS: StructFields
type Struct<'__struct> = FunctionCall<'__struct>
fn new<'__next_lifetime>( buf: &'__next_lifetime [u8], ) -> Result<Self::Struct<'__next_lifetime>, ParseError>
fn to_vec(&self) -> Vec<u8> ⓘ
const FIELD_COUNT: usize = _
const IS_FIXED_SIZE: bool = _
const FIXED_SIZE: Option<usize> = _
const LENGTH_FIELD_INDEX: Option<usize> = _
const HAS_LENGTH_FIELD: bool = _
impl<'a> Copy for FunctionCall<'a>
impl Eq for FunctionCall<'_>
impl StructAttributeFieldCount<{<$name<'_> as $crate::prelude::StructMeta>::FIELD_COUNT}> for FunctionCall<'_>
Implements a trait indicating that the struct has a field count.
impl StructAttributeFixedSize<{<$name<'_> as $crate::prelude::StructMeta>::IS_FIXED_SIZE}> for FunctionCall<'_>
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.
impl StructAttributeHasLengthField<{<$name<'_> as $crate::prelude::StructMeta>::HAS_LENGTH_FIELD}> for FunctionCall<'_>
Implements a trait indicating that the struct has a length field.