Enum gix_filter::pipeline::convert::ToWorktreeOutcome
source · pub enum ToWorktreeOutcome<'input, 'pipeline> {
Unchanged(&'input [u8]),
Buffer(&'pipeline [u8]),
Process(MaybeDelayed<'pipeline>),
}
Expand description
The result of a conversion with zero or more filters.
Panics
If std::io::Read
is used on it and the output is delayed, a panic will occur. The caller is responsible for either disallowing delayed
results or if allowed, handle them. Use `is_delayed().
Variants§
Unchanged(&'input [u8])
The original input wasn’t changed and the original buffer is present
Buffer(&'pipeline [u8])
A reference to the result of one or more filters of which one didn’t support streaming.
This can happen if an eol
, working-tree-encoding
or ident
filter is applied, possibly on top of an external filter.
Process(MaybeDelayed<'pipeline>)
An external filter (and only that) was applied and its results have to be consumed. Note that the output might be delayed, which requires special handling to eventually receive it.
Implementations§
source§impl<'input, 'pipeline> ToWorktreeOutcome<'input, 'pipeline>
impl<'input, 'pipeline> ToWorktreeOutcome<'input, 'pipeline>
sourcepub fn is_delayed(&self) -> bool
pub fn is_delayed(&self) -> bool
Return true if this outcome is delayed. In that case, one isn’t allowed to use Read
or cause a panic.
sourcepub fn is_changed(&self) -> bool
pub fn is_changed(&self) -> bool
Returns true
if the input buffer was actually changed, or false
if it is returned directly.
Trait Implementations§
source§impl<'input, 'pipeline> Read for ToWorktreeOutcome<'input, 'pipeline>
impl<'input, 'pipeline> Read for ToWorktreeOutcome<'input, 'pipeline>
source§fn read(&mut self, buf: &mut [u8]) -> Result<usize>
fn read(&mut self, buf: &mut [u8]) -> Result<usize>
1.36.0 · source§fn read_vectored(&mut self, bufs: &mut [IoSliceMut<'_>]) -> Result<usize, Error>
fn read_vectored(&mut self, bufs: &mut [IoSliceMut<'_>]) -> Result<usize, Error>
read
, except that it reads into a slice of buffers. Read moresource§fn is_read_vectored(&self) -> bool
fn is_read_vectored(&self) -> bool
can_vector
)1.0.0 · source§fn read_to_end(&mut self, buf: &mut Vec<u8>) -> Result<usize, Error>
fn read_to_end(&mut self, buf: &mut Vec<u8>) -> Result<usize, Error>
buf
. Read more1.0.0 · source§fn read_to_string(&mut self, buf: &mut String) -> Result<usize, Error>
fn read_to_string(&mut self, buf: &mut String) -> Result<usize, Error>
buf
. Read more1.6.0 · source§fn read_exact(&mut self, buf: &mut [u8]) -> Result<(), Error>
fn read_exact(&mut self, buf: &mut [u8]) -> Result<(), Error>
buf
. Read moresource§fn read_buf(&mut self, buf: BorrowedCursor<'_>) -> Result<(), Error>
fn read_buf(&mut self, buf: BorrowedCursor<'_>) -> Result<(), Error>
read_buf
)source§fn read_buf_exact(&mut self, cursor: BorrowedCursor<'_>) -> Result<(), Error>
fn read_buf_exact(&mut self, cursor: BorrowedCursor<'_>) -> Result<(), Error>
read_buf
)cursor
. Read more1.0.0 · source§fn by_ref(&mut self) -> &mut Selfwhere
Self: Sized,
fn by_ref(&mut self) -> &mut Selfwhere
Self: Sized,
Read
. Read more