Skip to main content

nominal_api/conjure/objects/persistent/compute/api/
client_message_error.rs

1/// This will be sent if there is an error processing a `ClientMessage`. Note: This won't automatically close
2/// the connection. The client can continue sending `ClientMessage`s after receiving this error.
3#[derive(
4    Debug,
5    Clone,
6    conjure_object::serde::Serialize,
7    conjure_object::serde::Deserialize,
8    PartialEq,
9    Eq,
10    PartialOrd,
11    Ord,
12    Hash
13)]
14#[serde(crate = "conjure_object::serde")]
15#[conjure_object::private::staged_builder::staged_builder]
16#[builder(crate = conjure_object::private::staged_builder, update, inline)]
17pub struct ClientMessageError {
18    #[builder(
19        custom(
20            type = super::super::super::super::api::SerializableError,
21            convert = Box::new
22        )
23    )]
24    #[serde(rename = "error")]
25    error: Box<super::super::super::super::api::SerializableError>,
26}
27impl ClientMessageError {
28    /// Constructs a new instance of the type.
29    #[inline]
30    pub fn new(error: super::super::super::super::api::SerializableError) -> Self {
31        Self::builder().error(error).build()
32    }
33    #[inline]
34    pub fn error(&self) -> &super::super::super::super::api::SerializableError {
35        &*self.error
36    }
37}