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§
Sourcefn set_last_update(&mut self, time: impl Into<String>)
fn set_last_update(&mut self, time: impl Into<String>)
Store a timestamp into last_update field (if available)
Sourcefn last_update(self, time: Option<String>) -> Self
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§
Sourcefn get_timestamp() -> String
fn get_timestamp() -> String
Geneate a timestamp for now(), useful for updating last_updated fields
Sourcefn create_with_time() -> Self
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.