[−][src]Struct gophermap::GopherEntry
A single entry in a Gopher map. This struct can be filled in order to generate Gopher responses. It can also be the result of parsing one.
Fields
item_type: ItemType
The type of the link
display_string: &'a str
The human-readable description of the link. Displayed on the UI.
selector: &'a str
The target page (selector) of the link
host: &'a str
The host for the target of the link
port: u16
The port for the target of the link
Methods
impl<'a> GopherEntry<'a>
[src]
pub fn from(line: &'a str) -> Option<Self>
[src]
Parse a line into a Gopher directory entry.
use gophermap::GopherEntry; let entry = GopherEntry::from("1Floodgap Home /home gopher.floodgap.com 70\r\n") .unwrap(); assert_eq!(entry.selector, "/home");
pub fn write<W>(&self, buf: W) -> Result<()> where
W: Write,
[src]
W: Write,
Serializes a Gopher entry into bytes. This function can be used to generate Gopher responses.
Auto Trait Implementations
impl<'a> Send for GopherEntry<'a>
impl<'a> Sync for GopherEntry<'a>
Blanket Implementations
impl<T> From for T
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,