Skip to main content

RustBackend

Trait RustBackend 

Source
pub trait RustBackend: Sized {
    type Session: Session<Error = TransportError, PublisherHandle = Self::Publisher, SubscriptionHandle = Self::Subscription, ServiceHandle = Self::Service, ClientHandle = Self::Client> + 'static;
    type Publisher: Publisher<Error = TransportError> + 'static;
    type Subscription: Subscription<Error = TransportError> + 'static;
    type Service: ServiceTrait<Error = TransportError> + 'static;
    type Client: ClientTrait<Error = TransportError> + 'static;

    // Required methods
    fn factory() -> Self;
    fn open(
        self,
        config: &RmwConfig<'_>,
    ) -> Result<Self::Session, TransportError>;
}
Expand description

Bundle of trait bounds an Rmw backend must satisfy to be exposed through RustBackendAdapter. Implemented automatically for any R: Rmw whose handle types use TransportError and are 'static.

Required Associated Types§

Source

type Session: Session<Error = TransportError, PublisherHandle = Self::Publisher, SubscriptionHandle = Self::Subscription, ServiceHandle = Self::Service, ClientHandle = Self::Client> + 'static

Source

type Publisher: Publisher<Error = TransportError> + 'static

Source

type Subscription: Subscription<Error = TransportError> + 'static

Source

type Service: ServiceTrait<Error = TransportError> + 'static

Source

type Client: ClientTrait<Error = TransportError> + 'static

Required Methods§

Source

fn factory() -> Self

Construct a fresh factory instance. Called inside the open trampoline. Equivalent to R::default() for backends that derive(Default); the indirection keeps the door open for future per-backend registration knobs.

Source

fn open(self, config: &RmwConfig<'_>) -> Result<Self::Session, TransportError>

Move the factory into a session per the Rmw::open contract.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§