pub struct Raw {
pub bytes: Vec<u8>,
pub command: Option<CommandOutcome>,
pub hint: Option<String>,
}Expand description
Raw tool output, before slicing.
Fields§
§bytes: Vec<u8>The complete, unmodified bytes.
command: Option<CommandOutcome>What produced them, where it was a command.
hint: Option<String>A hint at the content, e.g. a file name or language, for slicers that can use one. Never load-bearing: a slicer is chosen by the flow.
Implementations§
Source§impl Raw
impl Raw
Sourcepub fn from_command(self, outcome: CommandOutcome) -> Self
pub fn from_command(self, outcome: CommandOutcome) -> Self
Raw output from a command.
Sourcepub fn text(&self) -> Cow<'_, str>
pub fn text(&self) -> Cow<'_, str>
The bytes as text, replacing anything that is not valid UTF-8.
Lossy rather than failing: tool output is frequently nearly UTF-8 — a stray byte in a filename, a terminal escape — and refusing to slice a build log over one bad byte would be worse than showing a replacement character. The original bytes are in the CAS either way.
Trait Implementations§
impl Eq for Raw
impl StructuralPartialEq for Raw
Auto Trait Implementations§
impl Freeze for Raw
impl RefUnwindSafe for Raw
impl Send for Raw
impl Sync for Raw
impl Unpin for Raw
impl UnsafeUnpin for Raw
impl UnwindSafe for Raw
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