pub struct Client {
pub addr: String,
/* private fields */
}Fields§
§addr: StringImplementations§
Source§impl Client
impl Client
Sourcepub fn builder() -> Result<ClientBuilder>
pub fn builder() -> Result<ClientBuilder>
Examples found in repository?
examples/connect_to_client.rs (line 5)
4async fn main() {
5 let builder = client::Client::builder().unwrap();
6 let lc = builder.insecure(true).build().unwrap();
7
8 let connected = lc.connect_to_socket().await.unwrap();
9
10 let speaker = league_client::subscribe(connected).await;
11
12 let msg = (5, "OnJsonApiEvent");
13 let msg = serde_json::to_string(&msg).unwrap();
14
15 speaker.send(msg).await.expect("should have sent a message");
16
17 while let Ok(msg) = speaker.reader.recv_async().await {
18 println!("{:?}", msg.into_message());
19 }
20}Sourcepub async fn connect_to_socket(&self) -> Result<Connected>
pub async fn connect_to_socket(&self) -> Result<Connected>
Connect to the LCU client. Returns a socket connection aliased as Connected.
Examples found in repository?
examples/connect_to_client.rs (line 8)
4async fn main() {
5 let builder = client::Client::builder().unwrap();
6 let lc = builder.insecure(true).build().unwrap();
7
8 let connected = lc.connect_to_socket().await.unwrap();
9
10 let speaker = league_client::subscribe(connected).await;
11
12 let msg = (5, "OnJsonApiEvent");
13 let msg = serde_json::to_string(&msg).unwrap();
14
15 speaker.send(msg).await.expect("should have sent a message");
16
17 while let Ok(msg) = speaker.reader.recv_async().await {
18 println!("{:?}", msg.into_message());
19 }
20}Sourcepub fn http_client(&self) -> Client
pub fn http_client(&self) -> Client
Gives back a copy of the reqwest client. Read More
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