#[non_exhaustive]pub struct Options {
pub pool_size: usize,
pub client_name: String,
pub logger: Option<Logger>,
pub call_timeout: Duration,
pub max_inflight: usize,
}Expand description
Client settings. Start from Options::default() and chain the with_ methods. New fields
can be added in a minor version, so a struct literal does not compile outside this crate.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.pool_size: usizeNumber of connections. Calls on different files can run in parallel up to this number.
client_name: String§logger: Option<Logger>Receives log lines: events nobody listens for, listener panics and dropped events.
The line has no prefix and no newline. When None, lines go to stderr with the prefix
“mountos: “. Pass your own function to route them elsewhere.
call_timeout: DurationLongest a single request may take, from the end of the send to the reply. Duration::ZERO
(the default) means no limit. A call that runs over fails with Error::Timeout. When the
connection pipelines, only that call fails: its id is marked abandoned and the late reply is
dropped. Otherwise, or when too many ids are abandoned, the connection is dropped and dialed
again on the next call, and its files and watches are gone. A call that sends several
requests (a large read or write) gets the limit for each request.
max_inflight: usizeMost requests outstanding on one connection when the server pipelines. The server limit
(max_inflight in its Hello reply) also applies. Values are held between 1 and 1024. A
server without the pipelining capability gets one request at a time.
Implementations§
Source§impl Options
impl Options
Sourcepub fn with_pool_size(self, pool_size: usize) -> Options
pub fn with_pool_size(self, pool_size: usize) -> Options
Sets pool_size.
Sourcepub fn with_logger(self, logger: Logger) -> Options
pub fn with_logger(self, logger: Logger) -> Options
Sets logger.
Sourcepub fn with_call_timeout(self, call_timeout: Duration) -> Options
pub fn with_call_timeout(self, call_timeout: Duration) -> Options
Sets call_timeout.
Sourcepub fn with_max_inflight(self, max_inflight: usize) -> Options
pub fn with_max_inflight(self, max_inflight: usize) -> Options
Sets max_inflight.