use crate::prelude::*;
impl BetterUrl {
pub fn host_port_str(&self) -> Option<&str> {
Some(unsafe {self.serialization.get_unchecked(self.details.host_start?.get() as usize .. self.details.path_start as usize)})
}
pub fn set_host_port<'h, 'p, H: TryInto<FileHost<'h>> + TryInto<SpecialNotFileHost<'h>> + TryInto<NonSpecialHost<'h>>, P: TryInto<MaybePort<'p>>>(&mut self, host: H, port: Option<P>) -> Result<(), SetHostPortError>
where InvalidHost: From<<H as TryInto<FileHost<'h>>>::Error> + From<<H as TryInto<SpecialNotFileHost<'h>>>::Error> + From<<H as TryInto<NonSpecialHost<'h>>>::Error>, InvalidPort: From<P::Error>
{
self.set_host(host)?;
if let Some(port) = port {
self.set_port(port)?;
}
Ok(())
}
}