Struct ng_log::NgLog [] [src]

pub struct NgLog {
    pub events: Vec<NgEvent>,
}

A type representing an ngLog-formatted file.

Fields

events

A collection of ngLog events.

Methods

impl NgLog

fn new(capacity: usize) -> NgLog

Constructs a new NgLog instance, allocating memory for at least capacity events.

fn local_from_reader<T>(reader: &mut T) -> IoResult<NgLog> where T: Read

Constructs a new NgLog instance using data from a type implementing std::io::Read. The data is interpreted as a UTF-8 string.

Failures

If the input data is either not valid UTF-8 or malformed, this method returns an std::io::Error instance describing the error.

fn world_from_reader<T>(reader: &mut T) -> IoResult<NgLog> where T: Read

Constructs a new NgLog instance using data from a type implementing std::io::Error. The data is fed through a decoding algorithm, then interpreted as a UTF-8 string.

Failures

If the input data is either not valid UTF-8 or malformed, this method returns an std::io::Error instance describing the error.

fn from_string(s: &String) -> IoResult<NgLog>

Constructs a new NgLog instance from the given input string.

Failures

If the input data is malformed, this method returns an std::io::Error instance describing the error.

Trait Implementations

impl ToString for NgLog

fn to_string(&self) -> String