pub struct Opts {Show 13 fields
pub cflags: CFlag,
pub iflags: IFlag,
pub oflags: OFlag,
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
conversion of strings to unsized integers & unit conversions
input, output, and conversion flags
Conversion flags, specified by the conv
option
The parsed and handled user options.
Fields§
§cflags: CFlag
convert the file as per the comma separated symbol list
iflags: IFlag
handle the input as per the comma-separated symbol list (see
[opts::IFlag
])
oflags: OFlag
handle the output as per the comma-separated symbol list (see
[flags::Out
])
mode: Mode
The 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: usize
The 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
opts::IFlag::SEEK_BYTES
, seek that many bytes instead
output_block_size: usize
The 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: StatusLevel
Implementations§
Source§impl Opts
impl Opts
pub fn new<I>(args: I) -> Result<Self>where
I: IntoIterator<Item = String>,
Sourcepub fn iflag(&self, iflag: IFlag) -> bool
pub fn iflag(&self, iflag: IFlag) -> bool
iflag returns true if the specified iflag is set
let mut o = opts::Opts::default();
o.iflags = IFlag::APPEND | IFlag::SYNC;
assert!(o.iflag(IFlag::APPEND));
assert!(!o.iflag(IFlag::NOFOLLOW));