pub struct Store<T> { /* private fields */ }
Expand description
Notifications store.
Implementations§
Source§impl Store<Write>
impl Store<Write>
Sourcepub fn open<P>(path: P) -> Result<Store<Write>, Error>
pub fn open<P>(path: P) -> Result<Store<Write>, Error>
Open a policy store at the given path. Creates a new store if it doesn’t exist.
Sourcepub fn set_status(
&mut self,
status: NotificationStatus,
ids: &[u32],
) -> Result<bool, Error>
pub fn set_status( &mut self, status: NotificationStatus, ids: &[u32], ) -> Result<bool, Error>
Set notification read status for the given notifications.
Sourcepub fn insert(
&mut self,
repo: &RepoId,
update: &RefUpdate,
timestamp: LocalTime,
) -> Result<bool, Error>
pub fn insert( &mut self, repo: &RepoId, update: &RefUpdate, timestamp: LocalTime, ) -> Result<bool, Error>
Insert a notification. Resets the status to unread if it already exists.
Source§impl<T> Store<T>
Read
methods for Store
. This implies that a
Store<Write>
can access these functions as well.
impl<T> Store<T>
Read
methods for Store
. This implies that a
Store<Write>
can access these functions as well.
Sourcepub fn all(
&self,
) -> Result<impl Iterator<Item = Result<Notification, Error>>, Error>
pub fn all( &self, ) -> Result<impl Iterator<Item = Result<Notification, Error>>, Error>
Get all notifications.
pub fn by_timestamp( &self, since: LocalTime, until: LocalTime, ) -> Result<impl Iterator<Item = Result<Notification, Error>>, Error>
Sourcepub fn by_repo(
&self,
repo: &RepoId,
order_by: &str,
) -> Result<impl Iterator<Item = Result<Notification, Error>>, Error>
pub fn by_repo( &self, repo: &RepoId, order_by: &str, ) -> Result<impl Iterator<Item = Result<Notification, Error>>, Error>
Get notifications by repo.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Store<T>
impl<T> !RefUnwindSafe for Store<T>
impl<T> Send for Store<T>where
T: Send,
impl<T> Sync for Store<T>where
T: Sync,
impl<T> Unpin for Store<T>where
T: Unpin,
impl<T> !UnwindSafe for Store<T>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more