use crate::{backend::Backend, interest::Interest, token::Token};
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub struct Registration {
token: Token,
interest: Interest,
}
impl Registration {
pub const fn new(token: Token, interest: Interest) -> Self {
Self { token, interest }
}
pub const fn token(&self) -> Token {
self.token
}
pub const fn interest(&self) -> Interest {
self.interest
}
pub const fn with_interest(self, interest: Interest) -> Self {
Self {
token: self.token,
interest,
}
}
}
pub trait Source<B: Backend>: Send + Sync {
fn raw_source(&self) -> B::RawSource;
}