allow to use ApiInternal as a library

This commit is contained in:
Adrien Delorme 2023-05-07 13:12:57 +02:00
parent 7a2de09794
commit 29d43dfafb
No known key found for this signature in database

View file

@ -214,7 +214,7 @@ pub struct ApiInternal {
type ApiState = Arc<ApiInternal>; type ApiState = Arc<ApiInternal>;
impl ApiInternal { impl ApiInternal {
fn new(session: Arc<Session>) -> Self { pub fn new(session: Arc<Session>) -> Self {
Self { Self {
dht: session.get_dht(), dht: session.get_dht(),
startup_time: Instant::now(), startup_time: Instant::now(),
@ -260,7 +260,7 @@ impl ApiInternal {
make_torrent_details(&info_hash, handle.torrent_state().info(), only_files) make_torrent_details(&info_hash, handle.torrent_state().info(), only_files)
} }
async fn api_add_torrent( pub async fn api_add_torrent(
&self, &self,
url: String, url: String,
opts: Option<AddTorrentOptions>, opts: Option<AddTorrentOptions>,