[][src]Struct phetch::menu::Line

pub struct Line {
    pub typ: Type,
    pub link: usize,
    // some fields omitted
}

The Line represents a single line in a Gopher menu. It must exist in the context of a Menu struct - its link field is its index in the Menu's links Vec, and start/end/text_end point to locations in Menu's raw Gopher response.

Fields

typ: Type

Gopher Item Type.

link: usize

Index of this link in the Menu::links vector, if it's a gopher::Type.is_link()

Methods

impl Line[src]

pub fn text<'a>(&self, raw: &'a str) -> &'a str[src]

Returns the text field of this line, given a raw Gopher response. The same Line must always be used with the same Gopher response.

pub fn text_len(&self) -> usize[src]

Get the length of this line's text field.

pub fn url(&self, raw: &str) -> String[src]

Get the URL for this line, if it's a link.

Auto Trait Implementations

impl RefUnwindSafe for Line

impl Send for Line

impl Sync for Line

impl Unpin for Line

impl UnwindSafe for Line

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.