pub struct DbTorrentInfoRepository { /* private fields */ }
Implementations§
source§impl DbTorrentInfoRepository
impl DbTorrentInfoRepository
pub fn new(database: Arc<Box<dyn Database>>) -> Self
sourcepub async fn get_by_info_hash(
&self,
info_hash: &InfoHash
) -> Result<DbTorrentInfo, Error>
pub async fn get_by_info_hash( &self, info_hash: &InfoHash ) -> Result<DbTorrentInfo, Error>
It finds the torrent info by info-hash.
Errors
This function will return an error there is a database error.
sourcepub async fn update(
&self,
torrent_id: &TorrentId,
opt_title: &Option<String>,
opt_description: &Option<String>,
opt_tags: &Option<Vec<TagId>>
) -> Result<(), Error>
pub async fn update( &self, torrent_id: &TorrentId, opt_title: &Option<String>, opt_description: &Option<String>, opt_tags: &Option<Vec<TagId>> ) -> Result<(), Error>
It updates the torrent title or/and description by torrent ID.
Errors
This function will return an error there is a database error.
Auto Trait Implementations§
impl !RefUnwindSafe for DbTorrentInfoRepository
impl Send for DbTorrentInfoRepository
impl Sync for DbTorrentInfoRepository
impl Unpin for DbTorrentInfoRepository
impl !UnwindSafe for DbTorrentInfoRepository
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