Trait HasLastUpdate

Source
pub trait HasLastUpdate: HasId {
    // Required methods
    fn set_last_update(&mut self, time: impl Into<String>);
    fn last_update(self, time: Option<String>) -> Self;

    // Provided methods
    fn get_timestamp() -> String { ... }
    fn create_with_time() -> Self { ... }
}
Expand description

Trait indicating a TMF sturct has a last_update or similar timestamp field.

Required Methods§

Source

fn set_last_update(&mut self, time: impl Into<String>)

Store a timestamp into last_update field (if available)

Source

fn last_update(self, time: Option<String>) -> Self

Builder pattern for setting lastUpdate on create If time is None, current time is used via [‘get_timestamp()’]

Provided Methods§

Source

fn get_timestamp() -> String

Geneate a timestamp for now(), useful for updating last_updated fields

Source

fn create_with_time() -> Self

Create a new TMF object, also set last_update field to now()

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§