Skip to content

Commit

Permalink
Refactor Session into its own module, and use traits to define caller…
Browse files Browse the repository at this point in the history
… interfaces
  • Loading branch information
locka99 committed Aug 5, 2021
1 parent 86a0e18 commit 5a3da2e
Show file tree
Hide file tree
Showing 9 changed files with 2,130 additions and 1,920 deletions.
7 changes: 5 additions & 2 deletions client/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,11 @@ use opcua_types::{

use crate::{
config::{ClientConfig, ClientEndpoint, ANONYMOUS_USER_TOKEN_ID},
session::{Session, SessionInfo},
session_retry::SessionRetryPolicy,
session::{
services::*,
session::{Session, SessionInfo},
},
session_retry_policy::SessionRetryPolicy,
};

#[derive(Debug, Clone)]
Expand Down
2 changes: 1 addition & 1 deletion client/src/comms/tcp_transport.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ use crate::{
callbacks::OnSessionClosed,
comms::transport::Transport,
message_queue::{self, MessageQueue},
session_state::{ConnectionState, ConnectionStateMgr, SessionState},
session::session_state::{ConnectionState, ConnectionStateMgr, SessionState},
};
use tokio::io::AsyncWriteExt;

Expand Down
2 changes: 1 addition & 1 deletion client/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use opcua_core::config::Config;
use opcua_crypto::SecurityPolicy;
use opcua_types::{ApplicationType, MessageSecurityMode, UAString};

use crate::session_retry::SessionRetryPolicy;
use crate::session_retry_policy::SessionRetryPolicy;

pub const ANONYMOUS_USER_TOKEN_ID: &str = "ANONYMOUS";

Expand Down
10 changes: 7 additions & 3 deletions client/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ use opcua_types::{response_header::ResponseHeader, status_code::StatusCode};

mod comms;
mod message_queue;
mod session_state;
mod subscription;
mod subscription_state;

Expand All @@ -116,7 +115,7 @@ mod callbacks;
mod client;
mod config;
mod session;
mod session_retry;
mod session_retry_policy;

/// Process the service result, i.e. where the request "succeeded" but the response
/// contains a failure status code.
Expand Down Expand Up @@ -154,7 +153,12 @@ pub mod prelude {
pub use opcua_types::{service_types::*, status_code::StatusCode};

pub use crate::{
builder::*, callbacks::*, client::*, config::*, session::*, subscription::MonitoredItem,
builder::*,
callbacks::*,
client::*,
config::*,
session::{services::*, session::*},
subscription::MonitoredItem,
};
}

Expand Down
3 changes: 3 additions & 0 deletions client/src/session/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
pub mod services;
pub mod session;
pub mod session_state;
Loading

0 comments on commit 5a3da2e

Please sign in to comment.