pub struct SimpleStringTvf { /* private fields */ }
Expand description
Struct that define a simple string TVF
Implementations§
Source§impl SimpleStringTvf
impl SimpleStringTvf
Sourcepub fn deserialize(serial: &str) -> Result<SimpleStringTvf, TvfError>
pub fn deserialize(serial: &str) -> Result<SimpleStringTvf, TvfError>
Load a TVF from String
Trait Implementations§
Source§impl Clone for SimpleStringTvf
impl Clone for SimpleStringTvf
Source§fn clone(&self) -> SimpleStringTvf
fn clone(&self) -> SimpleStringTvf
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for SimpleStringTvf
impl Debug for SimpleStringTvf
Source§impl Default for SimpleStringTvf
impl Default for SimpleStringTvf
Source§fn default() -> SimpleStringTvf
fn default() -> SimpleStringTvf
Returns the “default value” for a type. Read more
Source§impl PartialEq for SimpleStringTvf
impl PartialEq for SimpleStringTvf
Source§impl Tvf for SimpleStringTvf
TVF implementation of simple string TVF
impl Tvf for SimpleStringTvf
TVF implementation of simple string TVF
Source§fn is_empty(&self) -> bool
fn is_empty(&self) -> bool
Test if the TVF is empty (no value in it)
§Examples
use prosa_utils::msg::tvf::Tvf;
use prosa_utils::msg::simple_string_tvf::SimpleStringTvf;
let tvf: SimpleStringTvf = Default::default();
assert_eq!(true, tvf.is_empty());
Source§fn len(&self) -> usize
fn len(&self) -> usize
Get the length of the TVF (number of value in it)
§Examples
use prosa_utils::msg::tvf::Tvf;
use prosa_utils::msg::simple_string_tvf::SimpleStringTvf;
let mut tvf: SimpleStringTvf = Default::default();
tvf.put_string(1, String::from("first_val"));
tvf.put_string(2, String::from("second_val"));
assert_eq!(2, tvf.len());
Source§fn get_buffer(&self, id: usize) -> Result<Cow<'_, SimpleStringTvf>, TvfError>
fn get_buffer(&self, id: usize) -> Result<Cow<'_, SimpleStringTvf>, TvfError>
Get a sub buffer from a TVF
Source§fn get_string(&self, id: usize) -> Result<Cow<'_, String>, TvfError>
fn get_string(&self, id: usize) -> Result<Cow<'_, String>, TvfError>
Get a string value from a TVF
Source§fn get_bytes(&self, id: usize) -> Result<Cow<'_, Bytes>, TvfError>
fn get_bytes(&self, id: usize) -> Result<Cow<'_, Bytes>, TvfError>
Get a buffer of bytes from a TVF
Source§fn get_datetime(&self, id: usize) -> Result<NaiveDateTime, TvfError>
fn get_datetime(&self, id: usize) -> Result<NaiveDateTime, TvfError>
Get a datetime field from a TVF.
The timestamp is considered to be UTC.
The timestamp is considered to be UTC.
Source§fn put_buffer(&mut self, id: usize, buffer: SimpleStringTvf)
fn put_buffer(&mut self, id: usize, buffer: SimpleStringTvf)
Put a buffer as sub field into a TVF
Source§fn put_unsigned(&mut self, id: usize, unsigned: u64)
fn put_unsigned(&mut self, id: usize, unsigned: u64)
Put an unsigned value to a TVF
Source§fn put_signed(&mut self, id: usize, signed: i64)
fn put_signed(&mut self, id: usize, signed: i64)
Put a signed value to a TVF
Source§fn put_datetime(&mut self, id: usize, datetime: NaiveDateTime)
fn put_datetime(&mut self, id: usize, datetime: NaiveDateTime)
Put a datetime into a TVF.
The timestamp is considered to be UTC.
The timestamp is considered to be UTC.
impl Eq for SimpleStringTvf
impl StructuralPartialEq for SimpleStringTvf
Auto Trait Implementations§
impl Freeze for SimpleStringTvf
impl RefUnwindSafe for SimpleStringTvf
impl Send for SimpleStringTvf
impl Sync for SimpleStringTvf
impl Unpin for SimpleStringTvf
impl UnwindSafe for SimpleStringTvf
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request