use super::*;
#[doc(hidden)]
pub trait HasKeyAttributes<KS: KeySchema>: HasKeyAttributesImpl<KS, KS::Kind> {}
#[doc(hidden)]
pub trait HasKeyAttributesImpl<KS: KeySchema, K: KeySchemaKind>:
HasAttribute<KS::PartitionKey>
{
}
impl<S, T> HasKeyAttributesImpl<S, SimpleKey> for T
where
S: SimpleKeySchema,
T: HasAttribute<S::PartitionKey>,
{
}
impl<S, T> HasKeyAttributesImpl<S, CompositeKey> for T
where
S: CompositeKeySchema,
T: HasAttribute<S::PartitionKey>,
T: HasAttribute<S::SortKey>,
{
}
impl<KS, T> HasKeyAttributes<KS> for T
where
KS: KeySchema,
T: HasKeyAttributesImpl<KS, KS::Kind>,
{
}
#[doc(hidden)]
pub trait HasTableKeyAttributes<TD: TableDefinition>: HasKeyAttributes<TD::KeySchema> {}
impl<TD: TableDefinition, T> HasTableKeyAttributes<TD> for T where T: HasKeyAttributes<TD::KeySchema>
{}
#[doc(hidden)]
pub trait HasIndexKeyAttributes<TD: TableDefinition, I: IndexDefinition<TD>>:
HasKeyAttributes<TD::KeySchema> + HasKeyAttributes<I::KeySchema>
{
}
impl<TD: TableDefinition, I: IndexDefinition<TD>, T> HasIndexKeyAttributes<TD, I> for T where
T: HasKeyAttributes<TD::KeySchema> + HasKeyAttributes<I::KeySchema>
{
}