pub struct BinaryModelSerializer;Expand description
Binary model serializer (using JSON for simplicity, could use MessagePack or Bincode)
Trait Implementations§
Source§impl ModelSerializer for BinaryModelSerializer
impl ModelSerializer for BinaryModelSerializer
Source§fn save<P: AsRef<Path>>(&self, model: &SerializableModel, path: P) -> Result<()>
fn save<P: AsRef<Path>>(&self, model: &SerializableModel, path: P) -> Result<()>
Save a model to file
Source§fn load<P: AsRef<Path>>(&self, path: P) -> Result<Box<dyn ModelServing>>
fn load<P: AsRef<Path>>(&self, path: P) -> Result<Box<dyn ModelServing>>
Load a model from file
Source§fn deserialize(&self, data: &[u8]) -> Result<SerializableModel>
fn deserialize(&self, data: &[u8]) -> Result<SerializableModel>
Deserialize model from bytes
Source§fn format(&self) -> SerializationFormat
fn format(&self) -> SerializationFormat
Get supported format
Auto Trait Implementations§
impl Freeze for BinaryModelSerializer
impl RefUnwindSafe for BinaryModelSerializer
impl Send for BinaryModelSerializer
impl Sync for BinaryModelSerializer
impl Unpin for BinaryModelSerializer
impl UnsafeUnpin for BinaryModelSerializer
impl UnwindSafe for BinaryModelSerializer
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