Skip to main content

Revision

Struct Revision 

Source
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: bool

Whether the saved document produces BREP faces. Derived, never user editable.

§geometry_content_hash: String

Hash 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: String

The revision label itself; its database key is (part_id, id).

§label: String

What 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: String

SHA-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.

§shares: Vec<Share>

Customer links to a released instructions revision’s player.

Implementations§

Source§

impl Revision

Source

pub fn draft( id: String, label: String, created_by: String, stamp: Timestamp, ) -> Self

A new, empty draft.

Source

pub fn review(&self) -> Option<&Review>

The current review round: the last one, whatever its status.

Source

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.

Source

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.

Source

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 Clone for Revision

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 Revision

Source§

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

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

impl<'de> Deserialize<'de> for Revision

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for Revision

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

§

impl Forget for Revision

§

impl Freeze for Revision

§

impl Move for Revision

§

impl RefUnwindSafe for Revision

§

impl Send for Revision
where RawVecInner: Send, NodeRef<Owned, String, Value, LeafOrInternal>: Send, BoxRaw<(String, Value)>: Send, NodeRef<Owned, String, String, LeafOrInternal>: Send, BoxRaw<(String, String)>: Send,

§

impl Sync for Revision
where RawVecInner: Sync, NodeRef<Owned, String, Value, LeafOrInternal>: Sync, BoxRaw<(String, Value)>: Sync, NodeRef<Owned, String, String, LeafOrInternal>: Sync, BoxRaw<(String, String)>: Sync,

§

impl Unpin for Revision
where *const u8 is !null: Unpin, *const LeafNode<String, Value> is !null: Unpin, Box<(String, Value)>: Unpin, *const LeafNode<String, String> is !null: Unpin, Box<(String, String)>: Unpin,

§

impl UnsafeUnpin for Revision

§

impl UnwindSafe for Revision

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> 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<T> Conv for T

Source§

fn conv<T>(self) -> T
where Self: Into<T>,

Converts self into T using Into<T>. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FromRef<T> for T
where T: Clone,

Source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
Source§

impl<A, B, T> HttpServerConnExec<A, B> for T
where B: Body,

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<T> Pipe for T
where T: ?Sized,

Source§

fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> R
where Self: Sized,

Pipes by value. This is generally the method you want to use. Read more
Source§

fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> R
where R: 'a,

Borrows self and passes that borrow into the pipe function. Read more
Source§

fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> R
where R: 'a,

Mutably borrows self and passes that borrow into the pipe function. Read more
Source§

fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
where Self: Borrow<B>, B: 'a + ?Sized, R: 'a,

Borrows self, then passes self.borrow() into the pipe function. Read more
Source§

fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
where Self: BorrowMut<B>, B: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.borrow_mut() into the pipe function. Read more
Source§

fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
where Self: AsRef<U>, U: 'a + ?Sized, R: 'a,

Borrows 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
where Self: AsMut<U>, U: 'a + ?Sized, R: 'a,

Mutably borrows 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
where Self: Deref<Target = T>, T: 'a + ?Sized, R: 'a,

Borrows self, then passes self.deref() into the pipe function.
Source§

fn pipe_deref_mut<'a, T, R>( &'a mut self, func: impl FnOnce(&'a mut T) -> R, ) -> R
where Self: DerefMut<Target = T> + Deref, T: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.deref_mut() into the pipe function.
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> Tap for T

Source§

fn tap(self, func: impl FnOnce(&Self)) -> Self

Immutable access to a value. Read more
Source§

fn tap_mut(self, func: impl FnOnce(&mut Self)) -> Self

Mutable access to a value. Read more
Source§

fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
where Self: Borrow<B>, B: ?Sized,

Immutable access to the Borrow<B> of a value. Read more
Source§

fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
where Self: BorrowMut<B>, B: ?Sized,

Mutable access to the BorrowMut<B> of a value. Read more
Source§

fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
where Self: AsRef<R>, R: ?Sized,

Immutable access to the AsRef<R> view of a value. Read more
Source§

fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
where Self: AsMut<R>, R: ?Sized,

Mutable access to the AsMut<R> view of a value. Read more
Source§

fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
where Self: Deref<Target = T>, T: ?Sized,

Immutable access to the Deref::Target of a value. Read more
Source§

fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
where Self: DerefMut<Target = T> + Deref, T: ?Sized,

Mutable access to the Deref::Target of a value. Read more
Source§

fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self

Calls .tap() only in debug builds, and is erased in release builds.
Source§

fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self

Calls .tap_mut() only in debug builds, and is erased in release builds.
Source§

fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
where Self: Borrow<B>, B: ?Sized,

Calls .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
where Self: BorrowMut<B>, B: ?Sized,

Calls .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
where Self: AsRef<R>, R: ?Sized,

Calls .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
where Self: AsMut<R>, R: ?Sized,

Calls .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
where Self: Deref<Target = T>, T: ?Sized,

Calls .tap_deref() only in debug builds, and is erased in release builds.
Source§

fn tap_deref_mut_dbg<T>(self, func: impl FnOnce(&mut T)) -> Self
where Self: DerefMut<Target = T> + Deref, T: ?Sized,

Calls .tap_deref_mut() only in debug builds, and is erased in release builds.
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> TryConv for T

Source§

fn try_conv<T>(self) -> Result<T, Self::Error>
where Self: TryInto<T>,

Attempts to convert self into T using TryInto<T>. 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<S, T> Upcast<T> for S
where T: UpcastFrom<S> + ?Sized, S: ?Sized,

Source§

fn upcast(&self) -> &T
where Self: ErasableGeneric, T: Sized + ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider ref type within the Wasm bindgen generics type system. Read more
Source§

fn upcast_into(self) -> T
where Self: Sized + ErasableGeneric, T: Sized + ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider type within the Wasm bindgen generics type system. Read more