1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
use crate::bound::Bound;
use crate::r#type::Type;
/// Defines an associated constant.
#[derive(Debug, Clone)]
pub struct AssociatedConst(pub Bound);
impl AssociatedConst {
/// Set the bound on the associated constant.
pub fn bound<T>(&mut self, ty: T) -> &mut Self
where
T: Into<Type>,
{
self.0.bound = vec![ty.into()];
self
}
}