pub struct GspSignal {
pub signal_type: u32,
pub request_id: u32,
pub sender_id: u32,
pub role_claim: u32,
pub args_length: u32,
pub args: ByteBuf,
}Expand description
GSP signal envelope. args carries opcode-specific CBOR bytes.
Fields§
§signal_type: u32SignalType widened to u32 for CBOR uint compatibility.
request_id: u32Request identifier (echoed in ACK / NACK and used for deduplication).
sender_id: u32Sender member id.
role_claim: u32Role claim (used by ROLE_CHANGE).
args_length: u32Declared length of args.
args: ByteBufOpcode-specific CBOR-encoded arguments.
Implementations§
Source§impl GspSignal
impl GspSignal
Sourcepub fn bare(signal_type: u32, request_id: u32, sender_id: u32) -> GspSignal
pub fn bare(signal_type: u32, request_id: u32, sender_id: u32) -> GspSignal
Builds a signal with no arguments.
Sourcepub fn from_cbor(data: &[u8]) -> Result<GspSignal, CodecError>
pub fn from_cbor(data: &[u8]) -> Result<GspSignal, CodecError>
Decodes a CBOR-encoded signal and validates args_length.
Sourcepub fn from_bytes(
data: &[u8],
codec: PayloadCodec,
) -> Result<GspSignal, CodecError>
pub fn from_bytes( data: &[u8], codec: PayloadCodec, ) -> Result<GspSignal, CodecError>
Decodes from the given codec.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for GspSignal
impl<'de> Deserialize<'de> for GspSignal
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<GspSignal, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<GspSignal, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for GspSignal
impl Serialize for GspSignal
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for GspSignal
impl RefUnwindSafe for GspSignal
impl Send for GspSignal
impl Sync for GspSignal
impl Unpin for GspSignal
impl UnsafeUnpin for GspSignal
impl UnwindSafe for GspSignal
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Declassify for T
impl<T> Declassify for T
type Declassified = T
fn declassify(self) -> T
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more