pub struct OutputSender { /* private fields */ }Expand description
Output sender for sending packets to output pins
Implementations§
Source§impl OutputSender
impl OutputSender
Sourcepub fn from_callback(callback: COutputCallback, user_data: *mut c_void) -> Self
pub fn from_callback(callback: COutputCallback, user_data: *mut c_void) -> Self
Create a new output sender from C callback
Sourcepub fn from_callbacks(
output_callback: COutputCallback,
output_user_data: *mut c_void,
telemetry_callback: CTelemetryCallback,
telemetry_user_data: *mut c_void,
) -> Self
pub fn from_callbacks( output_callback: COutputCallback, output_user_data: *mut c_void, telemetry_callback: CTelemetryCallback, telemetry_user_data: *mut c_void, ) -> Self
Create a new output sender from C callbacks.
telemetry_callback may be null if the host doesn’t provide telemetry support.
Sourcepub fn send(&self, pin: &str, packet: &Packet) -> Result<(), String>
pub fn send(&self, pin: &str, packet: &Packet) -> Result<(), String>
Send a packet to an output pin
§Errors
Returns an error if:
- The pin name contains null bytes
- The C callback returns an error
Sourcepub fn emit_telemetry(
&self,
event_type: &str,
data: &Value,
timestamp_us: Option<u64>,
) -> Result<(), String>
pub fn emit_telemetry( &self, event_type: &str, data: &Value, timestamp_us: Option<u64>, ) -> Result<(), String>
Emit a telemetry event to the host telemetry bus (best-effort).
data is encoded as JSON and forwarded out-of-band; it does not flow through graph pins.
If the host doesn’t provide a telemetry callback, this is a no-op.
§Errors
Returns an error if:
event_typecontains an interior NUL byte (invalid C string),datacannot be serialized to JSON,- the host telemetry callback reports an error.
Auto Trait Implementations§
impl Freeze for OutputSender
impl RefUnwindSafe for OutputSender
impl !Send for OutputSender
impl !Sync for OutputSender
impl Unpin for OutputSender
impl UnwindSafe for OutputSender
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more