Skip to main content

ResolverRead

Struct ResolverRead 

Source
pub struct ResolverRead(/* private fields */);
Expand description

Client for querying the resolver server (read operations).

Used by subscribers to resolve paths to publisher addresses, list published paths, and query the namespace structure. Handles referrals and cluster topology automatically.

Implementations§

Source§

impl ResolverRead

Source

pub fn new(default: Config, desired_auth: DesiredAuth) -> Self

Source

pub async fn send( &self, batch: &GPooled<Vec<ToRead>>, ) -> Result<(GPooled<IntMap<PublisherId, Publisher>>, GPooled<Vec<FromRead>>)>

Send the specified messages to the resolver and return answers in send order.

Source

pub async fn resolve<I>( &self, batch: I, ) -> Result<(GPooled<IntMap<PublisherId, Publisher>>, GPooled<Vec<Resolved>>)>
where I: IntoIterator<Item = Path>,

Resolve the specified paths to publisher addresses.

Results are in send order.

Source

pub async fn list(&self, path: Path) -> Result<GPooled<Vec<Path>>>

List immediate children of the specified path.

Order is unspecified.

Source

pub async fn list_matching( &self, globset: &GlobSet, ) -> Result<GPooled<Vec<GPooled<Vec<Path>>>>>

List all paths in the cluster matching the specified globset.

Returns a list of batches of paths. If your globset is configured to match only published paths, then the batches should be disjoint, otherwise there may be some duplicate structural elements.

Source

pub async fn check_changed(&self, tracker: &mut ChangeTracker) -> Result<bool>

Check whether there have been any changes under the specified path.

This checks all servers in the resolver cluster. A change in this context consists of:

  • A new publisher publishing an existing path
  • A publisher publishing a new path
  • A publisher no longer publishing a path

Changes to the value of already published paths is not a change in this context.

This method is meant to be used as a light alternative to list, or list_matching in order to discover when structural changes are made by publishers that result in the need to adjust subscriptions. It is much cheaper and faster to call this method than list or list_matching.

The first call with a new ChangeTracker will always result in true. If true is returned at any point it is not a guarantee that there were changes, but it is a strong possibility. If false is returned it is guaranteed that there was no change.

Source

pub async fn table(&self, path: Path) -> Result<Table>

Interpret path as a table and return it’s description.

The contents of the resolver server is a tree, however a tree’s structure can describe a table if at a single level multiple paths are published that share common children. Then each level 1 path is a row, and the common children are the columns.

§Example
/table/a/1
/table/a/2
/table/b/1
/table/b/2

is a table with two rows, a and b, and two columns 1 and 2.

Trait Implementations§

Source§

impl Clone for ResolverRead

Source§

fn clone(&self) -> ResolverRead

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 ResolverRead

Source§

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

Formats the value using the given formatter. Read more

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<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

Source§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

Source§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

Source§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> 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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.