pub struct Serializer { /* private fields */ }Expand description
§Serializer
Serializer struct.
Call serialize method to serialize all directory contents.
§Usages
use lusl::{Serializer, SerializeOption};
use std::path::PathBuf;
use std::fs;
let original = PathBuf::from("tests");
let result = PathBuf::from("serialized1.bin");
let mut serializer = Serializer::new(&original, &result).unwrap();
serializer.serialize().unwrap();
assert!(result.is_file());Implementations§
Source§impl Serializer
impl Serializer
Sourcepub fn new<T: AsRef<Path>>(original_root: T, result_path: T) -> Result<Self>
pub fn new<T: AsRef<Path>>(original_root: T, result_path: T) -> Result<Self>
Set original root directory and result path and create Serializer. May create result file.
Sourcepub fn set_option(&mut self, option: SerializeOption)
pub fn set_option(&mut self, option: SerializeOption)
Set option to serialize.
If you want to serialize with default option, don’t call this method.
For more information, see SerializeOption.
Sourcepub fn set_sender(&mut self, tx: Sender<String>)
pub fn set_sender(&mut self, tx: Sender<String>)
Set transmitter to send progress. If you don’t want to send progress, don’t call this method.
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