Skip to main content

Duplicatable

Trait Duplicatable 

Source
pub trait Duplicatable: Clone {
    // Required methods
    fn get_id(&self) -> String;
    fn set_id(&mut self, id: String);
    fn get_field(&self, field: &str) -> Option<String>;
    fn set_field(&mut self, field: &str, value: &str);
    fn get_amount(&self) -> Option<Decimal>;
    fn set_amount(&mut self, amount: Decimal);
    fn get_date(&self) -> Option<NaiveDate>;
    fn set_date(&mut self, date: NaiveDate);
}
Expand description

Trait for records that can be duplicated.

Required Methods§

Source

fn get_id(&self) -> String

Returns the record’s unique identifier.

Source

fn set_id(&mut self, id: String)

Sets a new identifier.

Source

fn get_field(&self, field: &str) -> Option<String>

Gets a field value by name.

Source

fn set_field(&mut self, field: &str, value: &str)

Sets a field value by name.

Source

fn get_amount(&self) -> Option<Decimal>

Gets the amount (for amount-bearing records).

Source

fn set_amount(&mut self, amount: Decimal)

Sets the amount.

Source

fn get_date(&self) -> Option<NaiveDate>

Gets the date.

Source

fn set_date(&mut self, date: NaiveDate)

Sets the date.

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§