pub struct YTSubscription { /* private fields */ }Expand description
A YTSubscription to a YouTube-Channel. The Youtube-Channel is referenced by the channel id.
Implementations§
Source§impl YTSubscription
impl YTSubscription
Sourcepub fn new(id: &str) -> Self
pub fn new(id: &str) -> Self
Create a new YTSubscription using the given channel id.
Sourcepub fn new_with_name(id: &str, name: &str) -> Self
pub fn new_with_name(id: &str, name: &str) -> Self
Create a new YTSubscription using the given channel id and name.
Sourcepub async fn try_from_search<S: AsRef<str>>(query: S) -> Option<Self>
pub async fn try_from_search<S: AsRef<str>>(query: S) -> Option<Self>
Try to get a subscription using youtube search. This will try to search the given query in youtube filtered only to channels and return the first result if it exists.
Sourcepub fn id(&self) -> String
pub fn id(&self) -> String
Get the channel id of the YTSubscription.
Sourcepub async fn update_name(&self, client: &Client) -> Option<String>
pub async fn update_name(&self, client: &Client) -> Option<String>
Try to get the channel name from the channel id.
Trait Implementations§
Source§impl Clone for YTSubscription
impl Clone for YTSubscription
Source§fn clone(&self) -> YTSubscription
fn clone(&self) -> YTSubscription
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for YTSubscription
impl Debug for YTSubscription
Source§impl Display for YTSubscription
impl Display for YTSubscription
Source§impl From<&ChannelSearchItem> for YTSubscription
impl From<&ChannelSearchItem> for YTSubscription
Source§fn from(item: &ChannelSearchItem) -> Self
fn from(item: &ChannelSearchItem) -> Self
Converts to this type from the input type.
Source§impl From<YTSubscription> for Vec<String>
impl From<YTSubscription> for Vec<String>
Source§fn from(sub: YTSubscription) -> Self
fn from(sub: YTSubscription) -> Self
Converts to this type from the input type.
Source§impl GeneratorWithClient for YTSubscription
impl GeneratorWithClient for YTSubscription
Source§type Iterator = IntoIter<<YTSubscription as GeneratorWithClient>::Item>
type Iterator = IntoIter<<YTSubscription as GeneratorWithClient>::Item>
The outcoming Iterator.
Source§fn generate_with_client<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
errors: &'life1 ErrorStore,
client: &'life2 Client,
) -> Pin<Box<dyn Future<Output = Self::Iterator> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn generate_with_client<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
errors: &'life1 ErrorStore,
client: &'life2 Client,
) -> Pin<Box<dyn Future<Output = Self::Iterator> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Source§impl Hash for YTSubscription
impl Hash for YTSubscription
Source§impl PartialEq for YTSubscription
impl PartialEq for YTSubscription
Source§impl Subscription for YTSubscription
impl Subscription for YTSubscription
impl Eq for YTSubscription
Auto Trait Implementations§
impl Freeze for YTSubscription
impl RefUnwindSafe for YTSubscription
impl Send for YTSubscription
impl Sync for YTSubscription
impl Unpin for YTSubscription
impl UnwindSafe for YTSubscription
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> Generator for Twhere
T: GeneratorWithClient + Sync,
impl<T> Generator for Twhere
T: GeneratorWithClient + Sync,
Source§type Item = <T as GeneratorWithClient>::Item
type Item = <T as GeneratorWithClient>::Item
The item being generated.
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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