Skip to main content

DefinitionLifecycleOperation

Struct DefinitionLifecycleOperation 

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

业务作用:把人工 definition 生命周期动作的 CAS、幂等身份与审计原因冻结为一个持久裁决输入。

Implementations§

Source§

impl DefinitionLifecycleOperation

Source

pub fn new( expected_sha256: impl Into<String>, operation_id: impl Into<String>, reason: impl Into<String>, ) -> Result<Self>

业务作用:校验并冻结一次定义生命周期人工动作的摘要及幂等身份。

参数说明:

  • expected_sha256:调用方观察到的定义 seal,必须是 64 位十六进制文本。
  • operation_id:主体范围内的稳定操作幂等键,须非空、无首尾空白或控制字符且不超过 190 字节。
  • reason:需持久记录的人工动作原因,须非空、无首尾空白或控制字符且不超过 512 字节。

返回:合法时返回 seal 已转小写的操作合同,否则返回校验错误;不读取数据库或执行动作。

Source

pub fn for_validated_activation( artifact: &DefinitionArtifact, catalog_generation: u64, reason: impl Into<String>, ) -> Result<Self>

业务作用:为 validated 自动激活构造绑定 definition seal、身份和 Catalog generation 的定长幂等操作。

参数说明:

  • artifact:是待激活的完整 definition
  • catalog_generation:是已确认快照
  • reason:是持久审计原因。

返回:返回长度不受租户或流程名影响的合法操作;seal 或原因不符合生命周期合同时返回错误。

Source

pub fn expected_sha256(&self) -> &str

业务作用:返回必须在持有 definition 行锁时复验的 seal。

参数说明: 无。

返回:规范化的小写 SHA-256。

Source

pub fn operation_id(&self) -> &str

业务作用:返回人工生命周期动作的幂等身份。

参数说明: 无。

返回:已通过长度与非空校验的稳定身份。

Source

pub fn reason(&self) -> &str

业务作用:返回与生命周期动作不可分持久化的审计原因。

参数说明: 无。

返回:已通过长度与非空校验的原因文本。

Trait Implementations§

Source§

impl Clone for DefinitionLifecycleOperation

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 DefinitionLifecycleOperation

Source§

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

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

impl Eq for DefinitionLifecycleOperation

Source§

impl PartialEq for DefinitionLifecycleOperation

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 DefinitionLifecycleOperation

Auto Trait Implementations§

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

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