[−][src]Struct savefile::Serializer
Object to which serialized data is to be written.
This is basically just a wrapped std::io::Write
object
and a file protocol version number.
Fields
version: u32
The version of the data structures in memory which are being serialized.
Methods
impl<'a> Serializer<'a>
[src]
pub fn write_bool(&mut self, v: bool) -> Result<(), SavefileError>
[src]
Writes a binary bool to the dyn Write
pub fn write_u8(&mut self, v: u8) -> Result<(), SavefileError>
[src]
Writes a binary u8 to the dyn Write
pub fn write_i8(&mut self, v: i8) -> Result<(), SavefileError>
[src]
Writes a binary i8 to the dyn Write
pub fn write_u16(&mut self, v: u16) -> Result<(), SavefileError>
[src]
Writes a binary little endian u16 to the dyn Write
pub fn write_i16(&mut self, v: i16) -> Result<(), SavefileError>
[src]
Writes a binary little endian i16 to the dyn Write
pub fn write_u32(&mut self, v: u32) -> Result<(), SavefileError>
[src]
Writes a binary little endian u32 to the dyn Write
pub fn write_i32(&mut self, v: i32) -> Result<(), SavefileError>
[src]
Writes a binary little endian i32 to the dyn Write
pub fn write_f32(&mut self, v: f32) -> Result<(), SavefileError>
[src]
Writes a binary little endian f32 to the dyn Write
pub fn write_f64(&mut self, v: f64) -> Result<(), SavefileError>
[src]
Writes a binary little endian f64 to the dyn Write
pub fn write_u64(&mut self, v: u64) -> Result<(), SavefileError>
[src]
Writes a binary little endian u64 to the dyn Write
pub fn write_i64(&mut self, v: i64) -> Result<(), SavefileError>
[src]
Writes a binary little endian i64 to the dyn Write
pub fn write_usize(&mut self, v: usize) -> Result<(), SavefileError>
[src]
Writes a binary little endian usize as u64 to the dyn Write
pub fn write_isize(&mut self, v: isize) -> Result<(), SavefileError>
[src]
Writes a binary little endian isize as i64 to the dyn Write
pub fn write_buf(&mut self, v: &[u8]) -> Result<(), SavefileError>
[src]
Writes a binary u8 array to the dyn Write
pub fn write_string(&mut self, v: &str) -> Result<(), SavefileError>
[src]
Writes as a string as 64 bit length + utf8 data
pub fn write_bytes(&mut self, v: &[u8]) -> Result<(), SavefileError>
[src]
Writes a binary u8 array to the dyn Write. Synonym of write_buf.
pub fn save<T: WithSchema + Serialize>(
writer: &mut dyn Write,
version: u32,
data: &T,
with_compression: bool
) -> Result<(), SavefileError>
[src]
writer: &mut dyn Write,
version: u32,
data: &T,
with_compression: bool
) -> Result<(), SavefileError>
Creata a new serializer. Don't use this function directly, use the crate::save function instead.
pub fn save_noschema<T: WithSchema + Serialize>(
writer: &mut dyn Write,
version: u32,
data: &T
) -> Result<(), SavefileError>
[src]
writer: &mut dyn Write,
version: u32,
data: &T
) -> Result<(), SavefileError>
Creata a new serializer. Don't use this function directly, use the crate::save_noschema function instead.
pub fn new_raw(writer: &mut dyn Write) -> Serializer
[src]
Create a Serializer. Don't use this method directly, use the crate::save function instead.
Auto Trait Implementations
impl<'a> !RefUnwindSafe for Serializer<'a>
impl<'a> !Send for Serializer<'a>
impl<'a> !Sync for Serializer<'a>
impl<'a> Unpin for Serializer<'a>
impl<'a> !UnwindSafe for Serializer<'a>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Erased for T
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,