Skip to main content

CffiSession

Struct CffiSession 

Source
pub struct CffiSession { /* private fields */ }
Expand description

Session backed by a C vtable.

Implementations§

Source§

impl CffiSession

Source

pub fn node_name(&self) -> &str

Node name passed at session-open time.

Source

pub fn open( locator: &str, mode: u8, domain_id: u32, node_name: &str, ) -> Result<Self, TransportError>

Open a new session via the default registered vtable (first entry in the registry — the RMW_IMPLEMENTATION-style fast path for single-backend builds).

For explicit backend selection in multi-backend (bridge) binaries, use open_named.

Source

pub fn open_named( rmw_name: &str, locator: &str, mode: u8, domain_id: u32, node_name: &str, ) -> Result<Self, TransportError>

Phase 104.C.1 — open a new session against a named backend. Resolves rmw_name against the registry (Phase 104.B.2), returns Err(TransportError::InvalidArgument) if no backend is registered under that name.

Trait Implementations§

Source§

impl Drop for CffiSession

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl Session for CffiSession

Source§

fn supported_qos_policies(&self) -> QosPolicyMask

Phase 115.K.2.5.1.2 — declare a permissive QoS-policy mask here so backends behind the cffi vtable don’t get rejected by the runtime’s pre-validate step before they ever see the create_publisher / create_subscriber call. The vtable doesn’t expose a per-backend policy mask yet; until it does, the cffi route has to assume the registered backend supports the union of every policy any nros-supported RMW honours. Backends that don’t support a policy MUST surface NROS_RMW_RET_INCOMPATIBLE_QOS from create_publisher etc. to keep the no-silent-degradation contract.

TODO 115.K.2.x: extend nros_rmw_vtable_t with a supported_qos_policies() callback so the runtime queries the backend instead of guessing.

Source§

type Error = TransportError

Error type for this session
Source§

type PublisherHandle = CffiPublisher

Publisher handle type
Source§

type SubscriberHandle = CffiSubscriber

Subscriber handle type
Source§

type ServiceServerHandle = CffiServiceServer

Service server handle type
Source§

type ServiceClientHandle = CffiServiceClient

Service client handle type
Source§

fn create_publisher( &mut self, topic: &TopicInfo<'_>, qos: QosSettings, ) -> Result<CffiPublisher, TransportError>

Create a publisher bound to this session. Read more
Source§

fn create_subscriber( &mut self, topic: &TopicInfo<'_>, qos: QosSettings, ) -> Result<CffiSubscriber, TransportError>

Create a subscriber bound to this session. Read more
Source§

fn create_service_server( &mut self, service: &ServiceInfo<'_>, qos: QosSettings, ) -> Result<CffiServiceServer, TransportError>

Create a service server bound to this session. Replies are matched to requests by the sequence number returned from ServiceServerTrait::try_recv_request. Read more
Source§

fn create_service_client( &mut self, service: &ServiceInfo<'_>, qos: QosSettings, ) -> Result<CffiServiceClient, TransportError>

Create a service client bound to this session. Read more
Source§

fn close(&mut self) -> Result<(), TransportError>

Close the session, releasing transport resources. All entity handles created from this session must already be dropped.
Source§

fn drive_io(&mut self, timeout_ms: i32) -> Result<(), TransportError>

Drive transport I/O (poll network, dispatch callbacks). Read more
Source§

fn next_deadline_ms(&self) -> Option<u32>

Phase 110.0 — backend’s next internal-event deadline in milliseconds from now (lease keepalive, heartbeat, reader ACK-NACK timeout, etc.). Read more
Source§

unsafe fn set_wake_callback( &mut self, cb: Option<unsafe extern "C" fn(ctx: *mut c_void)>, ctx: *mut c_void, )

Phase 124.B.1 — install (or clear, when cb.is_none()) the executor wake callback. The runtime calls this once per session after open with cb pointing at a runtime-owned function and ctx pointing at the executor’s wake state. The backend stores (cb, ctx) in its per-session state and calls cb(ctx) whenever its transport notification path fires (datagram arrival, condvar wake, etc.) — the runtime cb does flag-write + condvar-signal atomically, so a spin_once blocked on the wake condvar resumes immediately instead of waiting for the next poll iteration. Read more
Source§

fn supports_wake_callback(&self) -> bool

Phase 130.4 — does this backend actually honour set_wake_callback? Read more
Source§

fn ping_session(&mut self, timeout_ms: i32) -> Result<(), TransportError>

Phase 124.F.1 — session-level connectivity probe. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.