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
impl EventLines
Sourcepub fn open(session: &SessionToken, filter: Option<EventFilter>) -> Result<Self>
pub fn open(session: &SessionToken, filter: Option<EventFilter>) -> Result<Self>
Open the stream a session token names, optionally through a filter.
Sourcepub fn session(&self) -> &SessionToken
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.