pub trait ContextSource: Send + Sync {
// Required method
fn with_tree(&self, visitor: &mut dyn FnMut(JsonSubtree<'_>));
// Provided methods
fn release(self: Arc<Self>) { ... }
fn secret_paths(&self) -> &[String] { ... }
fn with_tree_and_secrets(
&self,
visitor: &mut dyn FnMut(JsonSubtree<'_>, &[String]),
) { ... }
fn with_secrets(&self, visitor: &mut dyn FnMut(&[String])) { ... }
}Expand description
Shared immutable provider. The callback runs synchronously under the provider’s read guard; no tree borrow or mutable owner can escape it.
Required Methods§
fn with_tree(&self, visitor: &mut dyn FnMut(JsonSubtree<'_>))
Provided Methods§
Sourcefn release(self: Arc<Self>)
fn release(self: Arc<Self>)
Providers with prepaid shared storage release the physical Arc before destroying its allocation bill. Every erased handle calls this hook.
Sourcefn secret_paths(&self) -> &[String]
fn secret_paths(&self) -> &[String]
Absolute schema paths explicitly marked secret by the source owner.
Sourcefn with_tree_and_secrets(
&self,
visitor: &mut dyn FnMut(JsonSubtree<'_>, &[String]),
)
fn with_tree_and_secrets( &self, visitor: &mut dyn FnMut(JsonSubtree<'_>, &[String]), )
Borrow a tree and its policy under the same provider read guard. Switching Live/Frozen sources override this callback; borrows cannot escape the callback or outlive the source’s synchronized state.
fn with_secrets(&self, visitor: &mut dyn FnMut(&[String]))
Trait Implementations§
Source§impl AsRef<dyn ContextSource> for ContextSourceRef
impl AsRef<dyn ContextSource> for ContextSourceRef
Source§fn as_ref(&self) -> &(dyn ContextSource + 'static)
fn as_ref(&self) -> &(dyn ContextSource + 'static)
Converts this type into a shared reference of the (usually inferred) input type.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".