#[non_exhaustive]pub struct StringSerializer;Expand description
String encoding defaults to UTF8 and can be customized by setting the property key.serializer.encoding, value.serializer.encoding or serializer.encoding. The first two take precedence over the last.
§Translation notes
WARNING: the encoding is always UTF-8; the properties are ignored.
Implementations§
Trait Implementations§
Source§impl Clone for StringSerializer
impl Clone for StringSerializer
Source§fn clone(&self) -> StringSerializer
fn clone(&self) -> StringSerializer
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 StringSerializer
impl Debug for StringSerializer
Source§impl Default for StringSerializer
impl Default for StringSerializer
Source§fn default() -> StringSerializer
fn default() -> StringSerializer
Returns the “default value” for a type. Read more
Source§impl Serializer<String> for StringSerializer
impl Serializer<String> for StringSerializer
Source§async fn serialize<'a>(
&'a self,
_topic: &'a str,
data: Option<&'a String>,
) -> Result<Option<Cow<'a, [u8]>>, Error>
async fn serialize<'a>( &'a self, _topic: &'a str, data: Option<&'a String>, ) -> 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<str> for StringSerializer
impl Serializer<str> for StringSerializer
Source§async fn serialize<'a>(
&'a self,
_topic: &'a str,
data: Option<&'a str>,
) -> Result<Option<Cow<'a, [u8]>>, Error>
async fn serialize<'a>( &'a self, _topic: &'a str, data: Option<&'a str>, ) -> 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 StringSerializer
impl RefUnwindSafe for StringSerializer
impl Send for StringSerializer
impl Sync for StringSerializer
impl Unpin for StringSerializer
impl UnsafeUnpin for StringSerializer
impl UnwindSafe for StringSerializer
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