Files
Kartikeya Hegde 6a74e8cba9 feat: add updated_by to tracker tables (#2604)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-10-17 11:26:56 +00:00

29 lines
590 B
Rust

pub mod errors;
pub mod mandates;
pub mod payments;
#[derive(Clone, Debug, Eq, PartialEq)]
pub enum RemoteStorageObject<T: ForeignIDRef> {
ForeignID(String),
Object(T),
}
impl<T: ForeignIDRef> From<T> for RemoteStorageObject<T> {
fn from(value: T) -> Self {
Self::Object(value)
}
}
pub trait ForeignIDRef {
fn foreign_id(&self) -> String;
}
impl<T: ForeignIDRef> RemoteStorageObject<T> {
pub fn get_id(&self) -> String {
match self {
Self::ForeignID(id) => id.clone(),
Self::Object(i) => i.foreign_id(),
}
}
}