#[derive(Clone, Debug, Eq, PartialEq)]
pub struct FsAuthority {
pub host: String,
pub port: Option<u16>,
pub username: Option<String>,
}
impl FsAuthority {
#[inline]
#[must_use]
pub fn new(host: &str) -> Self {
Self {
host: host.to_owned(),
port: None,
username: None,
}
}
#[inline]
#[must_use]
pub fn with_port(mut self, port: u16) -> Self {
self.port = Some(port);
self
}
#[inline]
#[must_use]
pub fn with_username(mut self, username: &str) -> Self {
if !username.is_empty() {
self.username = Some(username.to_owned());
}
self
}
}