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