Skip to content

Commit

Permalink
make Error +Send + sync
Browse files Browse the repository at this point in the history
  • Loading branch information
Olivier authored and oroulet committed Jan 1, 2025
1 parent 762c821 commit bcdf5fc
Showing 1 changed file with 4 additions and 4 deletions.
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

0 comments on commit bcdf5fc

Please sign in to comment.