pub struct Opts {Show 13 fields
pub cflags: Conv,
pub iflags: In,
pub oflags: Out,
pub mode: Mode,
pub count: Option<usize>,
pub files: Option<usize>,
pub input_block_size: usize,
pub input_file: Option<String>,
pub input_seek: Option<usize>,
pub output_block_size: usize,
pub output_file: Option<String>,
pub output_seek: Option<usize>,
pub status: StatusLevel,
}Expand description
The parsed and handled user options.
Fields
cflags: Convconvert the file as per the comma separated symbol list
iflags: Inhandle the input as per the comma-separated symbol list (see
flags::In)
oflags: Outhandle the output as per the comma-separated symbol list (see
flags::Out)
mode: ModeThe main mode to run in. Can be Mode::Standard, Mode::Block(usize), Mode::Unblock(usize)
count: Option<usize>The limit in bytes or blocks to read
files: Option<usize>input_block_size: usizeThe block size of the input, in bytes. Default is 512.
input_file: Option<String>The input file, if any. input_file == None -> stdin
input_seek: Option<usize>How many input_block_sized blocks to seek on the input. If also
flags::In::SEEK_BYTES, seek that many bytes instead
output_block_size: usizeThe block size of the output, in bytes. Default is 512.
output_file: Option<String>The output file, if any. output_file == None -> stdout
output_seek: Option<usize>How many output_block_sized blocks to seek on the output file.
Incompatible with output_file==None
status: StatusLevelImplementations
sourceimpl Opts
impl Opts
pub fn new<I>(args: I) -> Result<Self>where
I: IntoIterator<Item = String>,
sourcepub fn iflag(&self, flag: In) -> bool
pub fn iflag(&self, flag: In) -> bool
iflag returns true if the specified iflag is set
let mut o = opts::Opts::default();
o.iflags = flags::In::APPEND | flags::In::SYNC;
assert!(o.iflag(flags::In::APPEND));
assert!(!o.iflag(flags::In::NOFOLLOW));