Enum wick_packet::PacketPayload
source · pub enum PacketPayload {
Ok(Option<Base64Bytes>),
Err(PacketError),
}Variants§
Ok(Option<Base64Bytes>)
Err(PacketError)
Implementations§
source§impl PacketPayload
impl PacketPayload
pub fn fatal_error<T: Into<String>>(err: T) -> Self
sourcepub fn encode<T: Serialize>(data: T) -> Self
pub fn encode<T: Serialize>(data: T) -> Self
Encode a value into a PacketPayload
sourcepub fn decode<T: DeserializeOwned>(self) -> Result<T, Error>
pub fn decode<T: DeserializeOwned>(self) -> Result<T, Error>
Try to deserialize a Packet into the target type
pub fn err<T: Into<String>>(msg: T) -> Self
sourcepub fn type_wrapper(self, sig: Type) -> Result<TypeWrapper, Error>
pub fn type_wrapper(self, sig: Type) -> Result<TypeWrapper, Error>
pub const fn bytes(&self) -> Option<&Base64Bytes>
pub fn into_bytes(self) -> Option<Base64Bytes>
pub fn to_json(&self) -> Value
Trait Implementations§
source§impl Clone for PacketPayload
impl Clone for PacketPayload
source§fn clone(&self) -> PacketPayload
fn clone(&self) -> PacketPayload
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl Debug for PacketPayload
impl Debug for PacketPayload
source§impl<'de> Deserialize<'de> for PacketPayload
impl<'de> Deserialize<'de> for PacketPayload
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl PartialEq<PacketPayload> for PacketPayload
impl PartialEq<PacketPayload> for PacketPayload
Auto Trait Implementations§
impl RefUnwindSafe for PacketPayload
impl Send for PacketPayload
impl Sync for PacketPayload
impl Unpin for PacketPayload
impl UnwindSafe for PacketPayload
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