Skip to main content

EventLines

Struct EventLines 

Source
pub struct EventLines { /* private fields */ }
Expand description

A reader over one session’s event stream as text, which is what onevcs events prints.

EventStream beside it is the same file read as values, and the difference is which of the two a caller needs. A consumer acting on what a session did wants envelopes, and a line that is not one is a gap it must be told about — that is EventStream, and it refuses. A consumer showing a session’s stream wants the file: a line this build cannot parse is the line somebody most needs to see, and the envelope is versioned, so refusing it would stop a stream a later build wrote from being readable at all.

Opened with an EventFilter, it is the second reading and not a third: an event has to be read to be judged, so a line that is not this session’s envelope is refused there, naming it, rather than passed through — which would report an event the filter never admitted — or dropped, which would hide one. A kind this build has no word for is left out, because a filter is a statement about the events a consumer wants and that is not one of them however it is spelled.

Reading again yields whatever has been appended since, which is what --follow does with a loop around it.

Implementations§

Source§

impl EventLines

Source

pub fn open(session: &SessionToken, filter: Option<EventFilter>) -> Result<Self>

Open the stream a session token names, optionally through a filter.

Source

pub fn session(&self) -> &SessionToken

The session whose stream this reads, so a caller following several at once can say whose lines it is holding.

Source

pub fn read(&mut self) -> Result<Vec<EventLine>>

The lines appended since the last call, in the order they were written.

Trait Implementations§

Source§

impl Debug for EventLines

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.