pub struct Ron {
pub options: Options,
}Available on crate feature
ron-serde only.Expand description
A FileFormat corresponding to the JSON data format.
Implemented using the ron crate, only compatible with serde types.
This will not pretty-print code when serializing.
Fields§
§options: OptionsThe Options to use when serializing or deserializing.
Trait Implementations§
Source§impl<T> FileFormat<T> for Ronwhere
T: Serialize + DeserializeOwned,
impl<T> FileFormat<T> for Ronwhere
T: Serialize + DeserializeOwned,
Source§type FormatError = Error
type FormatError = Error
The type of error to return from
to_writer and from_reader.Source§fn from_reader<R: Read>(&self, reader: R) -> Result<T, Self::FormatError>
fn from_reader<R: Read>(&self, reader: R) -> Result<T, Self::FormatError>
Deserialize a value from a
Read stream. Read moreSource§fn to_writer<W: Write>(
&self,
writer: W,
value: &T,
) -> Result<(), Self::FormatError>
fn to_writer<W: Write>( &self, writer: W, value: &T, ) -> Result<(), Self::FormatError>
Serialize a value into a
Write stream. Read moreSource§fn from_buffer(&self, buf: &[u8]) -> Result<T, Self::FormatError>
fn from_buffer(&self, buf: &[u8]) -> Result<T, Self::FormatError>
Deserialize a value from a byte vec.
Source§fn to_buffer(&self, value: &T) -> Result<Vec<u8>, Self::FormatError>
fn to_buffer(&self, value: &T) -> Result<Vec<u8>, Self::FormatError>
Serialize a value into a byte vec.
Source§fn from_reader_buffered<R>(&self, reader: R) -> Result<T, Self::FormatError>where
R: Read,
fn from_reader_buffered<R>(&self, reader: R) -> Result<T, Self::FormatError>where
R: Read,
Identical to
FileFormat::from_reader, however the provided reader is buffered with BufReader. Read moreSource§fn to_writer_buffered<W>(
&self,
writer: W,
value: &T,
) -> Result<(), Self::FormatError>where
W: Write,
fn to_writer_buffered<W>(
&self,
writer: W,
value: &T,
) -> Result<(), Self::FormatError>where
W: Write,
Identical to
FileFormat::to_writer, however the provided writer is buffered with BufWriter. Read moreSource§impl<T> FileFormatUtf8<T> for Ronwhere
T: Serialize + DeserializeOwned,
impl<T> FileFormatUtf8<T> for Ronwhere
T: Serialize + DeserializeOwned,
Source§fn from_string_buffer(&self, buf: &str) -> Result<T, Self::FormatError>
fn from_string_buffer(&self, buf: &str) -> Result<T, Self::FormatError>
Deserialize a buffer from a string slice.
Source§fn to_string_buffer(&self, value: &T) -> Result<String, Self::FormatError>
fn to_string_buffer(&self, value: &T) -> Result<String, Self::FormatError>
Serialize a value into a string buffer.
Auto Trait Implementations§
impl Freeze for Ron
impl RefUnwindSafe for Ron
impl Send for Ron
impl Sync for Ron
impl Unpin for Ron
impl UnsafeUnpin for Ron
impl UnwindSafe for Ron
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