pub struct CacheManifestBuilder { /* private fields */ }Expand description
Fluent builder for a CacheManifest.
new stamps the boilerplate the broker owns — media type,
schema version, host identity, created/last-active timestamps — leaving the
consumer to declare only what is theirs: the cache roots and broker
instance. build seals the self_sha256 digest;
publish writes it into the central registry.
Implementations§
Source§impl CacheManifestBuilder
impl CacheManifestBuilder
Sourcepub fn new(
service_name: impl Into<String>,
service_version: impl Into<String>,
) -> Self
pub fn new( service_name: impl Into<String>, service_version: impl Into<String>, ) -> Self
Begin a manifest for service_name at service_version.
Sourcepub fn broker_instance(self, instance: impl Into<String>) -> Self
pub fn broker_instance(self, instance: impl Into<String>) -> Self
Set the broker instance label (e.g. "shared" or an explicit-instance
trust group).
Sourcepub fn root(self, kind: CacheRootKind, path: impl Into<String>) -> Self
pub fn root(self, kind: CacheRootKind, path: impl Into<String>) -> Self
Append one cache root of the given kind at path.
Sourcepub fn build(self) -> Result<CacheManifest, ManifestError>
pub fn build(self) -> Result<CacheManifest, ManifestError>
Seal the manifest by computing its self_sha256 digest and return it
without persisting.
Sourcepub fn publish(self) -> Result<PathBuf, ManifestError>
pub fn publish(self) -> Result<PathBuf, ManifestError>
Seal and write the manifest atomically into the central registry, returning the written path.
Sourcepub fn publish_in(self, registry_dir: &Path) -> Result<PathBuf, ManifestError>
pub fn publish_in(self, registry_dir: &Path) -> Result<PathBuf, ManifestError>
Seal and write into an explicit registry dir (tests, custom layouts).
Trait Implementations§
Source§impl Clone for CacheManifestBuilder
impl Clone for CacheManifestBuilder
Source§fn clone(&self) -> CacheManifestBuilder
fn clone(&self) -> CacheManifestBuilder
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for CacheManifestBuilder
impl RefUnwindSafe for CacheManifestBuilder
impl Send for CacheManifestBuilder
impl Sync for CacheManifestBuilder
impl Unpin for CacheManifestBuilder
impl UnsafeUnpin for CacheManifestBuilder
impl UnwindSafe for CacheManifestBuilder
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<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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