pub struct Revision {Show 28 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>,
pub instructs: Option<Instructs>,
pub player: Option<PlayerArtifact>,
pub shares: Vec<Share>,
}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. 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.
instructs: Option<Instructs>An instructions revision’s assembly: derived from the document’s
instructions.target.sourceKey on every write, never set by a
request. None for every other class, and for instructions whose
target is not a PLM revision (a local file).
player: Option<PlayerArtifact>An instructions revision’s player data (crate::player), keyed by
the document it was made from like a thumbnail.
Customer links to a released instructions revision’s player.
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 Forget for Revision
impl Freeze for Revisionwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
*const LeafNode<String, Value> is !null: Freeze,
PhantomData<(Owned, LeafOrInternal)>: Freeze,
PhantomData<Box<(String, Value)>>: Freeze,
PhantomData<Occurrence>: Freeze,
*const LeafNode<String, String> is !null: Freeze,
PhantomData<Box<(String, String)>>: Freeze,
PhantomData<Use>: Freeze,
PhantomData<Review>: Freeze,
PhantomData<Comment>: Freeze,
PhantomData<Attachment>: Freeze,
PhantomData<Share>: Freeze,
impl Move for Revision
impl RefUnwindSafe for Revision
impl Send for Revision
impl Sync for Revision
impl Unpin for Revision
impl UnsafeUnpin for Revisionwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
*const LeafNode<String, Value> is !null: UnsafeUnpin,
PhantomData<(Owned, LeafOrInternal)>: UnsafeUnpin,
PhantomData<Box<(String, Value)>>: UnsafeUnpin,
PhantomData<Occurrence>: UnsafeUnpin,
*const LeafNode<String, String> is !null: UnsafeUnpin,
PhantomData<Box<(String, String)>>: UnsafeUnpin,
PhantomData<Use>: UnsafeUnpin,
PhantomData<Review>: UnsafeUnpin,
PhantomData<Comment>: UnsafeUnpin,
PhantomData<Attachment>: UnsafeUnpin,
PhantomData<Share>: UnsafeUnpin,
impl UnwindSafe for Revisionwhere
RawVecInner: UnwindSafe,
BTreeMap<String, Value>: UnwindSafe,
BTreeMap<String, String>: UnwindSafe,
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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.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.