Struct anidb::Anidb
[−]
[src]
pub struct Anidb { pub socket: UdpSocket, pub address: SocketAddr, pub session: String, }
Fields
socket: UdpSocket
address: SocketAddr
session: String
Methods
impl Anidb
[src]
fn new<A: ToSocketAddrs>(addr: A) -> Result<Anidb>
Creates a new instance of Anidb and makes a connection to the AniDB API server
ignore // code unwraps for simplicy but the error codes should be handled by the errors let mut db = anidb::Anidb::new(("anidb_server.net", 6666)).unwrap();
fn login(&mut self, username: &str, password: &str) -> Result<()>
Login the user to AniDB. You need to supply a user/pass that you have regisered at https://anidb.net/
Examples
// code unwraps for simplicy but the error codes should be handled by the errors let mut db = anidb::Anidb::new(("anidb_server.net", 6666)).unwrap(); db.login("leeloo_dallas", "multipass").unwrap();
fn logout(&mut self) -> Result<()>
Login the user to AniDB. You need to supply a user/pass that you have regisered at https://anidb.net/
Examples
// code unwraps for simplicy but the error codes should be handled by the errors let mut db = anidb::Anidb::new(("anidb_server.net", 6666)).unwrap(); db.login("leeloo_dallas", "multipass").unwrap(); db.logout()unwrap();