shared::utils::fragment_request_impl

Trait FragmentRequestOperation

Source
pub trait FragmentRequestOperation {
    // Required methods
    fn new(worker_name: String, maximal_worker_load: u32) -> Self;
    fn serialize(&self) -> Result<String, Error>;
    fn deserialize(message: &str) -> Result<Self, Error>
       where Self: Sized;
}

Required Methods§

Source

fn new(worker_name: String, maximal_worker_load: u32) -> Self

Source

fn serialize(&self) -> Result<String, Error>

Serializes a FragmentRequest into a JSON string.

§Arguments
  • request - A reference to the FragmentRequest to be serialized.
§Returns

A Result<String, serde_json::Error> which is Ok containing the JSON string if serialization is successful, or an Err containing the serde_json::Error if it fails.

Source

fn deserialize(message: &str) -> Result<Self, Error>
where Self: Sized,

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§