pub enum OutputPayload {
Text(String),
Bytes(Vec<u8>),
}Expand description
A command’s stdout payload: text, or raw bytes.
Text xor Bytes — the enum makes the invalid both-set state
unrepresentable (an earlier draft used two sibling fields; see
docs/binary-data.md). Serializes wire-compatibly: Text is a bare JSON
string (unchanged from when out was a String), Bytes is the base64
envelope from crate::bytes.
Variants§
Text(String)
UTF-8 text — the common case, canonical for pipes.
Bytes(Vec<u8>)
Raw bytes — binary output (set by binary-aware builtins). Until the Phase-2 pipe/consumption rework, no builtin produces this in practice.
Trait Implementations§
Source§impl Clone for OutputPayload
impl Clone for OutputPayload
Source§fn clone(&self) -> OutputPayload
fn clone(&self) -> OutputPayload
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 OutputPayload
impl Debug for OutputPayload
Source§impl Default for OutputPayload
impl Default for OutputPayload
Source§fn default() -> OutputPayload
fn default() -> OutputPayload
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for OutputPayload
impl<'de> Deserialize<'de> for OutputPayload
Source§fn deserialize<D>(
deserializer: D,
) -> Result<OutputPayload, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<OutputPayload, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for OutputPayload
impl PartialEq for OutputPayload
Source§fn eq(&self, other: &OutputPayload) -> bool
fn eq(&self, other: &OutputPayload) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for OutputPayload
impl Serialize for OutputPayload
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
impl StructuralPartialEq for OutputPayload
Auto Trait Implementations§
impl Freeze for OutputPayload
impl RefUnwindSafe for OutputPayload
impl Send for OutputPayload
impl Sync for OutputPayload
impl Unpin for OutputPayload
impl UnsafeUnpin for OutputPayload
impl UnwindSafe for OutputPayload
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