Skip to main content

Servant

Trait Servant 

Source
pub trait Servant: Send + Sync {
    // Required methods
    fn repository_id(&self) -> &str;
    fn dispatch(
        &self,
        operation: &str,
        input: &mut InStream<'_>,
        reply: &mut ServerReply,
    ) -> Result<(), SystemException>;

    // Provided method
    fn is_a(&self, repository_id: &str) -> bool { ... }
}
Expand description

The implementation of a CORBA object, called by a POA.

Generated skeletons (and the adapters of the language bindings) implement it. Servants are called on the ORB’s upcall threads, possibly on several at once, so they must be Send + Sync.

Required Methods§

Source

fn repository_id(&self) -> &str

Repository id of the most derived interface, used as the type id of the servant’s references and for _is_a.

Source

fn dispatch( &self, operation: &str, input: &mut InStream<'_>, reply: &mut ServerReply, ) -> Result<(), SystemException>

Runs operation: reads the in and inout arguments from input and writes the result to reply. An operation the servant does not know should return BAD_OPERATION with minor UNKNOWN_OPERATION, and a user exception is written with ServerReply::user_exception.

_is_a, _non_existent, _interface and _repository_id are answered by the ORB and do not reach the servant.

Provided Methods§

Source

fn is_a(&self, repository_id: &str) -> bool

Whether the servant implements the interface repository_id. The default only knows repository_id; IDL:omg.org/CORBA/Object:1.0 is answered by the ORB.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§