Struct icu_provider_export::fs_exporter::serializers::postcard::Serializer
pub struct Serializer;
Expand description
A serializer for Postcard.
§Examples
use icu_provider_fs::export::serializers;
use icu_provider_fs::export::FilesystemExporter;
let serializer = serializers::Postcard::default();
// Then pass it to a FilesystemExporter:
let demo_path = std::env::temp_dir().join("icu4x_postcard_serializer_demo");
FilesystemExporter::try_new(
Box::from(serializer),
demo_path.clone().into(),
)
.unwrap();
Implementations§
§impl Serializer
impl Serializer
pub fn new(_options: Options) -> Serializer
pub fn new(_options: Options) -> Serializer
Creates a new serializer for [postcard
].
Trait Implementations§
§impl AbstractSerializer for Serializer
impl AbstractSerializer for Serializer
§fn serialize(
&self,
obj: &DataPayload<ExportMarker>,
sink: &mut dyn Write,
) -> Result<(), DataError>
fn serialize( &self, obj: &DataPayload<ExportMarker>, sink: &mut dyn Write, ) -> Result<(), DataError>
Serializes an object to a sink.
§fn get_buffer_format(&self) -> BufferFormat
fn get_buffer_format(&self) -> BufferFormat
Gets the buffer format currently being serialized.
§fn is_text_format(&self) -> bool
fn is_text_format(&self) -> bool
This can be set to get correct CRLF on Windows.
§impl Debug for Serializer
impl Debug for Serializer
§impl Default for Serializer
impl Default for Serializer
§fn default() -> Serializer
fn default() -> Serializer
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for Serializer
impl RefUnwindSafe for Serializer
impl Send for Serializer
impl Sync for Serializer
impl Unpin for Serializer
impl UnwindSafe for Serializer
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> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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