pub struct MessageQuery {
pub offset: usize,
pub limit: usize,
pub after: Option<u64>,
pub before: Option<u64>,
pub order: MessageOrder,
pub visibility: MessageVisibilityFilter,
pub run_id: Option<String>,
}Expand description
Pagination/filter query for listing messages.
Fields§
§offset: usizeNumber of items to skip.
limit: usizeMaximum number of items to return.
after: Option<u64>Return records with sequence numbers greater than this value.
before: Option<u64>Return records with sequence numbers less than this value.
order: MessageOrderSort order for message sequence numbers.
visibility: MessageVisibilityFilterVisibility filter applied before pagination.
run_id: Option<String>Filter by producing run ID.
Implementations§
Source§impl MessageQuery
impl MessageQuery
Sourcepub fn normalized(&self) -> MessageQuery
pub fn normalized(&self) -> MessageQuery
Return a copy with contract-level pagination limits applied.
Sourcepub fn encode_cursor(&self, offset: usize) -> String
pub fn encode_cursor(&self, offset: usize) -> String
Encode an opaque cursor for continuing this exact query.
Sourcepub fn decode_cursor(&self, cursor: &str) -> Result<usize, String>
pub fn decode_cursor(&self, cursor: &str) -> Result<usize, String>
Decode a cursor and verify it belongs to this exact query shape.
Sourcepub fn matches_record(&self, record: &MessageRecord) -> bool
pub fn matches_record(&self, record: &MessageRecord) -> bool
Return true when a record passes the query filters.
Trait Implementations§
Source§impl Clone for MessageQuery
impl Clone for MessageQuery
Source§fn clone(&self) -> MessageQuery
fn clone(&self) -> MessageQuery
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MessageQuery
impl Debug for MessageQuery
Source§impl Default for MessageQuery
impl Default for MessageQuery
Source§fn default() -> MessageQuery
fn default() -> MessageQuery
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for MessageQuery
impl<'de> Deserialize<'de> for MessageQuery
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<MessageQuery, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<MessageQuery, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for MessageQuery
Source§impl PartialEq for MessageQuery
impl PartialEq for MessageQuery
Source§fn eq(&self, other: &MessageQuery) -> bool
fn eq(&self, other: &MessageQuery) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for MessageQuery
impl Serialize for MessageQuery
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for MessageQuery
Auto Trait Implementations§
impl Freeze for MessageQuery
impl RefUnwindSafe for MessageQuery
impl Send for MessageQuery
impl Sync for MessageQuery
impl Unpin for MessageQuery
impl UnsafeUnpin for MessageQuery
impl UnwindSafe for MessageQuery
Blanket Implementations§
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.