ProtobufCodecHelper

Struct ProtobufCodecHelper 

Source
pub struct ProtobufCodecHelper {}

Implementations§

Source§

impl ProtobufCodecHelper

Source

pub fn raw_measure<'a, T, P>( value: &'a T, purpose: &Option<RawEncodePurpose>, ) -> BuckyResult<usize>
where P: TryFrom<&'a T> + Message, <P as TryFrom<&'a T>>::Error: Display,

Source

pub fn raw_encode<'a, 'b, T, P>( value: &'b T, buf: &'a mut [u8], purpose: &Option<RawEncodePurpose>, ) -> BuckyResult<&'a mut [u8]>
where P: TryFrom<&'b T> + Message, <P as TryFrom<&'b T>>::Error: Display,

Source

pub fn raw_decode<'de, T, P>(buf: &'de [u8]) -> BuckyResult<(T, &'de [u8])>
where T: TryFrom<P>, P: Message, <T as TryFrom<P>>::Error: Display,

Source

pub fn decode_buf<T>(buf: Vec<u8>) -> BuckyResult<T>
where T: for<'de> RawDecode<'de>,

Source

pub fn decode_string_list<T>(list: Vec<String>) -> BuckyResult<Vec<T>>
where T: FromStr, <T as FromStr>::Err: Display, BuckyError: From<<T as FromStr>::Err>,

Source

pub fn encode_string_list<T>(list: &[T]) -> BuckyResult<RepeatedField<String>>
where T: ToString,

Source

pub fn decode_buf_list<T>(list: impl Into<Vec<Vec<u8>>>) -> BuckyResult<Vec<T>>
where T: for<'de> RawDecode<'de>,

Source

pub fn encode_buf_list<T>(list: &[T]) -> BuckyResult<RepeatedField<Vec<u8>>>
where T: RawEncode,

Source

pub fn decode_nested_item<T, P>(item: P) -> BuckyResult<T>
where T: TryFrom<P>, <T as TryFrom<P>>::Error: Display, BuckyError: From<<T as TryFrom<P>>::Error>,

Source

pub fn encode_nested_item<'a, T, P>(item: &'a T) -> BuckyResult<P>

Source

pub fn decode_nested_list<T, P>(list: impl Into<Vec<P>>) -> BuckyResult<Vec<T>>
where T: TryFrom<P>, <T as TryFrom<P>>::Error: Display, BuckyError: From<<T as TryFrom<P>>::Error>,

Source

pub fn encode_nested_list<'a, T, P>( list: &'a Vec<T>, ) -> BuckyResult<RepeatedField<P>>
where T: 'a, P: TryFrom<&'a T>, <P as TryFrom<&'a T>>::Error: Display, BuckyError: From<<P as TryFrom<&'a T>>::Error>,

Source

pub fn decode_value<T, P>(value: P) -> BuckyResult<T>
where T: TryFrom<P>, <T as TryFrom<P>>::Error: Display,

Source

pub fn decode_value_list<T, P>(list: impl Into<Vec<P>>) -> BuckyResult<Vec<T>>
where T: TryFrom<P>, <T as TryFrom<P>>::Error: Display,

Source

pub fn decode_str_value<T>(value: &str) -> BuckyResult<T>
where T: FromStr, <T as FromStr>::Err: Display,

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

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
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 = 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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> ErasedDestructor for T
where T: 'static,