#[non_exhaustive]pub struct ByteArraySerializer;Expand description
Serializes byte arrays by passing them through unchanged.
The serialized bytes borrow the input (Cow::Borrowed): Java returns the
input byte[] itself, and this neither allocates nor copies.
Implementations§
Trait Implementations§
Source§impl Clone for ByteArraySerializer
impl Clone for ByteArraySerializer
Source§fn clone(&self) -> ByteArraySerializer
fn clone(&self) -> ByteArraySerializer
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 ByteArraySerializer
impl Debug for ByteArraySerializer
Source§impl Default for ByteArraySerializer
impl Default for ByteArraySerializer
Source§fn default() -> ByteArraySerializer
fn default() -> ByteArraySerializer
Returns the “default value” for a type. Read more
Source§impl Serializer<[u8]> for ByteArraySerializer
impl Serializer<[u8]> for ByteArraySerializer
Source§async fn serialize<'a>(
&'a self,
_topic: &'a str,
data: Option<&'a [u8]>,
) -> Result<Option<Cow<'a, [u8]>>, Error>
async fn serialize<'a>( &'a self, _topic: &'a str, data: Option<&'a [u8]>, ) -> Result<Option<Cow<'a, [u8]>>, Error>
Convert
data into a byte array. Read moreSource§fn serialize_with_headers<'a, 'h>(
&'a self,
topic: &'a str,
headers: &'h mut RecordHeaders,
data: Option<&'a T>,
) -> impl Future<Output = Result<Option<Cow<'a, [u8]>>, Error>> + Send + use<'a, 'h, Self, T>where
'a: 'h,
fn serialize_with_headers<'a, 'h>(
&'a self,
topic: &'a str,
headers: &'h mut RecordHeaders,
data: Option<&'a T>,
) -> impl Future<Output = Result<Option<Cow<'a, [u8]>>, Error>> + Send + use<'a, 'h, Self, T>where
'a: 'h,
Convert
data into a byte array, with access to the record headers. Read moreSource§impl Serializer<Vec<u8>> for ByteArraySerializer
impl Serializer<Vec<u8>> for ByteArraySerializer
Source§async fn serialize<'a>(
&'a self,
_topic: &'a str,
data: Option<&'a Vec<u8>>,
) -> Result<Option<Cow<'a, [u8]>>, Error>
async fn serialize<'a>( &'a self, _topic: &'a str, data: Option<&'a Vec<u8>>, ) -> Result<Option<Cow<'a, [u8]>>, Error>
Convert
data into a byte array. Read moreSource§fn serialize_with_headers<'a, 'h>(
&'a self,
topic: &'a str,
headers: &'h mut RecordHeaders,
data: Option<&'a T>,
) -> impl Future<Output = Result<Option<Cow<'a, [u8]>>, Error>> + Send + use<'a, 'h, Self, T>where
'a: 'h,
fn serialize_with_headers<'a, 'h>(
&'a self,
topic: &'a str,
headers: &'h mut RecordHeaders,
data: Option<&'a T>,
) -> impl Future<Output = Result<Option<Cow<'a, [u8]>>, Error>> + Send + use<'a, 'h, Self, T>where
'a: 'h,
Convert
data into a byte array, with access to the record headers. Read moreAuto Trait Implementations§
impl Freeze for ByteArraySerializer
impl RefUnwindSafe for ByteArraySerializer
impl Send for ByteArraySerializer
impl Sync for ByteArraySerializer
impl Unpin for ByteArraySerializer
impl UnsafeUnpin for ByteArraySerializer
impl UnwindSafe for ByteArraySerializer
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