pub struct EntrypointBuilder { /* private fields */ }
Implementations§
Source§impl EntrypointBuilder
impl EntrypointBuilder
Sourcepub fn new() -> Self
pub fn new() -> Self
Examples found in repository?
examples/password_server.rs (line 21)
9fn main() -> Result<(), Box<dyn std::error::Error>> {
10 dotenvy::from_path(".env.local").unwrap();
11 env::set_var("OPENSSL_CONF", "/dev/null");
12
13 let protocol = get_anyconnect_protocol();
14
15 let config = ConfigBuilder::default().loglevel(LogLevel::Info).build()?;
16
17 let event_handlers = EventHandlers::default();
18
19 let client = VpnClient::new(config, event_handlers)?;
20
21 let entrypoint = EntrypointBuilder::new()
22 .server(&env::var("VPN_SERVER").unwrap())
23 .username(&env::var("VPN_USERNAME").unwrap())
24 .password(&env::var("VPN_PASSWORD").unwrap())
25 .protocol(protocol)
26 .enable_udp(true)
27 .accept_insecure_cert(true)
28 .build()?;
29
30 client.init_connection(entrypoint)?;
31 client.run_loop()?;
32
33 Ok(())
34}
pub fn name(&mut self, name: &str) -> &mut Self
Sourcepub fn server(&mut self, server: &str) -> &mut Self
pub fn server(&mut self, server: &str) -> &mut Self
Examples found in repository?
examples/password_server.rs (line 22)
9fn main() -> Result<(), Box<dyn std::error::Error>> {
10 dotenvy::from_path(".env.local").unwrap();
11 env::set_var("OPENSSL_CONF", "/dev/null");
12
13 let protocol = get_anyconnect_protocol();
14
15 let config = ConfigBuilder::default().loglevel(LogLevel::Info).build()?;
16
17 let event_handlers = EventHandlers::default();
18
19 let client = VpnClient::new(config, event_handlers)?;
20
21 let entrypoint = EntrypointBuilder::new()
22 .server(&env::var("VPN_SERVER").unwrap())
23 .username(&env::var("VPN_USERNAME").unwrap())
24 .password(&env::var("VPN_PASSWORD").unwrap())
25 .protocol(protocol)
26 .enable_udp(true)
27 .accept_insecure_cert(true)
28 .build()?;
29
30 client.init_connection(entrypoint)?;
31 client.run_loop()?;
32
33 Ok(())
34}
Sourcepub fn username(&mut self, username: &str) -> &mut Self
pub fn username(&mut self, username: &str) -> &mut Self
Examples found in repository?
examples/password_server.rs (line 23)
9fn main() -> Result<(), Box<dyn std::error::Error>> {
10 dotenvy::from_path(".env.local").unwrap();
11 env::set_var("OPENSSL_CONF", "/dev/null");
12
13 let protocol = get_anyconnect_protocol();
14
15 let config = ConfigBuilder::default().loglevel(LogLevel::Info).build()?;
16
17 let event_handlers = EventHandlers::default();
18
19 let client = VpnClient::new(config, event_handlers)?;
20
21 let entrypoint = EntrypointBuilder::new()
22 .server(&env::var("VPN_SERVER").unwrap())
23 .username(&env::var("VPN_USERNAME").unwrap())
24 .password(&env::var("VPN_PASSWORD").unwrap())
25 .protocol(protocol)
26 .enable_udp(true)
27 .accept_insecure_cert(true)
28 .build()?;
29
30 client.init_connection(entrypoint)?;
31 client.run_loop()?;
32
33 Ok(())
34}
Sourcepub fn password(&mut self, password: &str) -> &mut Self
pub fn password(&mut self, password: &str) -> &mut Self
Examples found in repository?
examples/password_server.rs (line 24)
9fn main() -> Result<(), Box<dyn std::error::Error>> {
10 dotenvy::from_path(".env.local").unwrap();
11 env::set_var("OPENSSL_CONF", "/dev/null");
12
13 let protocol = get_anyconnect_protocol();
14
15 let config = ConfigBuilder::default().loglevel(LogLevel::Info).build()?;
16
17 let event_handlers = EventHandlers::default();
18
19 let client = VpnClient::new(config, event_handlers)?;
20
21 let entrypoint = EntrypointBuilder::new()
22 .server(&env::var("VPN_SERVER").unwrap())
23 .username(&env::var("VPN_USERNAME").unwrap())
24 .password(&env::var("VPN_PASSWORD").unwrap())
25 .protocol(protocol)
26 .enable_udp(true)
27 .accept_insecure_cert(true)
28 .build()?;
29
30 client.init_connection(entrypoint)?;
31 client.run_loop()?;
32
33 Ok(())
34}
Sourcepub fn protocol(&mut self, protocol: Protocol) -> &mut Self
pub fn protocol(&mut self, protocol: Protocol) -> &mut Self
Examples found in repository?
examples/password_server.rs (line 25)
9fn main() -> Result<(), Box<dyn std::error::Error>> {
10 dotenvy::from_path(".env.local").unwrap();
11 env::set_var("OPENSSL_CONF", "/dev/null");
12
13 let protocol = get_anyconnect_protocol();
14
15 let config = ConfigBuilder::default().loglevel(LogLevel::Info).build()?;
16
17 let event_handlers = EventHandlers::default();
18
19 let client = VpnClient::new(config, event_handlers)?;
20
21 let entrypoint = EntrypointBuilder::new()
22 .server(&env::var("VPN_SERVER").unwrap())
23 .username(&env::var("VPN_USERNAME").unwrap())
24 .password(&env::var("VPN_PASSWORD").unwrap())
25 .protocol(protocol)
26 .enable_udp(true)
27 .accept_insecure_cert(true)
28 .build()?;
29
30 client.init_connection(entrypoint)?;
31 client.run_loop()?;
32
33 Ok(())
34}
Sourcepub fn enable_udp(&mut self, enable_udp: bool) -> &mut Self
pub fn enable_udp(&mut self, enable_udp: bool) -> &mut Self
Examples found in repository?
examples/password_server.rs (line 26)
9fn main() -> Result<(), Box<dyn std::error::Error>> {
10 dotenvy::from_path(".env.local").unwrap();
11 env::set_var("OPENSSL_CONF", "/dev/null");
12
13 let protocol = get_anyconnect_protocol();
14
15 let config = ConfigBuilder::default().loglevel(LogLevel::Info).build()?;
16
17 let event_handlers = EventHandlers::default();
18
19 let client = VpnClient::new(config, event_handlers)?;
20
21 let entrypoint = EntrypointBuilder::new()
22 .server(&env::var("VPN_SERVER").unwrap())
23 .username(&env::var("VPN_USERNAME").unwrap())
24 .password(&env::var("VPN_PASSWORD").unwrap())
25 .protocol(protocol)
26 .enable_udp(true)
27 .accept_insecure_cert(true)
28 .build()?;
29
30 client.init_connection(entrypoint)?;
31 client.run_loop()?;
32
33 Ok(())
34}
Sourcepub fn accept_insecure_cert(&mut self, accept_insecure_cert: bool) -> &mut Self
pub fn accept_insecure_cert(&mut self, accept_insecure_cert: bool) -> &mut Self
Examples found in repository?
examples/password_server.rs (line 27)
9fn main() -> Result<(), Box<dyn std::error::Error>> {
10 dotenvy::from_path(".env.local").unwrap();
11 env::set_var("OPENSSL_CONF", "/dev/null");
12
13 let protocol = get_anyconnect_protocol();
14
15 let config = ConfigBuilder::default().loglevel(LogLevel::Info).build()?;
16
17 let event_handlers = EventHandlers::default();
18
19 let client = VpnClient::new(config, event_handlers)?;
20
21 let entrypoint = EntrypointBuilder::new()
22 .server(&env::var("VPN_SERVER").unwrap())
23 .username(&env::var("VPN_USERNAME").unwrap())
24 .password(&env::var("VPN_PASSWORD").unwrap())
25 .protocol(protocol)
26 .enable_udp(true)
27 .accept_insecure_cert(true)
28 .build()?;
29
30 client.init_connection(entrypoint)?;
31 client.run_loop()?;
32
33 Ok(())
34}
Sourcepub fn build(&self) -> OpenconnectResult<Entrypoint>
pub fn build(&self) -> OpenconnectResult<Entrypoint>
Examples found in repository?
examples/password_server.rs (line 28)
9fn main() -> Result<(), Box<dyn std::error::Error>> {
10 dotenvy::from_path(".env.local").unwrap();
11 env::set_var("OPENSSL_CONF", "/dev/null");
12
13 let protocol = get_anyconnect_protocol();
14
15 let config = ConfigBuilder::default().loglevel(LogLevel::Info).build()?;
16
17 let event_handlers = EventHandlers::default();
18
19 let client = VpnClient::new(config, event_handlers)?;
20
21 let entrypoint = EntrypointBuilder::new()
22 .server(&env::var("VPN_SERVER").unwrap())
23 .username(&env::var("VPN_USERNAME").unwrap())
24 .password(&env::var("VPN_PASSWORD").unwrap())
25 .protocol(protocol)
26 .enable_udp(true)
27 .accept_insecure_cert(true)
28 .build()?;
29
30 client.init_connection(entrypoint)?;
31 client.run_loop()?;
32
33 Ok(())
34}
Trait Implementations§
Auto Trait Implementations§
impl Freeze for EntrypointBuilder
impl RefUnwindSafe for EntrypointBuilder
impl Send for EntrypointBuilder
impl Sync for EntrypointBuilder
impl Unpin for EntrypointBuilder
impl UnwindSafe for EntrypointBuilder
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