Skip to main content

FileFormatUtf8

Trait FileFormatUtf8 

Source
pub trait FileFormatUtf8<T>: FileFormat<T> {
    // Required methods
    fn from_string_buffer(&self, buf: &str) -> Result<T, Self::FormatError>;
    fn to_string_buffer(&self, value: &T) -> Result<String, Self::FormatError>;
}
Expand description

A trait that indicates a file’s contents will always be valid UTF-8.

Required Methods§

Source

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>

Serialize a value into a string buffer.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<T, Format: FileFormatUtf8<T>> FileFormatUtf8<T> for &Format

Source§

fn from_string_buffer(&self, buf: &str) -> Result<T, Self::FormatError>

Source§

fn to_string_buffer(&self, value: &T) -> Result<String, Self::FormatError>

Source§

impl<T, Format: FileFormatUtf8<T>> FileFormatUtf8<T> for Arc<Format>

Source§

fn from_string_buffer(&self, buf: &str) -> Result<T, Self::FormatError>

Source§

fn to_string_buffer(&self, value: &T) -> Result<String, Self::FormatError>

Source§

impl<T, Format: FileFormatUtf8<T>> FileFormatUtf8<T> for Box<Format>

Source§

fn from_string_buffer(&self, buf: &str) -> Result<T, Self::FormatError>

Source§

fn to_string_buffer(&self, value: &T) -> Result<String, Self::FormatError>

Source§

impl<T, Format: FileFormatUtf8<T>> FileFormatUtf8<T> for Rc<Format>

Source§

fn from_string_buffer(&self, buf: &str) -> Result<T, Self::FormatError>

Source§

fn to_string_buffer(&self, value: &T) -> Result<String, Self::FormatError>

Implementors§

Source§

impl<T> FileFormatUtf8<T> for PlainUtf8
where T: AsRef<str>, String: Into<T>,