pub struct RadioClient { /* private fields */ }Expand description
Radio Protocol WebSocket client
Implementations§
Source§impl RadioClient
impl RadioClient
Sourcepub fn new(config: RadioConfig) -> Self
pub fn new(config: RadioConfig) -> Self
Create a new Radio client
Sourcepub async fn state(&self) -> ConnectionState
pub async fn state(&self) -> ConnectionState
Get current connection state
Sourcepub async fn disconnect(&self) -> Result<()>
pub async fn disconnect(&self) -> Result<()>
Disconnect from the server
Sourcepub async fn broadcast(&self, frequency: &str, event: Value) -> Result<()>
pub async fn broadcast(&self, frequency: &str, event: Value) -> Result<()>
Broadcast an event on a frequency
Sourcepub fn validate_frequencies(&self, frequencies: &[String]) -> Result<()>
pub fn validate_frequencies(&self, frequencies: &[String]) -> Result<()>
Validate frequency range (40.0-108.0 FM)
Auto Trait Implementations§
impl Freeze for RadioClient
impl !RefUnwindSafe for RadioClient
impl Send for RadioClient
impl Sync for RadioClient
impl Unpin for RadioClient
impl UnsafeUnpin for RadioClient
impl !UnwindSafe for RadioClient
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