Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make Error +Send + sync #17

Merged
merged 1 commit into from
Jan 1, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions opcua-types/src/encoding.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ pub struct Error {
status: StatusCode,
request_id: Option<u32>,
request_handle: Option<u32>,
context: Box<dyn StdError>,
context: Box<dyn StdError + Send + Sync>,
}

impl Display for Error {
Expand All @@ -69,7 +69,7 @@ impl Display for Error {
impl Error {
/// Create a new error with the specified `status` code and
/// `context` as a dynamic error source.
pub fn new(status: StatusCode, context: impl Into<Box<dyn StdError>>) -> Self {
pub fn new(status: StatusCode, context: impl Into<Box<dyn StdError + Send + Sync>>) -> Self {
Self {
status,
request_handle: None,
Expand All @@ -80,7 +80,7 @@ impl Error {

/// Create a new error with status code `BadDecodingError` and
/// `context` as a dynamic error source.
pub fn decoding(context: impl Into<Box<dyn StdError>>) -> Self {
pub fn decoding(context: impl Into<Box<dyn StdError + Send + Sync>>) -> Self {
Self {
status: StatusCode::BadDecodingError,
request_handle: None,
Expand All @@ -91,7 +91,7 @@ impl Error {

/// Create a new error with status code `BadEncodingError` and
/// `context` as a dynamic error source.
pub fn encoding(context: impl Into<Box<dyn StdError>>) -> Self {
pub fn encoding(context: impl Into<Box<dyn StdError + Send + Sync>>) -> Self {
Self {
status: StatusCode::BadEncodingError,
request_handle: None,
Expand Down
Loading