Mappable

Trait Mappable 

Source
pub trait Mappable {
    type MatrixReference: ?Sized + Eq + Hash + ToOwned<Owned = Self::MatrixType>;
    type MatrixType: Eq + Hash + Borrow<Self::MatrixReference>;
    type ExternalReference: ?Sized + Eq + Hash + ToOwned<Owned = Self::ExternalType>;
    type ExternalType: Eq + Hash + Borrow<Self::ExternalReference>;

    // Required methods
    fn as_matrix(&self) -> &Self::MatrixReference;
    fn into_matrix(self) -> Self::MatrixType;
    fn as_external(&self) -> &Self::ExternalReference;
    fn into_external(self) -> Self::ExternalType;
    fn into_split(self) -> (Self::MatrixType, Self::ExternalType);
}
Expand description

Represents an object that has both a Matrix ID and an external ID.

Required Associated Types§

Required Methods§

Source

fn as_matrix(&self) -> &Self::MatrixReference

Get a reference to the Matrix ID of this object.

Source

fn into_matrix(self) -> Self::MatrixType

Convert this object into an owned Matrix ID of this object.

Source

fn as_external(&self) -> &Self::ExternalReference

Get a reference to the external ID of this object.

Source

fn into_external(self) -> Self::ExternalType

Convert this object into an owned external ID of this object.

Source

fn into_split(self) -> (Self::MatrixType, Self::ExternalType)

Split this object into owned matrix type and external type.

Implementors§