pub struct ClientBuilder { /* private fields */ }Implementations§
Source§impl ClientBuilder
impl ClientBuilder
Sourcepub fn from_process() -> Result<Self>
pub fn from_process() -> Result<Self>
Attempts to look for the LeagueClientUx process.
- Uses ps and grep if you’re in the linux family.
- Uses wmic if on the windows family.
If it finds it, it will grab the token and port from the args. Set insecure to true to avoid having to pass in the riot key.
Sourcepub fn insecure(self, value: bool) -> Self
pub fn insecure(self, value: bool) -> Self
Skip cert check.
Examples found in repository?
examples/connect_to_client.rs (line 6)
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 build(self) -> Result<Client>
pub fn build(self) -> Result<Client>
Consumes the builder and returns a Client
Examples found in repository?
examples/connect_to_client.rs (line 6)
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}Trait Implementations§
Source§impl Debug for ClientBuilder
impl Debug for ClientBuilder
Source§impl Default for ClientBuilder
impl Default for ClientBuilder
Source§fn default() -> ClientBuilder
fn default() -> ClientBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ClientBuilder
impl RefUnwindSafe for ClientBuilder
impl Send for ClientBuilder
impl Sync for ClientBuilder
impl Unpin for ClientBuilder
impl UnwindSafe for ClientBuilder
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