pub struct SidecarV1 {Show 26 fields
pub sidecar_schema: u16,
pub crypto_suite_id: u16,
pub uuid: Uuid,
pub hash: Hash32,
pub capture_timestamp: String,
pub capture_timestamp_user: Lww<String>,
pub import_timestamp: String,
pub content_type: String,
pub dimensions: Option<Dimensions>,
pub lqip: Option<Lqip>,
pub tags_user: OrSet<String>,
pub tags_ai: OrSet<AiTag>,
pub caption: Lww<String>,
pub rating: Lww<u8>,
pub stack_membership: Lww<Option<StackMembership>>,
pub regions: Regions,
pub cull: Lww<CullFlag>,
pub hidden: Lww<bool>,
pub camera_id: Option<CameraId>,
pub device_id: Uuid,
pub session_id: Uuid,
pub gps: Option<Gps>,
pub gps_user: Lww<Option<Gps>>,
pub provenance_chain_hash: Option<Hash32>,
pub unknown: BTreeMap<String, Value>,
pub signature: Option<HybridSignature>,
}Expand description
The signed CBOR sidecar v1.
Fields§
§sidecar_schema: u16Schema version — serialized as integer field 0 (sorts first canonically).
crypto_suite_id: u16Matches the asset’s manifest.
uuid: UuidAsset id (UUIDv7).
hash: Hash32Canonical plaintext digest.
capture_timestamp: StringRFC3339 capture time as imported: what the original’s own metadata (or the
exporter’s record it was folded with) said when the asset entered the library. A
user’s correction never overwrites it; it lands in
capture_timestamp_user, and
effective_capture_timestamp is the instant the
asset is dated by.
capture_timestamp_user: Lww<String>The user’s capture-time correction: an LWW register over an RFC3339 instant, written by
Workspace::set_capture_timestamp. Wire-absent when never written, so every sidecar
without a correction encodes byte-identically to before the field existed; an older
reader keeps it verbatim as an unknown key.
import_timestamp: StringRFC3339 import time.
content_type: StringClosed content-type string per protocol version.
dimensions: Option<Dimensions>Pixel dimensions, if known.
lqip: Option<Lqip>Display placeholder.
User tags (OR-set).
AI tags (separate OR-set; cannot overwrite user tags).
caption: Lww<String>Caption LWW register (with superseded log).
rating: Lww<u8>Rating LWW register.
stack_membership: Lww<Option<StackMembership>>Stack membership: an LWW register over Option<StackMembership> so stack
edits (join, move, leave = None) converge order-independently under the
same (ts, device_id) rule as caption/rating — grouping is convergent by
construction, not convention. Wire-absent default = the never-written
register (distinct from an explicit removal, which is a stamped None).
regions: RegionsLabelled image regions: region id (UUIDv7) to its register, a stamped None being a
deleted region (owner: Organization — Labels). Merged by
merge_regions, not as plain LWW. Wire-absent when empty, so
every sidecar without regions encodes byte-identically to before the field existed; an
older reader keeps it verbatim as an unknown key.
cull: Lww<CullFlag>Culling flag: LWW register over the trinary CullFlag. Wire-absent
default = never flagged (Neutral).
Hidden flag: LWW register; hidden assets are excluded from default views (owner: Asset Organization — Hidden Assets). Wire-absent default = visible.
camera_id: Option<CameraId>Camera identifier (export-stripped).
device_id: UuidImporting device id (UUIDv4; export-stripped).
session_id: UuidImporting session id (UUIDv7; export-stripped).
gps: Option<Gps>Geolocation as imported (export-rounded). A user’s location edit never overwrites
it; it lands in gps_user, and
effective_gps is the location the asset is placed at.
gps_user: Lww<Option<Gps>>The user’s location edit: an LWW register over Option<Gps>, written by
Workspace::set_location with GpsSource::Manual. A stamped None is an explicit
“no location”, which hides an as-imported fix without erasing it. Wire-absent when never
written (export-rounded like gps).
provenance_chain_hash: Option<Hash32>The prior provenance head — the record preceding the write that seals this sidecar,
always equal to that write’s manifest prior_provenance_hash (SSoT:
Metadata — Provenance Binding and Sealing Order). Referencing the prior head (not the
sealing write’s own record) keeps the binding well-founded — the manifest commits to this
sidecar’s metadata_blob_hash, so a sidecar referencing that manifest would be a cycle.
Wire-absent (None) exactly on the initial create.
unknown: BTreeMap<String, Value>Unknown CBOR keys preserved verbatim (re-sorted canonically; covered by signature).
signature: Option<HybridSignature>Hybrid signature over every byte above (the canonical map minus this field).
Implementations§
Source§impl SidecarV1
impl SidecarV1
Sourcepub fn effective_capture_timestamp(&self) -> &str
pub fn effective_capture_timestamp(&self) -> &str
The capture instant the asset is dated by: the user’s correction when one was ever
written, else the as-imported capture_timestamp.
Sourcepub fn effective_gps(&self) -> Option<&Gps>
pub fn effective_gps(&self) -> Option<&Gps>
The location the asset is placed at: the user’s edit when one was ever written (a
stamped None meaning “no location”), else the as-imported gps.
Sourcepub fn signing_bytes(&self) -> Vec<u8> ⓘ
pub fn signing_bytes(&self) -> Vec<u8> ⓘ
The canonical bytes the signature covers (everything except signature).
Sourcepub fn to_canonical_vec(&self) -> Vec<u8> ⓘ
pub fn to_canonical_vec(&self) -> Vec<u8> ⓘ
The full canonical CBOR encoding (including the signature, if present).
Sourcepub fn sign(&mut self, ik: &HybridSigningKey)
pub fn sign(&mut self, ik: &HybridSigningKey)
Sign the sidecar with the user IK, setting signature.
Sourcepub fn verify(&self, ik_public: &HybridVerifyingKey) -> bool
pub fn verify(&self, ik_public: &HybridVerifyingKey) -> bool
Verify the sidecar’s signature against the user IK public key.
Sourcepub fn max_add_counter_for(&self, device: &Uuid) -> Option<u64>
pub fn max_add_counter_for(&self, device: &Uuid) -> Option<u64>
The highest add_id.counter device has written into any AddId-bearing OR-set of this
sidecar — user tags, AI tags, and every region’s labels, live or deleted — or None if it
wrote none. The floor a restarting device reseeds its counter from.
Sourcepub fn from_canonical_slice(
bytes: &[u8],
max_known: u16,
) -> Result<Self, String>
pub fn from_canonical_slice( bytes: &[u8], max_known: u16, ) -> Result<Self, String>
Decode a sidecar from canonical CBOR bytes, refusing a schema newer than max_known
(Schema Versioning Rules: an old client must not strip-and-resign a newer sidecar).
Trait Implementations§
impl StructuralPartialEq for SidecarV1
Auto Trait Implementations§
impl Freeze for SidecarV1
impl RefUnwindSafe for SidecarV1
impl Send for SidecarV1
impl Sync for SidecarV1
impl Unpin for SidecarV1
impl UnsafeUnpin for SidecarV1
impl UnwindSafe for SidecarV1
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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