Skip to main content

CatalogueQuery

Struct CatalogueQuery 

Source
pub struct CatalogueQuery {
Show 15 fields pub canonical_route: Option<CanonicalActionRoute>, pub provider: Option<String>, pub app_id: Option<String>, pub view_resource: Option<ViewResourceQuery>, pub parent_resource: Option<String>, pub needle: String, pub resource_name: Option<String>, pub target: Option<ActionAddress>, pub action: Option<String>, pub revision: Option<String>, pub cursor: Vec<u8>, pub max_results: u32, pub limits: Option<CatalogueLimits>, pub by_resource: bool, pub max_resources: Option<u32>,
}
Expand description

One bounded request for catalogue rows. Every field narrows; the empty query lists the first page of everything offered.

Fields§

§canonical_route: Option<CanonicalActionRoute>

Provider-only lookup of one exact route’s owner. Cannot accompany a provider, cursor, target, view lookup, or row filter.

§provider: Option<String>

Only rows from this provider (a token a previous page issued).

§app_id: Option<String>

Only rows published by this application. It narrows the rows a provider builds and pages — before the page bound — while the providers the caller may browse are listed either way.

§view_resource: Option<ViewResourceQuery>

Read-only view discovery, separate from the document action catalogue.

§parent_resource: Option<String>

Only the direct children of this resource; None is the top level for a listing, and every level for a query that names words (Self::needle): a search finds a row wherever in the tree it stands.

§needle: String

Only rows whose labels, ids or parameters contain this text (case-insensitive).

§resource_name: Option<String>

Only resources this names: their kind, or their label ignoring ASCII case, at the top level or, with Self::parent_resource, among that resource’s direct children. A provider answers it whole, wherever the resource would fall in a paged listing; it takes no cursor or needle. A provider from before parents were named answers with top-level rows, whose parent says so.

§target: Option<ActionAddress>

Only this exact action, re-resolved against the provider now: the check to make immediately before invoking a row from an older page.

§action: Option<String>

Only the action with this id, wherever the provider publishes it: the lookup of an action named by its app alone. An agent hears here of one only the person at the publishing device takes (crate::Availability::shown_here), which no listing offers it.

§revision: Option<String>

The revision cursor (or target) was obtained at. A provider refuses a cursor from another revision as stale rather than skipping rows.

§cursor: Vec<u8>

Opaque continuation from the previous page; empty starts over.

§max_results: u32

Upper bound on rows, clamped to MAX_CATALOGUE_PAGE. With no provider named, zero asks only for CataloguePage::providers.

§limits: Option<CatalogueLimits>

Optional upper bounds on the work a provider spends answering.

§by_resource: bool

The rows each resource offers sent as one (CatalogueRow::offered, compact), and a page up to MAX_BY_RESOURCE_PAGE rows long: what a listing of resources asks, which shows each resource’s actions by their ids. Cursors still count the rows each stands for.

§max_resources: Option<u32>

Upper bound on the resources a page holds rows of, as well as on its rows: the page ends after the last row of that many resources. What a caller listing a number of resources asks, so that a provider builds those and not as many rows as it guessed they offer.

Implementations§

Source§

impl CatalogueQuery

Source

pub fn resolve(target: &RemoteActionTarget, revision: impl Into<String>) -> Self

A query that re-resolves exactly target at revision.

Source

pub fn resource_bound(&self) -> Option<usize>

The resources a page may hold rows of (Self::max_resources), at least one: a page always moves the listing on.

Source

pub fn page_size(&self) -> usize

The page size a provider honours for this query.

Source§

impl CatalogueQuery

Source

pub fn admits(&self, row: &CatalogueRow) -> bool

Whether row is one this query lists: under the parent asked for, of the app, view, words, name and action it names. An exact action is found wherever it stands, since its address names it alone, and so is a row whose words hold a needle asked for with no parent named: a search ranges over the whole tree, where a browse names one place.

Source

pub fn offset(&self) -> usize

How many of the rows it admits this query’s cursor is past.

Trait Implementations§

Source§

impl Clone for CatalogueQuery

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for CatalogueQuery

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for CatalogueQuery

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for CatalogueQuery

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Eq for CatalogueQuery

Source§

impl PartialEq for CatalogueQuery

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for CatalogueQuery

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for CatalogueQuery

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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 more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more