You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// fluvio/src/offset.rs/// Creates a relative offset pointing to the newest log entry////// A relative `FromEnd` offset will point to the last "stable committed"/// event entry in the log. Since a log may continue growing at any time,/// a `FromEnd` offset may refer to different entries depending on when a/// query is made.////// For example, `Offset::end()` will refer to the event with content/// `66` at this point in time:////// ```text/// Partition Log: [ .., .., 22, 33, 44, 55, 66 ]/// Absolute Offset: 0, 1, 2, 3, 4, 5, 6/// FromEnd Offset: 6, 5, 4, 3, 2, 1, 0/// ```////// But when these new events are added, `Offset::end()` will refer to the/// event with content `99`.////// ```text/// These events were added!/// |/// vvvvvvvvvv/// Partition Log: [ .., .., 22, 33, 44, 55, 66, 77, 88, 99 ]/// Absolute Offset: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9/// FromEnd Offset: 9, 8, 7, 6, 5, 4, 3, 2, 1, 0/// ```////// # Example////// ```/// # use fluvio::Offset;/// // Creates an offset pointing to the latest log entry/// let offset: Offset = Offset::end();/// ```pubfnend() -> Offset{Offset::from_end(0)}/// Creates a relative offset a fixed distance before the newest log entry////// A relative `FromEnd` offset will begin counting from the last/// "stable committed" event entry in the log. Increasing the offset will/// select events in reverse chronological order from the most recent event/// towards the earliest event. Therefore, a relative `FromEnd` offset may/// refer to different entries depending on when a query is made.////// For example, `Offset::from_end(3)` will refer to the event with content/// `33` at this point in time:////// ```text/// Partition Log: [ .., .., 22, 33, 44, 55, 66 ]/// Absolute Offset: 0, 1, 2, 3, 4, 5, 6/// FromEnd Offset: 6, 5, 4, 3, 2, 1, 0/// ```////// But when these new events are added, `Offset::from_end(3)` will refer to/// the event with content `66`:////// ```text/// These events were added!/// |/// vvvvvvvvvv/// Partition Log: [ .., .., 22, 33, 44, 55, 66, 77, 88, 99 ]/// Absolute Offset: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9/// FromEnd Offset: 9, 8, 7, 6, 5, 4, 3, 2, 1, 0/// ```////// # Example////// ```/// # use fluvio::Offset;/// // Creates an offset pointing 3 places before the latest log entry/// let offset: Offset = Offset::from_end(3);/// ```pubfnfrom_end(offset:u32) -> Offset{Self{inner:OffsetInner::FromEnd(offset asi64),}}
Actual behavior
In other words, calling Offset::end() will get the offset of the next record to be produced.
The text was updated successfully, but these errors were encountered: