Skip to main content

CustomMarshal

Trait CustomMarshal 

Source
pub trait CustomMarshal {
    // Required methods
    fn marshal(&self, os: &mut DataOutputStream<'_, '_>) -> Sys<()>;
    fn unmarshal(&mut self, is: &mut DataInputStream<'_, '_>) -> Sys<()>;
}
Expand description

The marshaling of a custom valuetype (CORBA::CustomMarshal), which the application implements for the state struct the generator makes for it: the generated code calls it to write and read the state.

ⓘ
impl CustomMarshal for BlobState {
    fn marshal(&self, os: &mut DataOutputStream<'_, '_>) -> Sys<()> {
        os.write::<Long>(&self.n)?;
        os.write::<Point>(&self.pt)
    }
    fn unmarshal(&mut self, is: &mut DataInputStream<'_, '_>) -> Sys<()> {
        self.n = is.read::<Long>()?;
        self.pt = is.read::<Point>()?;
        Ok(())
    }
}

Required Methods§

Source

fn marshal(&self, os: &mut DataOutputStream<'_, '_>) -> Sys<()>

Writes the state.

Source

fn unmarshal(&mut self, is: &mut DataInputStream<'_, '_>) -> Sys<()>

Reads the state, in the order CustomMarshal::marshal writes it.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§