Skip to main content

UpdateStore

Struct UpdateStore 

Source
pub struct UpdateStore { /* private fields */ }
Expand description

Local filesystem update store managing staging/, blobs/sha256/, releases/, channels/, and state/.

Implementations§

Source§

impl UpdateStore

Atomic local filesystem storage, staging, monotonic publishing, rollback, and status operations on UpdateStore.

Source

pub fn init_layout(&self) -> Result<()>

Initializes all required local filesystem store directories (staging/, blobs/sha256/, releases/, channels/, state/events/).

§Returns
  • io::Result<()> - Directory creation outcome.
Source

pub fn blob_path(&self, sha256: &str) -> Result<PathBuf>

Returns the canonical path for an immutable blob in blobs/sha256/<sha256>.

§Arguments
  • &str - 64-character lowercase SHA-256 hex digest.
§Returns
  • io::Result<PathBuf> - Validated blob path inside the store.
Source

pub fn stage_release( &self, project: &str, channel: &str, stage_id: &str, manifest: &ReleaseManifest, blobs_dir: &Path, ) -> Result<StageReport>

Stages a draft release manifest and its referenced blobs into staging/<stage_id>/ after verifying SHA-256 integrity.

§Arguments
  • &str - Logical project identifier.
  • &str - Channel name.
  • &str - Unique staging directory name.
  • &ReleaseManifest - Draft release manifest describing artifacts and routes.
  • &Path - Directory containing source blobs named <sha256> or <module_id>@<version>.
§Returns
  • io::Result<StageReport> - Staging verification summary.
Source

pub fn publish_stage( &self, project: &str, channel: &str, stage_id: &str, signing_key: &[u8], ) -> Result<PublishReport>

Publishes a previously staged release atomically with monotonic sequencing, signing, and event log append.

§Arguments
  • &str - Logical project identifier.
  • &str - Release channel name.
  • &str - Staged directory name inside staging/.
  • &[u8] - Offline signing secret key bytes (never persisted in server config or store).
§Returns
  • io::Result<PublishReport> - Atomic publish summary.
Source

pub fn publish_direct( &self, manifest: ReleaseManifest, blobs: &BTreeMap<String, Vec<u8>>, signing_key: &[u8], ) -> Result<PublishReport>

Atomically verifies, promotes blobs, signs with a strictly monotonic sequence, swaps the channel pointer, and records an event.

§Arguments
  • ReleaseManifest - Target release manifest.
  • &BTreeMap<String, Vec<u8>> - Raw blob bytes keyed by SHA-256 hex digest (may omit blobs already stored).
  • &[u8] - Signing secret key bytes.
§Returns
  • io::Result<PublishReport> - Atomic publish summary.
Source

pub fn rollback_release( &self, project: &str, channel: &str, target_release_seq: u64, signing_key: &[u8], ) -> Result<PublishReport>

Executes a monotonic rollback by signing a NEW release sequence pointing back to target_release_seq’s blobs (Sec 11.3).

§Arguments
  • &str - Logical project identifier.
  • &str - Release channel name.
  • u64 - Historical release sequence whose blobs and route graphs should be restored.
  • &[u8] - Offline signing secret key bytes.
§Returns
  • io::Result<PublishReport> - Report containing the NEW monotonic to_release and rollback_of.
Source

pub fn read_channel_pointer( &self, project: &str, channel: &str, ) -> Result<Option<ChannelPointer>>

Reads the active channel pointer for (project, channel) if published.

§Arguments
  • &str - Project identifier.
  • &str - Channel name.
§Returns
  • io::Result<Option<ChannelPointer>> - Active pointer or None.
Source

pub fn read_release_manifest( &self, project: &str, channel: &str, release_seq: u64, ) -> Result<Option<ReleaseManifest>>

Reads an immutable signed release manifest for (project, channel, release_seq).

§Arguments
  • &str - Project identifier.
  • &str - Channel name.
  • u64 - Release sequence number.
§Returns
  • io::Result<Option<ReleaseManifest>> - Signed manifest or None.
Source

pub fn read_compatible_manifest( &self, project: &str, channel: &str, negotiation: &ClientNegotiation, ) -> Result<Result<ReleaseManifest, String>>

Negotiates and selects a compatible signed manifest for (project, channel) matching protocol, ABI, delivery mode, and optional track.

§Arguments
  • &str - Project identifier.
  • &str - Channel name.
  • &ClientNegotiation - Client compatibility declaration.
§Returns
  • io::Result<Result<ReleaseManifest, String>> - Compatible manifest, incompatibility reason, or I/O error.
Source

pub fn read_blob(&self, sha256: &str) -> Result<Option<Vec<u8>>>

Reads an immutable content-addressed blob by its validated SHA-256 digest.

§Arguments
  • &str - 64-character lowercase SHA-256 hex digest.
§Returns
  • io::Result<Option<Vec<u8>>> - Blob bytes if present, or None.
Source

pub fn read_events_after( &self, project: &str, channel: &str, after_event_id: u64, ) -> Result<Vec<StoredReleaseEvent>>

Reads bounded persisted release events strictly newer than after_event_id.

§Arguments
  • &str - Project identifier.
  • &str - Channel name.
  • u64 - Exclusive cursor (0 returns all retained events).
§Returns
  • io::Result<Vec<StoredReleaseEvent>> - Ordered release events newer than after_event_id.
Source

pub fn list_active_pointers(&self) -> Result<Vec<ChannelPointer>>

Lists all active ChannelPointer records currently persisted beneath channels/.

§Returns
  • io::Result<Vec<ChannelPointer>> - All active pointers in deterministic order.
Source

pub fn status( &self, project_filter: Option<&str>, channel_filter: Option<&str>, ) -> Result<UpdateStoreStatus>

Collects a structured status report across all blobs and channels (optionally filtered).

§Arguments
  • Option<&str> - Optional project filter.
  • Option<&str> - Optional channel filter.
§Returns
  • io::Result<UpdateStoreStatus> - Complete store status summary.
Source§

impl UpdateStore

Source

pub fn get_root(&self) -> &PathBuf

Source

pub fn get_mut_root(&mut self) -> &mut PathBuf

Source

pub fn set_root(&mut self, val: PathBuf) -> &mut Self

Source

pub fn get_max_artifact_bytes(&self) -> u64

Source

pub fn get_mut_max_artifact_bytes(&mut self) -> &mut u64

Source

pub fn set_max_artifact_bytes(&mut self, val: u64) -> &mut Self

Source§

impl UpdateStore

Source

pub fn new(root: PathBuf) -> Self

Trait Implementations§

Source§

impl Clone for UpdateStore

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 Debug for UpdateStore

Source§

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

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

impl Eq for UpdateStore

Source§

impl PartialEq for UpdateStore

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for UpdateStore

Auto Trait Implementations§

§

impl Forget for UpdateStore

§

impl Freeze for UpdateStore
where *const u8 is !null: Freeze, PhantomData<u8>: Freeze,

§

impl Move for UpdateStore

§

impl RefUnwindSafe for UpdateStore

§

impl Send for UpdateStore
where RawVecInner: Send,

§

impl Sync for UpdateStore
where RawVecInner: Sync,

§

impl Unpin for UpdateStore
where *const u8 is !null: Unpin,

§

impl UnsafeUnpin for UpdateStore

§

impl UnwindSafe for UpdateStore
where RawVecInner: 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> AnySend for T
where T: Any + Send,

Source§

impl<T> AnySendClone for T
where T: Any + Send + Clone,

Source§

impl<T> AnySendSync for T
where T: Any + Send + Sync,

Source§

impl<T> AnySendSyncClone for T
where T: Any + Send + Sync + Clone,

Source§

impl<T> AnySync for T
where T: Any + Sync,

Source§

impl<T> AnySyncClone for T
where T: Any + Sync + Clone,

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<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<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<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<'a, T> FromIn<'a, T> for T

Source§

fn from_in(t: T, _: &'a Allocator) -> T

Converts to this type from the input type within the given allocator.
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<'a, T, U> IntoIn<'a, U> for T
where U: FromIn<'a, T>,

Source§

fn into_in(self, allocator: &'a Allocator) -> U

Converts this type into the (usually inferred) input type within the given allocator.
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> 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> 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