Struct MetricKey

Source
pub struct MetricKey<'a> {
    pub id: i64,
    pub key: Cow<'a, str>,
    pub unit: Cow<'a, str>,
    pub description: Cow<'a, str>,
}
Expand description

Metric key

Fields§

§id: i64

primary key of metric key

§key: Cow<'a, str>

Actual key

§unit: Cow<'a, str>

Unit if any

§description: Cow<'a, str>

Description of metric key if any

Trait Implementations§

Source§

impl<'__b, __FK> BelongsTo<&MetricKey<'__b>> for Metric
where __FK: Hash + Eq, for<'__a> &'__a i64: Into<Option<&'__a __FK>>, for<'__a> &'__a MetricKey<'__b>: Identifiable<Id = &'__a __FK>,

Source§

type ForeignKey = __FK

The foreign key of this struct
Source§

type ForeignKeyColumn = metric_key_id

The database column representing the foreign key of the table this struct represents
Source§

fn foreign_key(&self) -> Option<&Self::ForeignKey>

Returns the foreign key for self
Source§

fn foreign_key_column() -> Self::ForeignKeyColumn

Returns the foreign key column of this struct’s table
Source§

impl<'__b, __FK> BelongsTo<MetricKey<'__b>> for Metric
where __FK: Hash + Eq, for<'__a> &'__a i64: Into<Option<&'__a __FK>>, for<'__a> &'__a MetricKey<'__b>: Identifiable<Id = &'__a __FK>,

Source§

type ForeignKey = __FK

The foreign key of this struct
Source§

type ForeignKeyColumn = metric_key_id

The database column representing the foreign key of the table this struct represents
Source§

fn foreign_key(&self) -> Option<&Self::ForeignKey>

Returns the foreign key for self
Source§

fn foreign_key_column() -> Self::ForeignKeyColumn

Returns the foreign key column of this struct’s table
Source§

impl<'a> Debug for MetricKey<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'a> HasTable for MetricKey<'a>

Source§

type Table = table

The table this type is associated with.
Source§

fn table() -> <Self as HasTable>::Table

Returns the table this type is associated with.
Source§

impl<'a, 'ident> Identifiable for &'ident MetricKey<'a>

Source§

type Id = &'ident i64

The type of this struct’s identifier. Read more
Source§

fn id(self) -> <Self as Identifiable>::Id

Returns the identifier for this record. Read more
Source§

impl<'a, __DB: Backend, __ST0, __ST1, __ST2, __ST3> Queryable<(__ST0, __ST1, __ST2, __ST3), __DB> for MetricKey<'a>

Source§

type Row = (i64, Cow<'a, str>, Cow<'a, str>, Cow<'a, str>)

The Rust type you’d like to map from. Read more
Source§

fn build(row: (i64, Cow<'a, str>, Cow<'a, str>, Cow<'a, str>)) -> Result<Self>

Construct an instance of this type

Auto Trait Implementations§

§

impl<'a> Freeze for MetricKey<'a>

§

impl<'a> RefUnwindSafe for MetricKey<'a>

§

impl<'a> Send for MetricKey<'a>

§

impl<'a> Sync for MetricKey<'a>

§

impl<'a> Unpin for MetricKey<'a>

§

impl<'a> UnwindSafe for MetricKey<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoSql for T

Source§

fn into_sql<T>(self) -> Self::Expression

Convert self to an expression for Diesel’s query builder. Read more
Source§

fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression
where &'a Self: AsExpression<T>, T: SqlType + TypedExpressionType,

Convert &self to an expression for Diesel’s query builder. Read more
Source§

impl<T, ST, DB> StaticallySizedRow<ST, DB> for T
where ST: SqlTypeOrSelectable + TupleSize, T: Queryable<ST, DB>, DB: Backend,

Source§

const FIELD_COUNT: usize = <ST as crate::util::TupleSize>::SIZE

The number of fields that this type will consume.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.