Skip to main content

ExpandedDocument

Struct ExpandedDocument 

Source
pub struct ExpandedDocument<T = IriBuf, B = BlankIdBuf> { /* private fields */ }
Expand description

Result of the document expansion algorithm: a set of (indexed) objects.

Objects are kept in insertion order, and deduplicated through an index of discriminant buckets (shallow per-object keys) rather than by hashing each object in full.

Implementations§

Source§

impl<T, B> ExpandedDocument<T, B>

Source

pub fn new() -> Self

Creates a new ExpandedDocument.

Source

pub fn with_capacity(capacity: usize) -> Self

Creates a new ExpandedDocument with room for capacity objects.

Worth reaching for whenever the object count is known up front: growing the set re-hashes every object already in it, and hashing an object walks its whole subtree.

Source

pub fn len(&self) -> usize

Returns the number of top-level objects in the document.

Source

pub fn is_empty(&self) -> bool

Checks whether the document has no top-level objects.

Source

pub fn objects(&self) -> &[IndexedObject<T, B>] ⓘ

Returns the top-level objects of the document, in insertion order.

Source

pub fn into_objects(self) -> Vec<IndexedObject<T, B>> ⓘ

Consumes the document, returning its top-level objects in insertion order.

Source

pub fn iter(&self) -> Iter<'_, IndexedObject<T, B>> ⓘ

Returns an iterator over the top-level objects of the document, in insertion order.

Source

pub fn traverse(&self) -> Traverse<'_, T, B> ⓘ

Returns an iterator that visits every fragment of the document: each top-level object and, recursively, everything it contains.

Source

pub fn count(&self, f: impl FnMut(&FragmentRef<'_, T, B>) -> bool) -> usize

Counts the fragments of the document matching the given predicate.

Source

pub fn identify_all_with<V: VocabularyMut<Iri = T, BlankId = B>, G: LocalGenerator>( &mut self, vocabulary: &mut V, generator: &mut G, ) -> Result<(), GeneratedIdError>
where T: Eq + Hash, B: Eq + Hash,

Gives an identifier (@id) to every node, using the given generator to create fresh identifiers for anonymous nodes.

§Errors

Returns an error when the generator runs out of identifiers.

Source

pub fn identify_all<G: LocalGenerator>( &mut self, generator: &mut G, ) -> Result<(), GeneratedIdError>
where T: Eq + Hash, B: Eq + Hash, (): Vocabulary<Iri = T, BlankId = B>,

Gives an identifier (@id) to every node, using the given generator to create fresh identifiers for anonymous nodes.

§Errors

Returns an error when the generator runs out of identifiers.

Source

pub fn relabel_and_canonicalize_with<V: VocabularyMut<Iri = T, BlankId = B>, G: LocalGenerator>( &mut self, vocabulary: &mut V, generator: &mut G, ) -> Result<(), GeneratedIdError>
where T: Clone + Eq + Hash, B: Clone + Eq + Hash,

Relabels every node identifier with a fresh one from the given generator and puts every literal into canonical form.

§Errors

Returns an error when the generator runs out of identifiers.

Source

pub fn relabel_and_canonicalize<G: LocalGenerator>( &mut self, generator: &mut G, ) -> Result<(), GeneratedIdError>
where T: Clone + Eq + Hash, B: Clone + Eq + Hash, (): Vocabulary<Iri = T, BlankId = B>,

Relabels every node identifier with a fresh one from the given generator and puts every literal into canonical form.

§Errors

Returns an error when the generator runs out of identifiers.

Source

pub fn relabel_with<V: VocabularyMut<Iri = T, BlankId = B>, G: LocalGenerator>( &mut self, vocabulary: &mut V, generator: &mut G, ) -> Result<(), GeneratedIdError>
where T: Clone + Eq + Hash, B: Clone + Eq + Hash,

Relabels every node identifier with a fresh one from the given generator.

§Errors

Returns an error when the generator runs out of identifiers.

Source

pub fn relabel<G: LocalGenerator>( &mut self, generator: &mut G, ) -> Result<(), GeneratedIdError>
where T: Clone + Eq + Hash, B: Clone + Eq + Hash, (): Vocabulary<Iri = T, BlankId = B>,

Relabels every node identifier with a fresh one from the given generator.

§Errors

Returns an error when the generator runs out of identifiers.

Source

pub fn canonicalize_with(&mut self, buffer: &mut Buffer)
where T: Eq + Hash, B: Eq + Hash,

Puts every literal of the document into canonical form, using the given buffer to render numbers.

Source

pub fn canonicalize(&mut self)
where T: Eq + Hash, B: Eq + Hash,

Puts every literal of the document into canonical form.

Source

pub fn map_ids<U, C>( self, map_iri: impl FnMut(T) -> U, map_id: impl FnMut(Id<T, B>) -> Id<U, C>, ) -> ExpandedDocument<U, C>
where U: Eq + Hash, C: Eq + Hash,

Rewrites every IRI and identifier of the document (recursively) with the given functions.

Source

pub fn blank_ids(&self) -> HashSet<&B>
where B: Eq + Hash,

Returns the set of all blank identifiers in the given document.

Source

pub fn main_node(&self) -> Option<&Node<T, B>>

Returns the main node object of the document, if any.

The main node is the unique top level (root) node object. If multiple node objects are on the root, None is returned.

Source

pub fn into_main_node(self) -> Option<Node<T, B>>

Consumes the document and returns its main node object, if any.

The main node is the unique top level (root) node object. If multiple node objects are on the root, None is returned.

Source§

impl<T: Hash + Eq, B: Hash + Eq> ExpandedDocument<T, B>

Source

pub fn insert(&mut self, object: IndexedObject<T, B>) -> bool

Inserts an object, unless an equal one is already present.

Returns true if the object was added.

Source

pub fn contains(&self, object: &IndexedObject<T, B>) -> bool

Checks whether an equal object is present.

Source§

impl<T: Eq + Hash, B: Eq + Hash> ExpandedDocument<T, B>

Source

pub fn try_from_json_slice_in( vocabulary: &mut impl VocabularyMut<Iri = T, BlankId = B>, bytes: &[u8], ) -> Result<Self, ExpandedJsonTextError>

Reads a document already in expanded form from its JSON text, without running the Expansion algorithm: the bytes are parsed with jstrict’s non-recursive parser and read with TryFromJson. The parsed tree is consumed by the reading, so no JSON tree outlives the call.

§Errors

ExpandedJsonTextError::Syntax when bytes is not JSON, and ExpandedJsonTextError::Invalid for a JSON text that is not expanded JSON-LD.

Source§

impl<T, B> ExpandedDocument<T, B>

Source

pub fn into_serde_json_with<N>(self, vocabulary: &N) -> Value
where N: Vocabulary<Iri = T, BlankId = B>,

Available on crate feature serde-json only.

Converts the expanded document into a serde_json::Value using the given vocabulary.

Source§

impl<T, B> ExpandedDocument<T, B>
where (): Vocabulary<Iri = T, BlankId = B>,

Source

pub fn into_serde_json(self) -> Value

Available on crate feature serde-json only.

Converts the expanded document into a serde_json::Value using the default no-vocabulary.

Source§

impl<T, B> ExpandedDocument<T, B>

Source

pub fn into_sonic_rs_with<N>(self, vocabulary: &N) -> Value
where N: Vocabulary<Iri = T, BlankId = B>,

Available on crate feature sonic-rs only.

Converts the expanded document into a sonic_rs::Value using the given vocabulary.

Source§

impl<T, B> ExpandedDocument<T, B>
where (): Vocabulary<Iri = T, BlankId = B>,

Source

pub fn into_sonic_rs(self) -> Value

Available on crate feature sonic-rs only.

Converts the expanded document into a sonic_rs::Value using the default no-vocabulary.

Source§

impl<T: Clone + Eq + Hash, B: Clone + Eq + Hash> ExpandedDocument<T, B>

Source

pub fn generate_node_map_with<V: VocabularyMut<Iri = T, BlankId = B>, G: LocalGenerator>( &self, vocabulary: &mut V, generator: G, ) -> Result<NodeMap<T, B>, NodeMapError<T, B>>

Builds the node map of this document using the given vocabulary and blank node generator.

§Errors

Returns an error when the generator runs out of identifiers, or when two nodes disagree on an @index.

Source§

impl<I, B> ExpandedDocument<I, B>

Source

pub fn from_interpreted_quads_in<'a, V, T>( vocabulary: &V, interpretation: &T, quads: impl IntoIterator<Item = Quad<&'a T::Resource, &'a T::Resource, &'a T::Resource, &'a T::Resource>>, context: Context<'_, T>, ) -> Result<Self, SerializationError>
where V: Vocabulary<Iri = I, BlankId = B>, T: ReverseTermInterpretation<Iri = I, BlankId = B, Literal = V::Literal> + ReverseInterpretation, T::Resource: 'a + Ord + Hash, I: Clone + Eq + Hash, B: Clone + Eq + Hash,

Builds a document from interpreted RDF quads, using the given vocabulary and interpretation.

§Errors

Returns an error when the dataset cannot be expressed as JSON-LD, for instance a literal whose datatype has no IRI in the vocabulary.

Source

pub fn from_interpreted_quads<'a, V, T>( vocabulary: &V, interpretation: &T, quads: impl IntoIterator<Item = Quad<&'a T::Resource, &'a T::Resource, &'a T::Resource, &'a T::Resource>>, ) -> Result<Self, SerializationError>
where V: Vocabulary<Iri = I, BlankId = B>, T: ReverseTermInterpretation<Iri = I, BlankId = B, Literal = V::Literal> + ReverseInterpretation, T::Resource: 'a + Ord + Hash, I: Clone + Eq + Hash, B: Clone + Eq + Hash,

Builds a document from interpreted RDF quads.

§Errors

Returns an error when the dataset cannot be expressed as JSON-LD.

Trait Implementations§

Source§

impl<I, B> Borrow<ExpandedDocument<I, B>> for Document<I, B>

Source§

fn borrow(&self) -> &ExpandedDocument<I, B>

Immutably borrows from an owned value. Read more
Source§

impl<T: Clone, B: Clone> Clone for ExpandedDocument<T, B>

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<T: Debug, B: Debug> Debug for ExpandedDocument<T, B>

Source§

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

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

impl<T, B> Default for ExpandedDocument<T, B>

Source§

fn default() -> Self

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

impl<T: Eq + Hash, B: Eq + Hash> Eq for ExpandedDocument<T, B>

Source§

impl<T: Hash + Eq, B: Hash + Eq> Extend<Indexed<Object<T, B>>> for ExpandedDocument<T, B>

Source§

fn extend<I: IntoIterator<Item = IndexedObject<T, B>>>(&mut self, iter: I)

Extends a collection with the contents of an iterator. Read more
Source§

fn extend_one(&mut self, item: T)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
Source§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
Source§

impl<I: Clone + Eq + Hash, B: Clone + Eq + Hash> Flatten<I, B> for ExpandedDocument<I, B>

Source§

fn flatten_with<V, G: LocalGenerator>( self, vocabulary: &mut V, generator: G, ordered: bool, ) -> FlattenResult<I, B>
where V: Vocabulary<Iri = I, BlankId = B> + VocabularyMut,

Flattens this document using the given vocabulary and blank node generator. Read more
Source§

fn flatten_unordered_with<V, G: LocalGenerator>( self, vocabulary: &mut V, generator: G, ) -> FlattenUnorderedResult<I, B>
where V: Vocabulary<Iri = I, BlankId = B> + VocabularyMut,

Flattens this document into an unordered set, using the given vocabulary and generator. Read more
Source§

fn flatten<G: LocalGenerator>( self, generator: G, ordered: bool, ) -> FlattenResult<I, B>
where (): Vocabulary<Iri = I, BlankId = B>, Self: Sized,

Flattens this document, sorting the result when ordered is set. Read more
Source§

fn flatten_unordered<G: LocalGenerator>( self, generator: G, ) -> FlattenUnorderedResult<I, B>
where (): Vocabulary<Iri = I, BlankId = B>, Self: Sized,

Flattens this document into an unordered set. Read more
Source§

impl<T: Hash + Eq, B: Hash + Eq> From<IndexSet<Indexed<Object<T, B>>, GxBuildHasher>> for ExpandedDocument<T, B>

Source§

fn from(set: IndexSet<IndexedObject<T, B>>) -> Self

Converts to this type from the input type.
Source§

impl<T: Eq + Hash, B: Eq + Hash> From<Indexed<Node<T, B>>> for ExpandedDocument<T, B>

Source§

fn from(value: Indexed<Node<T, B>>) -> Self

Converts to this type from the input type.
Source§

impl<T: Hash + Eq, B: Hash + Eq> From<Vec<Indexed<Object<T, B>>>> for ExpandedDocument<T, B>

Source§

fn from(items: Vec<IndexedObject<T, B>>) -> Self

Converts to this type from the input type.
Source§

impl<T: Hash + Eq, B: Hash + Eq> FromIterator<Indexed<Object<T, B>>> for ExpandedDocument<T, B>

Source§

fn from_iter<I: IntoIterator<Item = IndexedObject<T, B>>>(iter: I) -> Self

Creates a value from an iterator. Read more
Source§

impl<T, B> IntoIterator for ExpandedDocument<T, B>

Source§

type IntoIter = IntoIter<T, B>

Which kind of iterator are we turning this into?
Source§

type Item = Indexed<Object<T, B>>

The type of the elements being iterated over.
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
Source§

impl<'a, T, B> IntoIterator for &'a ExpandedDocument<T, B>

Source§

type IntoIter = Iter<'a, Indexed<Object<T, B>>>

Which kind of iterator are we turning this into?
Source§

type Item = &'a Indexed<Object<T, B>>

The type of the elements being iterated over.
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
Source§

impl<T, B, N: Vocabulary<Iri = T, BlankId = B>> IntoJsonWithContext<N> for ExpandedDocument<T, B>

Source§

fn into_json_with(self, vocabulary: &N) -> Value

Writes the document as expanded JSON-LD: an array of the document’s objects, in insertion order. Recurses once per nesting level on sufficient native stack.

Source§

impl<T, B> LdQuads<T, B> for ExpandedDocument<T, B>

Source§

fn quads(&self) -> Quads<'_, T, B> ⓘ

Returns an iterator over the quads of the document.
Source§

impl<T, B, I: Interpretation> LinkedData<I> for ExpandedDocument<T, B>

Source§

fn visit<S>(&self, visitor: S) -> Result<S::Ok, S::Error>
where S: Visitor<I>,

Visit the RDF dataset represented by this type.
Source§

impl<T, B, I: Interpretation> LinkedDataGraph<I> for ExpandedDocument<T, B>

Source§

fn visit_graph<S>(&self, visitor: S) -> Result<S::Ok, S::Error>
where S: GraphVisitor<I>,

Visits the subjects of the graph represented by this value.
Source§

impl<T: Eq + Hash, B: Eq + Hash> PartialEq for ExpandedDocument<T, B>

Source§

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

Comparison between two expanded documents.

Order-independent, as it was when this was backed by a set: both sides are deduplicated, so equal lengths plus containment one way is enough.

1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl<T, B, N: Vocabulary<Iri = T, BlankId = B>> PrecomputeSizeWithContext<N> for ExpandedDocument<T, B>

Source§

fn contextual_pre_compute_size( &self, vocabulary: &N, options: &Options, sizes: &mut Vec<Size>, ) -> Size

Computes the printed size of this value against context.
Source§

impl<T, B, N: Vocabulary<Iri = T, BlankId = B>> PrintWithContext<N> for ExpandedDocument<T, B>

Source§

fn contextual_fmt_with( &self, vocabulary: &N, f: &mut Formatter<'_>, options: &Options, indent: usize, ) -> Result

Writes the value to f, resolving it against context. Read more
Source§

impl<T, B, N: Vocabulary<Iri = T, BlankId = B>> PrintWithSizeAndContext<N> for ExpandedDocument<T, B>

Source§

fn contextual_fmt_with_size( &self, vocabulary: &N, f: &mut Formatter<'_>, options: &Options, indent: usize, sizes: &[Size], index: &mut usize, ) -> Result

Writes the value to f against context, taking its layout from sizes[*index]. Read more
Source§

impl<T, B> RdfQuads<T, B> for ExpandedDocument<T, B>

Source§

fn rdf_quads_full<'a, V: Vocabulary<Iri = T, BlankId = B>, G: LocalGenerator>( &'a self, vocabulary: &'a mut V, generator: &'a mut G, rdf_direction: Option<RdfDirection>, produce_generalized_rdf: bool, ) -> Quads<'a, V, G> ⓘ

Returns the RDF quads of this document, taking every parameter explicitly.
Source§

fn rdf_quads_with<'a, V: Vocabulary<Iri = T, BlankId = B>, G: LocalGenerator>( &'a self, vocabulary: &'a mut V, generator: &'a mut G, rdf_direction: Option<RdfDirection>, ) -> Quads<'a, V, G> ⓘ

Returns the RDF quads of this document, using the given vocabulary.
Source§

fn rdf_quads<'a, G: LocalGenerator>( &'a self, generator: &'a mut G, rdf_direction: Option<RdfDirection>, ) -> Quads<'a, (), G> ⓘ
where (): Vocabulary<Iri = T, BlankId = B>,

Returns the RDF quads of this document.
Source§

impl<T: Eq + Hash, B: Eq + Hash> TryFromJson<T, B> for ExpandedDocument<T, B>

Source§

fn try_from_json_in( vocabulary: &mut impl VocabularyMut<Iri = T, BlankId = B>, value: Value, ) -> Result<Self, InvalidExpandedJson>

Builds this fragment from a JSON value, interning terms in the given vocabulary. Read more

Auto Trait Implementations§

§

impl<T, B> Freeze for ExpandedDocument<T, B>
where Vec<Indexed<Object<T, B>>>: Freeze,

§

impl<T, B> RefUnwindSafe for ExpandedDocument<T, B>

§

impl<T, B> Send for ExpandedDocument<T, B>
where Vec<Indexed<Object<T, B>>>: Send,

§

impl<T, B> Sync for ExpandedDocument<T, B>
where Vec<Indexed<Object<T, B>>>: Sync,

§

impl<T, B> Unpin for ExpandedDocument<T, B>
where Vec<Indexed<Object<T, B>>>: Unpin,

§

impl<T, B> UnsafeUnpin for ExpandedDocument<T, B>
where Vec<Indexed<Object<T, B>>>: UnsafeUnpin,

§

impl<T, B> UnwindSafe for ExpandedDocument<T, B>
where Vec<Indexed<Object<T, B>>>: UnwindSafe,

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

Source§

fn as_unordered(&self) -> &Unordered<T>

Views this value as an Unordered reference.
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if self is equivalent to key.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, C> FromWithContext<T, C> for T

Source§

fn from_with(value: T, _context: &C) -> T

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, U, C> IntoWithContext<U, C> for T
where U: FromWithContext<T, C>,

Source§

fn into_with(self, context: &C) -> U

Source§

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

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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, C> TryFromWithContext<U, C> for T
where U: IntoWithContext<T, C>,

Source§

type Error = !

Source§

fn try_from_with( value: U, context: &C, ) -> Result<T, <T as TryFromWithContext<U, C>>::Error>

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<T, U, C> TryIntoWithContext<U, C> for T
where U: TryFromWithContext<T, C>,

Source§

type Error = <U as TryFromWithContext<T, C>>::Error

Source§

fn try_into_with( self, context: &C, ) -> Result<U, <T as TryIntoWithContext<U, C>>::Error>

Source§

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

Source§

fn with<C>(&self, context: C) -> Contextual<&T, C>

Source§

fn into_with<C>(self, context: C) -> Contextual<T, C>
where T: Sized,

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