pub struct Revision {Show 25 fields
pub has_geometry: bool,
pub geometry_content_hash: String,
pub attributes: BTreeMap<String, Value>,
pub attributes_initialized: bool,
pub occurrences: Vec<Occurrence>,
pub id: String,
pub label: String,
pub lifecycle: Lifecycle,
pub origin: Origin,
pub content_hash: String,
pub size: u64,
pub lock: Option<Lock>,
pub created_by: String,
pub created_at: Timestamp,
pub modified_at: Timestamp,
pub released_by: Option<String>,
pub released_at: Option<Timestamp>,
pub family: Option<FamilyStamp>,
pub template: Option<TemplateStamp>,
pub bake: Option<Bake>,
pub uses: Vec<Use>,
pub reviews: Vec<Review>,
pub comments: Vec<Comment>,
pub attachments: Vec<Attachment>,
pub thumbnail: Option<Thumbnail>,
}Expand description
One revision of a part: the released unit of engineering intent, and the thing a CAD document hangs off.
Fields§
§has_geometry: boolWhether the saved document produces BREP faces. Derived, never user editable.
geometry_content_hash: StringHash of the document used to derive geometry metadata.
attributes: BTreeMap<String, Value>Values defined by this part’s numbered PLM type, owned by this revision.
attributes_initialized: bool§occurrences: Vec<Occurrence>Individual placements, identified by their CAD feature ids.
id: StringThe revision label itself; its database key is (part_id, id).
label: StringWhat people call it. FREE TEXT: whoever creates the revision may type it,
and the store enforces only that it is unique within its part. A, B, C
from crate::lifecycle::next_revision_label is the suggestion when
nobody types one. Revisions are ordered by creation — their position in
Part::revisions — never by label.
lifecycle: Lifecycle§origin: Origin§content_hash: StringSHA-256 of the document as last written, so a client can detect drift without fetching the payload. Empty until something is written.
size: u64§lock: Option<Lock>None when nobody has it checked out.
created_by: String§created_at: Timestamp§modified_at: Timestamp§released_by: Option<String>§released_at: Option<Timestamp>§family: Option<FamilyStamp>Set on a family member’s revision by Generate: which family row made
it, and the fingerprints the next Generate compares to skip an
unchanged row. None for anything a family did not write.
template: Option<TemplateStamp>Set on the first revision of a part spun out of a template.
bake: Option<Bake>The bake this revision’s document is waiting for, or had. None for
a document nothing asked to be baked.
uses: Vec<Use>What this revision is built from: the “uses” list the CAD app publishes on save and release (round 1). The server never reads geometry — this list IS the assembly structure, and the BOM, where-used and the release gate are all computed from it. Frozen with the document once the revision is released.
reviews: Vec<Review>Every review this revision has been through, oldest first: the last
one is the current round (Review). A revision is reviewed where it
lives, so a review costs what its part costs to write.
comments: Vec<Comment>The discussion on this revision, oldest first; a reply names the comment it answers. Anyone who can read the part reads it.
attachments: Vec<Attachment>Files that belong to THIS revision — its drawing, its test report. Frozen with the revision at release, like its document; a new revision starts with the same references (the files are shared, not copied).
thumbnail: Option<Thumbnail>A picture of the document, made and uploaded by a CAD client or the
bake worker (the server never renders). It describes the document
whose hash it carries: once the document changes it is stale, and
crate::thumbnail::current no longer serves it.
Implementations§
Source§impl Revision
impl Revision
Sourcepub fn draft(
id: String,
label: String,
created_by: String,
stamp: Timestamp,
) -> Self
pub fn draft( id: String, label: String, created_by: String, stamp: Timestamp, ) -> Self
A new, empty draft.
Sourcepub fn review(&self) -> Option<&Review>
pub fn review(&self) -> Option<&Review>
The current review round: the last one, whatever its status.
Sourcepub fn live_review_mut(&mut self) -> Option<&mut Review>
pub fn live_review_mut(&mut self) -> Option<&mut Review>
The current review round, if it is still undecided or approved — the one a decision or a release acts on.
Sourcepub fn needs_bake(&self) -> bool
pub fn needs_bake(&self) -> bool
The document still waits for a bake — queued, taken, or failed. A revision in this state cannot release: once released its bytes are frozen and the bake could never be written.
Sourcepub fn document_key(&self, part_id: &str) -> String
pub fn document_key(&self, part_id: &str) -> String
The store key this revision’s document lives at — the key the CAD app’s
sourceKey becomes. part/<part id>/rev/<revision id>.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Revision
impl<'de> Deserialize<'de> for Revision
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for Revision
impl RefUnwindSafe for Revision
impl Send for Revision
impl Sync for Revision
impl Unpin for Revision
impl UnsafeUnpin for Revision
impl UnwindSafe for Revision
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> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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 moreSource§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.