pub struct ObjectMeta { /* private fields */ }Expand description
Identity, concurrency version, generation and user metadata for a task.
name is the stable resource address.
uid identifies one incarnation.
resource_version is assigned by the state store and remains opaque.
Implementations§
Source§impl ObjectMeta
impl ObjectMeta
Sourcepub fn new(name: TaskId) -> ModelResult<Self>
pub fn new(name: TaskId) -> ModelResult<Self>
Creates metadata and generates a UID.
The initial generation is 1.
The state store assigns the first resource version through Self::set_resource_version.
§Errors
Returns ModelError::Invalid when the name is invalid or UID generation fails.
Sourcepub fn with_uid(name: TaskId, uid: Uid) -> ModelResult<Self>
pub fn with_uid(name: TaskId, uid: Uid) -> ModelResult<Self>
Creates metadata with an existing UID.
§Errors
Returns ModelError::Invalid when the name is invalid.
Sourcepub fn resource_version(&self) -> &str
pub fn resource_version(&self) -> &str
Opaque state-store version used for optimistic concurrency.
Sourcepub fn generation(&self) -> u64
pub fn generation(&self) -> u64
Desired-state generation.
Sourcepub fn creation_timestamp(&self) -> SystemTime
pub fn creation_timestamp(&self) -> SystemTime
Resource creation timestamp.
Sourcepub fn annotations(&self) -> &Annotations
pub fn annotations(&self) -> &Annotations
Free-form metadata.
Sourcepub fn set_resource_version(
&mut self,
resource_version: impl Into<String>,
) -> ModelResult<()>
pub fn set_resource_version( &mut self, resource_version: impl Into<String>, ) -> ModelResult<()>
Assigns an opaque state-store version.
The value is stored verbatim and is never parsed by the model.
§Errors
Returns ModelError::Invalid when the value is empty.
Trait Implementations§
Source§impl Clone for ObjectMeta
impl Clone for ObjectMeta
Source§fn clone(&self) -> ObjectMeta
fn clone(&self) -> ObjectMeta
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ObjectMeta
impl Debug for ObjectMeta
Source§impl<'de> Deserialize<'de> for ObjectMeta
impl<'de> Deserialize<'de> for ObjectMeta
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>,
impl Eq for ObjectMeta
Source§impl JsonSchema for ObjectMeta
impl JsonSchema for ObjectMeta
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read more