pub struct EndpointHandler { /* private fields */ }Expand description
Endpoint handler for a specific data endpoint.
Implementations§
Source§impl EndpointHandler
impl EndpointHandler
Sourcepub fn new_packet_handler<F>(endpoint: DataEndpoint, f: F) -> Self
pub fn new_packet_handler<F>(endpoint: DataEndpoint, f: F) -> Self
Create a new endpoint handler for Packet callbacks.
Handler signature is Fn(&Packet) -> TelemetryResult<()>.
Sourcepub fn new_packet_handler_for<F>(endpoint: EndpointDefinition, f: F) -> Self
pub fn new_packet_handler_for<F>(endpoint: EndpointDefinition, f: F) -> Self
Create a new packet handler from a runtime endpoint definition.
Sourcepub fn new_packet_handler_by_name<F>(
endpoint_name: &str,
f: F,
) -> TelemetryResult<Self>
pub fn new_packet_handler_by_name<F>( endpoint_name: &str, f: F, ) -> TelemetryResult<Self>
Create a new packet handler by endpoint name.
Sourcepub fn new_packed_handler<F>(endpoint: DataEndpoint, f: F) -> Self
pub fn new_packed_handler<F>(endpoint: DataEndpoint, f: F) -> Self
Create a new endpoint handler for packed byte-slice callbacks.
Handler signature is Fn(&[u8]) -> TelemetryResult<()>.
Sourcepub fn new_packed_handler_for<F>(endpoint: EndpointDefinition, f: F) -> Self
pub fn new_packed_handler_for<F>(endpoint: EndpointDefinition, f: F) -> Self
Create a new packed handler from a runtime endpoint definition.
Sourcepub fn new_packed_handler_by_name<F>(
endpoint_name: &str,
f: F,
) -> TelemetryResult<Self>
pub fn new_packed_handler_by_name<F>( endpoint_name: &str, f: F, ) -> TelemetryResult<Self>
Create a new packed handler by endpoint name.
Sourcepub fn get_endpoint(&self) -> DataEndpoint
pub fn get_endpoint(&self) -> DataEndpoint
Return the endpoint that the handler is registered for.
Sourcepub fn get_handler(&self) -> &EndpointHandlerFn
pub fn get_handler(&self) -> &EndpointHandlerFn
Return a reference to the handler function.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for EndpointHandler
impl !UnwindSafe for EndpointHandler
impl Freeze for EndpointHandler
impl Send for EndpointHandler
impl Sync for EndpointHandler
impl Unpin for EndpointHandler
impl UnsafeUnpin for EndpointHandler
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