static-site-server-rs/src/subdomain_info.rs

27 lines
598 B
Rust
Raw Normal View History

2023-08-19 16:08:51 +00:00
#[derive(Debug, Default)]
pub struct SubdomainInfo<'a> {
pub host: &'a str,
pub after_first_dot: &'a str,
pub before_first_dot: &'a str,
pub base_domain: &'a str,
pub sub_domain: Option<&'a str>,
}
impl<'a> SubdomainInfo<'a> {
pub fn new(
host: &'a str,
after_first_dot: &'a str,
before_first_dot: &'a str,
base_domain: &'a str,
sub_domain: Option<&'a str>,
) -> Self {
Self {
host,
after_first_dot,
before_first_dot,
base_domain,
sub_domain,
}
}
}