pub struct Client { /* private fields */ }
Implementations§
Source§impl Client
impl Client
Sourcepub fn new(username: &str, password: &str) -> Self
pub fn new(username: &str, password: &str) -> Self
Creates a new instance of the client with the default configuration.
Example:
use dapnet_api::Client;
let client = Client::new("m0nxn", "my_super_secret_password");
pub async fn get_statistics(&self) -> Result<Option<Statistics>>
pub async fn get_calls_by(&self, owner: &str) -> Result<Option<Vec<Call>>>
Sourcepub async fn new_call(&self, call: &OutgoingCall) -> Result<()>
pub async fn new_call(&self, call: &OutgoingCall) -> Result<()>
Sends a new call/message.
Example:
client
.new_call(&OutgoingCallBuilder::default()
.text("M0NXN: this is a test".to_string())
.recipients(vec!["m0nxn".to_string()])
.transmitter_groups(vec!["uk-all".to_string()])
.build()
.unwrap()
)
.await
.unwrap();
pub async fn get_all_nodes(&self) -> Result<Option<Vec<Node>>>
pub async fn get_node(&self, name: &str) -> Result<Option<Node>>
pub async fn get_all_callsigns(&self) -> Result<Option<Vec<Callsign>>>
pub async fn get_callsign(&self, name: &str) -> Result<Option<Callsign>>
pub async fn get_all_transmitters(&self) -> Result<Option<Vec<Transmitter>>>
pub async fn get_transmitter(&self, name: &str) -> Result<Option<Transmitter>>
pub async fn get_all_transmitter_groups( &self, ) -> Result<Option<Vec<TransmitterGroup>>>
pub async fn get_transmitter_group( &self, name: &str, ) -> Result<Option<TransmitterGroup>>
pub async fn get_all_rubrics(&self) -> Result<Option<Vec<Rubric>>>
pub async fn get_rubric(&self, name: &str) -> Result<Option<Rubric>>
pub async fn get_news(&self, name: &str) -> Result<Option<Vec<News>>>
Sourcepub async fn new_news(&self, news: &OutgoingNews) -> Result<()>
pub async fn new_news(&self, news: &OutgoingNews) -> Result<()>
Sends news to a rubric.
Example:
client
.new_news(&OutgoingNewsBuilder::default()
.rubric("some_rubric_name".to_string())
.text("M0NXN: this is a test".to_string())
.build()
.unwrap()
)
.await
.unwrap();
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Client
impl !RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl !UnwindSafe for Client
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