pub struct MemphisClient { /* private fields */ }
Expand description
§Memphis Client
The Memphis Client is used to connect to Memphis.
use memphis_rust_community::memphis_client::MemphisClient;
#[tokio::main]
async fn main() {
let client = MemphisClient::new("localhost:6666", "root", "memphis", None).await.unwrap();
}
Implementations§
Source§impl MemphisClient
impl MemphisClient
Sourcepub async fn new(
memphis_host: &str,
memphis_username: &str,
memphis_password: &str,
account_id: Option<&str>,
) -> Result<MemphisClient, ConnectError>
pub async fn new( memphis_host: &str, memphis_username: &str, memphis_password: &str, account_id: Option<&str>, ) -> Result<MemphisClient, ConnectError>
Creates a new MemphisClient
§Arguments
memphis_host
- The host of the Memphis servermemphis_username
- The username of the Memphis usermemphis_password
- The password of the Memphis useraccount_id
- The account id of the Memphis account (Only used in cloud version) use None or “1” for self hosted
§Example
use memphis_rust_community::memphis_client::MemphisClient;
#[tokio::main]
async fn main() {
let client = MemphisClient::new(
"localhost:6666",
"root",
"memphis",
None
).await.unwrap();
}
pub fn is_connected(&self) -> bool
pub async fn create_station( &self, station_options: MemphisStationsOptions, ) -> Result<MemphisStation, RequestError>
Sourcepub fn get_jetstream_context(&self) -> &Context
pub fn get_jetstream_context(&self) -> &Context
Returns the Jetstream Context used behind the scenes, only use this if you know what you are doing
Sourcepub fn get_broker_connection(&self) -> &Client
pub fn get_broker_connection(&self) -> &Client
Returns the Broker Connection used behind the scenes, only use this if you know what you are doing
Trait Implementations§
Source§impl Clone for MemphisClient
impl Clone for MemphisClient
Source§fn clone(&self) -> MemphisClient
fn clone(&self) -> MemphisClient
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for MemphisClient
impl !RefUnwindSafe for MemphisClient
impl Send for MemphisClient
impl Sync for MemphisClient
impl Unpin for MemphisClient
impl !UnwindSafe for MemphisClient
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