Enum clio::SizedOutput
source · [−]Expand description
A builder for Output that allows setting the size before writing. This is mostly usefull with the “http” feature for setting the Content-Length header
Variants
Stdout(Stdout)
Pipe(OsString, File)
File(OsString, File)
Implementations
sourceimpl SizedOutput
impl SizedOutput
sourcepub fn new<S: AsRef<OsStr>>(path: S) -> Result<Self>
pub fn new<S: AsRef<OsStr>>(path: S) -> Result<Self>
Contructs a new output either by opening/creating the file or for ‘-’ returning stdout
sourcepub fn try_from_os_str(path: &OsStr) -> Result<Self, OsString>
pub fn try_from_os_str(path: &OsStr) -> Result<Self, OsString>
Contructs a new SizedOutput
either by opening/creating the file or for ‘-’ returning stdout
The error is converted to a OsString
so that stuctopt can show it to the user.
It is recomended that you use TryFrom::try_from
and clap 3.0 instead.
sourcepub fn with_len(self, size: u64) -> Result<Output>
pub fn with_len(self, size: u64) -> Result<Output>
set the length of the file, either as the content-length header of the http put
pub fn without_len(self) -> Result<Output>
pub fn maybe_with_len(self, size: Option<u64>) -> Result<Output>
Trait Implementations
sourceimpl Debug for SizedOutput
impl Debug for SizedOutput
sourceimpl Display for SizedOutput
impl Display for SizedOutput
Auto Trait Implementations
impl RefUnwindSafe for SizedOutput
impl Send for SizedOutput
impl Sync for SizedOutput
impl Unpin for SizedOutput
impl UnwindSafe for SizedOutput
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more