Struct parse_hosts::Line
[−]
[src]
pub struct Line<'a> { /* fields omitted */ }
Formatted line in /etc/hosts
.
Methods
impl Line<'static>
[src]
fn empty() -> Line<'static>
[src]
Creates an empty line.
fn from_data(data: DataLine) -> Line<'static>
[src]
Creates a line directly from data
impl<'a> Line<'a>
[src]
fn new(line: &str) -> Result<Line, DataParseError>
[src]
Creates a line from a string.
fn from_comment(comment: &str) -> Line
[src]
Creates a line directly from a comment.
fn from_raw(data: DataLine, comment: &str) -> Line
[src]
Creates a line from data and a comment.
fn ip(&self) -> Option<IpAddr>
[src]
Gets the IP for this line.
fn hosts(&self) -> Hosts
[src]
Gets the IP for this line.
fn data(&self) -> Option<&DataLine>
[src]
Gets the data from this line.
fn comment<'b>(&'b self) -> Option<&'b str> where
'a: 'b,
[src]
'a: 'b,
Gets the comment from this line.
fn into_data(self) -> Option<DataLine>
[src]
Strips the comment from the line.
fn into_owned(self) -> Line<'static>
[src]
Makes an owned version of the line.
Trait Implementations
impl<'a> Clone for Line<'a>
[src]
fn clone(&self) -> Line<'a>
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<'a> Debug for Line<'a>
[src]
impl<'a> Eq for Line<'a>
[src]
impl<'a> PartialEq for Line<'a>
[src]
fn eq(&self, __arg_0: &Line<'a>) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Line<'a>) -> bool
[src]
This method tests for !=
.
impl FromStr for Line<'static>
[src]
type Err = DataParseError
The associated error which can be returned from parsing.
fn from_str(s: &str) -> Result<Line<'static>, DataParseError>
[src]
Parses a string s
to return a value of this type. Read more