Skip to main content

CffiPublisher

Struct CffiPublisher 

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

Publisher backed by a C vtable.

Implementations§

Source§

impl CffiPublisher

Source

pub fn topic_name(&self) -> &str

Topic name. Result is the null-terminated string written at publisher creation; never re-resolved from the backend.

Source

pub fn type_name(&self) -> &str

Fully-qualified type name ("std_msgs/msg/Int32").

Source

pub fn qos(&self) -> NrosRmwQos

QoS used to create this publisher.

Source

pub fn can_loan_messages(&self) -> bool

true iff the backend exposes the publish loan primitive (Phase 99). Mirrors upstream rmw_publisher_t::can_loan_messages.

Trait Implementations§

Source§

impl Drop for CffiPublisher

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more
Source§

impl Publisher for CffiPublisher

Source§

fn actual_qos(&self) -> QoSProfile

The profile the backend GRANTED, read back at create time.

Answers off the retained value rather than re-entering the backend: upstream’s rmw_publisher_get_actual_qos is a property of the entity, and a backend call here would make an accessor a transport operation on a &self that any callback may hold.

Source§

fn get_gid(&self) -> Result<[u8; 24], TransportError>

Upstream rmw_get_gid_for_publisher, through the vtable slot.

The phase-467 RMW gap-closure design study’s Q1, step 2. A NULL slot answers Unsupported — uORB and XRCE NULL it. The Rust adapter table zenoh rides FILLS it now (it was NULL there too until this study, so a Rust backend with a real identity could not report one). Never an all-zero gid: that is what the uninitialised rmw_gid_t below holds, so returning it on the NULL path would make “no identity” read exactly like an answer.

The backend’s implementation_identifier is deliberately DROPPED here. nros_rmw_cffi_register_named admits several backends in one image and gids from two of them are not comparable, so upstream’s pairing matters — but the trait answers bytes, and the identifier a caller needs is the one on the SESSION it asked. Carrying a second copy per publisher would be a second place for it to disagree.

Source§

fn count_matched_subscriptions(&self) -> Result<usize, TransportError>

Upstream rmw_publisher_count_matched_subscriptions, through the vtable slot. Issue 1643 — the slot’s first RUNTIME reader (the node API’s get_subscription_count); until then only an interop probe and the backend’s own tests asked. A NULL slot answers Unsupported.

Source§

type Error = TransportError

Error type for publish operations
Source§

fn publish_raw(&self, data: &[u8]) -> Result<(), TransportError>

Publish a CDR-serialised message. Read more
Source§

unsafe fn publish_streamed( &self, size_cb: unsafe extern "C" fn(out_total_len: *mut usize, user_ctx: *mut c_void), chunk_cb: unsafe extern "C" fn(out_buf: *mut u8, cap: usize, out_written: *mut usize, user_ctx: *mut c_void), user_ctx: *mut c_void, ) -> Result<(), TransportError>

Phase 124.E.1 — streamed publish. Read more
Source§

fn buffer_error(&self) -> TransportError

Return a buffer-too-small error (implementation specific)
Source§

fn serialization_error(&self) -> TransportError

Return a serialization error (implementation specific)
Source§

fn unsupported_event_error(&self) -> TransportError

Phase 108 — backend’s error variant for “this event kind is not supported.” Default impl reuses serialization_error() since most backends share an Unsupported variant; backends override if they have a distinct Unsupported mapping.
Source§

unsafe fn register_event_callback( &mut self, kind: EventKind, deadline_ms: u32, cb: EventCallback, user_ctx: *mut c_void, ) -> Result<(), TransportError>

Phase 108 — register a callback fired when the named status event occurs. deadline_ms applies to EventKind::OfferedDeadlineMissed only; ignored otherwise. Default impl returns the backend’s “unsupported”-shaped error. Read more
Source§

fn supports_event(&self, kind: EventKind) -> bool

Phase 108 — true if the backend can generate this event for this publisher. Default returns false; backends override per supported event kind. Read more
Source§

fn assert_liveliness(&self) -> Result<(), TransportError>

Phase 109 — assert this publisher’s liveliness manually. Required for publishers configured with QoSLivelinessPolicy::ManualByTopic / ManualByNode; nothing to do for the other kinds. Read more
Source§

fn publish_raw_with_attachment( &self, data: &[u8], _attachment: &[u8], ) -> Result<(), Self::Error>

Phase 128.F.4 — publish with an opaque attachment block. Read more
Source§

fn publish<M>(&self, msg: &M, buf: &mut [u8]) -> Result<(), Self::Error>
where M: RosMessage,

Publish a typed message (serializes automatically)

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.