use crate::Content;
use http::uri::Uri;
#[derive(Clone, Debug)]
pub struct Link {
uri: Uri,
label: Option<Content>,
}
impl Link {
pub fn new(uri: Uri, label: Option<Content>) -> Self {
Link { uri, label }
}
pub fn uri(&self) -> &Uri {
&self.uri
}
pub fn uri_mut(&mut self) -> &mut Uri {
&mut self.uri
}
pub fn label(&self) -> &Option<Content> {
&self.label
}
pub fn label_mut(&mut self) -> &mut Option<Content> {
&mut self.label
}
}
impl From<Uri> for Link {
fn from(uri: Uri) -> Link {
Link::new(uri, None)
}
}