Trait cyphal::Response

source ·
pub trait Response<const N: usize>: Sized {
    type Payload: Sized;

    // Required methods
    fn new(
        priority: Priority,
        service: ServiceId,
        destination: NodeId,
        source: NodeId,
        payload: [u8; N]
    ) -> CyphalResult<Self>;
    fn priority(&self) -> Priority;
    fn service(&self) -> ServiceId;
    fn destination(&self) -> NodeId;
    fn source(&self) -> NodeId;
    fn payload(&self) -> &[u8];
}
Expand description

Represents a response returned by a service

Required Associated Types§

source

type Payload: Sized

Type representing the payload in the response

Required Methods§

source

fn new( priority: Priority, service: ServiceId, destination: NodeId, source: NodeId, payload: [u8; N] ) -> CyphalResult<Self>

Constructs a new response

source

fn priority(&self) -> Priority

Returns the priority level of the response

source

fn service(&self) -> ServiceId

Returns the Service ID where the response originates

source

fn destination(&self) -> NodeId

Returns the destination Node ID where the response originates

source

fn source(&self) -> NodeId

Returns the Node ID that requested the response

source

fn payload(&self) -> &[u8]

Returns the payload of the response

Object Safety§

This trait is not object safe.

Implementors§