pub struct StateListRequest { /* private fields */ }Expand description
Key-ordered namespace list request.
Results use ascending lexicographic UTF-8 key order within one exact namespace. The optional prefix is literal and case-sensitive; the cursor is exclusive. Each page has a consistent read view, but separate pages are not a historical snapshot. The default page size is 100; accepted sizes are 1 through 1000 inclusive.
§Examples
use storage_kit::state::record::{StateKeyPrefix, StateListRequest};
let request = StateListRequest::new("workflow")?
.with_key_prefix(StateKeyPrefix::new("run/")?)
.with_limit(25)?
.start_after("run/10")?;
assert_eq!(request.prefix(), Some("run/"));
assert_eq!(request.start_after_key(), Some("run/10"));Implementations§
Source§impl StateListRequest
impl StateListRequest
Sourcepub const DEFAULT_LIMIT: usize = DEFAULT_LIST_LIMIT
pub const DEFAULT_LIMIT: usize = DEFAULT_LIST_LIMIT
Default page size.
Sourcepub fn new(namespace: impl Into<String>) -> Result<Self, StateStoreError>
pub fn new(namespace: impl Into<String>) -> Result<Self, StateStoreError>
Creates a namespace-scoped request.
The new request has no prefix or cursor and uses Self::DEFAULT_LIMIT.
§Errors
Returns StateStoreError::InvalidRequest when the namespace does not
satisfy StateNamespace::new.
§Examples
use storage_kit::state::record::StateListRequest;
let request = StateListRequest::new("workflow")?;
assert_eq!(request.limit(), StateListRequest::DEFAULT_LIMIT);
assert_eq!(request.start_after_key(), None);Sourcepub fn with_key_prefix(self, prefix: StateKeyPrefix) -> Self
pub fn with_key_prefix(self, prefix: StateKeyPrefix) -> Self
Restricts results to a validated key prefix.
§Examples
use storage_kit::state::record::{StateKeyPrefix, StateListRequest};
let request = StateListRequest::new("workflow")?
.with_key_prefix(StateKeyPrefix::new("run/%")?);
assert_eq!(request.prefix(), Some("run/%"));Sourcepub fn with_limit(self, limit: usize) -> Result<Self, StateStoreError>
pub fn with_limit(self, limit: usize) -> Result<Self, StateStoreError>
Replaces the page size.
§Errors
Returns StateStoreError::InvalidRequest unless limit is between
1 and Self::MAX_LIMIT inclusive.
§Examples
use storage_kit::state::record::StateListRequest;
let request = StateListRequest::new("workflow")?.with_limit(25)?;
assert_eq!(request.limit(), 25);
assert!(StateListRequest::new("workflow")?.with_limit(0).is_err());Sourcepub fn start_after(
self,
cursor: impl Into<String>,
) -> Result<Self, StateStoreError>
pub fn start_after( self, cursor: impl Into<String>, ) -> Result<Self, StateStoreError>
Sets the namespace-local exclusive cursor.
Pass the previous response’s next_start_after unchanged with the same
namespace and prefix. The cursor need not name a record that still exists.
§Errors
Returns StateStoreError::InvalidRequest for an empty cursor, more than
1024 UTF-8 bytes, surrounding whitespace, or a control character.
§Examples
use storage_kit::state::record::StateListRequest;
let request = StateListRequest::new("workflow")?.start_after("run/10")?;
assert_eq!(request.start_after_key(), Some("run/10"));Sourcepub fn namespace(&self) -> &StateNamespace
pub fn namespace(&self) -> &StateNamespace
Returns the namespace.
§Examples
use storage_kit::state::record::StateListRequest;
let request = StateListRequest::new("workflow")?;
assert_eq!(request.namespace().as_str(), "workflow");Sourcepub fn key_prefix(&self) -> Option<&StateKeyPrefix>
pub fn key_prefix(&self) -> Option<&StateKeyPrefix>
Returns the optional typed prefix.
§Examples
use storage_kit::state::record::{StateKeyPrefix, StateListRequest};
let prefix = StateKeyPrefix::new("run/")?;
let request = StateListRequest::new("workflow")?.with_key_prefix(prefix.clone());
assert_eq!(request.key_prefix(), Some(&prefix));Sourcepub fn prefix(&self) -> Option<&str>
pub fn prefix(&self) -> Option<&str>
Returns the optional prefix string.
§Examples
use storage_kit::state::record::StateListRequest;
let request = StateListRequest::new("workflow")?;
assert_eq!(request.prefix(), None);Sourcepub fn limit(&self) -> usize
pub fn limit(&self) -> usize
Returns the page size.
§Examples
use storage_kit::state::record::StateListRequest;
let request = StateListRequest::new("workflow")?.with_limit(12)?;
assert_eq!(request.limit(), 12);Sourcepub fn start_after_key(&self) -> Option<&str>
pub fn start_after_key(&self) -> Option<&str>
Returns the optional cursor.
§Examples
use storage_kit::state::record::StateListRequest;
let request = StateListRequest::new("workflow")?.start_after("run/1")?;
assert_eq!(request.start_after_key(), Some("run/1"));Trait Implementations§
Source§impl Clone for StateListRequest
impl Clone for StateListRequest
Auto Trait Implementations§
impl Freeze for StateListRequest
impl RefUnwindSafe for StateListRequest
impl Send for StateListRequest
impl Sync for StateListRequest
impl Unpin for StateListRequest
impl UnsafeUnpin for StateListRequest
impl UnwindSafe for StateListRequest
Blanket Implementations§
impl<T> Allocation for T
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::RequestSource§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.Source§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.