pub struct RepositoryDescriptor { /* private fields */ }Expand description
The versioned capability descriptor a durable adapter publishes.
Negotiation reads this descriptor before a launch does any durable work, so a requirement the deployed adapter does not declare is rejected up front rather than discovered part-way through an execution. The descriptor is the adapter’s own claim about the deployment it is connected to; it is not derived from the compiled plan and never weakens a declared guarantee.
descriptor_version versions the shape of this declaration. It is distinct
from schema_version, which is the durable metadata schema the adapter is
connected to: a runtime can understand a descriptor whose schema it refuses.
Implementations§
Source§impl RepositoryDescriptor
impl RepositoryDescriptor
Sourcepub const CURRENT_VERSION: u32 = 1
pub const CURRENT_VERSION: u32 = 1
The descriptor shape this runtime publishes and understands.
Sourcepub fn new(
schema_version: u32,
capabilities: impl IntoIterator<Item = RepositoryCapability>,
) -> RepositoryDescriptor
pub fn new( schema_version: u32, capabilities: impl IntoIterator<Item = RepositoryCapability>, ) -> RepositoryDescriptor
Declares the capabilities an adapter connected to schema_version
provides.
A capability that is absent is undeclared, which negotiation treats as unavailable. Declaring nothing is the conservative claim, not a permissive one.
Sourcepub const fn descriptor_version(&self) -> u32
pub const fn descriptor_version(&self) -> u32
Returns the version of this descriptor’s shape.
Sourcepub const fn schema_version(&self) -> u32
pub const fn schema_version(&self) -> u32
Returns the durable metadata schema version the adapter is connected to.
Sourcepub fn declares(&self, capability: RepositoryCapability) -> bool
pub fn declares(&self, capability: RepositoryCapability) -> bool
Reports whether the adapter declared capability.
Sourcepub fn capabilities(&self) -> impl ExactSizeIterator
pub fn capabilities(&self) -> impl ExactSizeIterator
Lists the declared capabilities in a stable order.
Sourcepub fn require(
&self,
capability: RepositoryCapability,
) -> Result<(), RepositoryError>
pub fn require( &self, capability: RepositoryCapability, ) -> Result<(), RepositoryError>
Requires capability, failing with a typed rejection when undeclared.
§Errors
Returns RepositoryError::UnsupportedCapability naming the
requirement. The requirement is never silently downgraded to a weaker
guarantee.
Trait Implementations§
Source§impl Clone for RepositoryDescriptor
impl Clone for RepositoryDescriptor
Source§fn clone(&self) -> RepositoryDescriptor
fn clone(&self) -> RepositoryDescriptor
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RepositoryDescriptor
impl Debug for RepositoryDescriptor
impl Eq for RepositoryDescriptor
Source§impl PartialEq for RepositoryDescriptor
impl PartialEq for RepositoryDescriptor
impl StructuralPartialEq for RepositoryDescriptor
Auto Trait Implementations§
impl Freeze for RepositoryDescriptor
impl RefUnwindSafe for RepositoryDescriptor
impl Send for RepositoryDescriptor
impl Sync for RepositoryDescriptor
impl Unpin for RepositoryDescriptor
impl UnsafeUnpin for RepositoryDescriptor
impl UnwindSafe for RepositoryDescriptor
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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 more