#[non_exhaustive]pub struct ReadRequest {
pub after: Option<Cursor>,
pub limit: Option<u32>,
pub harness: Option<String>,
pub session: Option<String>,
}Expand description
Request of usage.steps.read. Both members are optional and also accept
null; any other member is refused malformed, and so does this type.
Without after, the read starts at the oldest row the feed still holds
(the rows committed in the last 24 hours). limit defaults to 200; 0 is
refused invalid_request and above 1,000 range_too_large. This type
does not check limit: the provider does.
harness and session narrow the read to one session’s rows. Without
after, such a read also starts at the oldest row the feed holds. They
come together or not at all: this type accepts either alone, and the
provider refuses one alone invalid_request, as it refuses a bad
limit. See ReadRequest::check_pairing.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.after: Option<Cursor>§limit: Option<u32>§harness: Option<String>The producer to read rows of; see StepRow::harness.
session: Option<String>The session to read rows of, matched exactly.
Implementations§
Source§impl ReadRequest
impl ReadRequest
Sourcepub fn with_limit(self, limit: u32) -> Self
pub fn with_limit(self, limit: u32) -> Self
Asks for at most limit rows.
Sourcepub fn for_session(
self,
harness: impl Into<String>,
session: impl Into<String>,
) -> Self
pub fn for_session( self, harness: impl Into<String>, session: impl Into<String>, ) -> Self
Reads only the rows whose harness and session are these.
Sourcepub fn check_pairing(&self) -> Result<(), &'static str>
pub fn check_pairing(&self) -> Result<(), &'static str>
Reports a request naming only one of harness and session. The
pair comes together or not at all; the provider refuses a request that
names one alone invalid_request. Both together and neither are fine.