[−][src]Struct octocrab::activity::notifications::NotificationsHandler
Handler for GitHub's notifications API.
Created with ActivityHandler::notifications
.
Note: All of these methods require authentication using
your GitHub Access Token with the right privileges.
Implementations
impl<'octo> NotificationsHandler<'octo>
[src]
pub async fn get<'_>(&'_ self, id: impl Into<u64>) -> Result<Notification>
[src]
Gets a notification by their id.
let thread = octocrab::instance() .activity() .notifications() .get(123u32) .await?;
pub async fn mark_as_read<'_>(&'_ self, id: impl Into<u64>) -> Result<()>
[src]
Marks a single thread as read.
octocrab::instance() .activity() .notifications() .mark_as_read(123u32) .await?;
pub async fn mark_repo_as_read<'_>(
&'_ self,
owner: impl AsRef<str>,
repo: impl AsRef<str>,
last_read_at: impl Into<Option<DateTime<Utc>>>
) -> Result<()>
[src]
&'_ self,
owner: impl AsRef<str>,
repo: impl AsRef<str>,
last_read_at: impl Into<Option<DateTime<Utc>>>
) -> Result<()>
Marks all notifications in a repository as read.
octocrab::instance() .activity() .notifications() .mark_repo_as_read("XAMPPRocky", "octocrab", None) .await?;
pub async fn mark_all_as_read<'_>(
&'_ self,
last_read_at: impl Into<Option<DateTime<Utc>>>
) -> Result<()>
[src]
&'_ self,
last_read_at: impl Into<Option<DateTime<Utc>>>
) -> Result<()>
Marks all notifications as read.
If you provide a last_read_at
parameter,
anything updated since this time will not be marked as read.
octocrab::instance() .activity() .notifications() .mark_all_as_read(None) .await?;
pub async fn get_thread_subscription<'_>(
&'_ self,
thread: impl Into<u64>
) -> Result<ThreadSubscription>
[src]
&'_ self,
thread: impl Into<u64>
) -> Result<ThreadSubscription>
This checks to see if the current user is subscribed to a thread.
let subscription = octocrab::instance() .activity() .notifications() .get_thread_subscription(123u32) .await?;
pub async fn set_thread_subscription<'_>(
&'_ self,
thread: impl Into<u64>,
ignored: bool
) -> Result<ThreadSubscription>
[src]
&'_ self,
thread: impl Into<u64>,
ignored: bool
) -> Result<ThreadSubscription>
Ignore or unignore a thread subscription, that is enabled by watching a repository.
let subscription = octocrab::instance() .activity() .notifications() .set_thread_subscription(123u32, true) .await?;
pub async fn delete_thread_subscription<'_>(
&'_ self,
thread: impl Into<u64>
) -> Result<()>
[src]
&'_ self,
thread: impl Into<u64>
) -> Result<()>
Mutes the whole thread conversation until you comment or get mentioned.
octocrab::instance() .activity() .notifications() .delete_thread_subscription(123u32) .await?;
pub fn list_for_repo(
&self,
owner: impl AsRef<str>,
repo: impl AsRef<str>
) -> ListNotificationsBuilder<'octo>
[src]
&self,
owner: impl AsRef<str>,
repo: impl AsRef<str>
) -> ListNotificationsBuilder<'octo>
List all notifications for the current user, that are in a given repository.
let notifications = octocrab::instance() .activity() .notifications() .list_for_repo("XAMPPRocky", "octocrab") // Also show notifications that are marked as read. .all(true) .send() .await?;
pub fn list(&self) -> ListNotificationsBuilder<'octo>
[src]
List all notifications for the current user.
let notifications = octocrab::instance() .activity() .notifications() .list() .send() .await?;
Auto Trait Implementations
impl<'octo> !RefUnwindSafe for NotificationsHandler<'octo>
[src]
impl<'octo> Send for NotificationsHandler<'octo>
[src]
impl<'octo> Sync for NotificationsHandler<'octo>
[src]
impl<'octo> Unpin for NotificationsHandler<'octo>
[src]
impl<'octo> !UnwindSafe for NotificationsHandler<'octo>
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,