pub struct Config {
pub ip_address: IpAddr,
pub port: u16,
pub directory: PathBuf,
pub receive_directory: PathBuf,
pub send_directory: PathBuf,
pub single_port: bool,
pub read_only: bool,
pub overwrite: bool,
pub opt_local: OptionsPrivate,
}Expand description
Configuration struct used for parsing TFTP options from user
input.
This struct is meant to be created by Config::new(). See its
documentation for more.
§Example
// Create TFTP configuration from user arguments.
use std::env;
use tftpd::Config;
let config = Config::new(env::args()).unwrap();Fields§
§ip_address: IpAddrLocal IP address of the TFTP Server. (default: 127.0.0.1)
port: u16Local Port number of the TFTP Server. (default: 69)
directory: PathBufDefault directory of the TFTP Server. (default: current working directory)
receive_directory: PathBufUpload directory of the TFTP Server. (default: directory)
send_directory: PathBufDownload directory of the TFTP Server. (default: directory)
single_port: boolUse a single port for both sending and receiving. (default: false)
read_only: boolRefuse all write requests, making the server read-only. (default: false)
overwrite: boolOverwrite existing files. (default: false)
opt_local: OptionsPrivateLocal options for server
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnwindSafe for Config
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more