pub enum Response {
Triggered {
run_id: RunId,
info_url: Option<String>,
},
Finished {
result: RunResult,
},
}
Expand description
A response message from the adapter child process to the broker.
Variants§
Implementations§
Source§impl Response
impl Response
Sourcepub fn triggered(run_id: RunId) -> Self
pub fn triggered(run_id: RunId) -> Self
Create a Response::Triggered
message without an info URL.
Sourcepub fn triggered_with_url(run_id: RunId, url: &str) -> Self
pub fn triggered_with_url(run_id: RunId, url: &str) -> Self
Create a Response::Triggered
message with an info URL.
Sourcepub fn to_writer<W: Write>(&self, writer: W) -> Result<(), MessageError>
pub fn to_writer<W: Write>(&self, writer: W) -> Result<(), MessageError>
Serialize a response as a single-line JSON, including the newline. This is meant for the adapter to use.
Sourcepub fn to_json_pretty(&self) -> Result<String, MessageError>
pub fn to_json_pretty(&self) -> Result<String, MessageError>
Serialize the response as a pretty JSON, including the newline. This is meant for the broker to use.
Sourcepub fn from_reader<R: Read + BufRead>(
reader: &mut R,
) -> Result<Option<Self>, MessageError>
pub fn from_reader<R: Read + BufRead>( reader: &mut R, ) -> Result<Option<Self>, MessageError>
Read a response from a reader. This is meant for the broker to use.
Sourcepub fn from_str(line: &str) -> Result<Self, MessageError>
pub fn from_str(line: &str) -> Result<Self, MessageError>
Read a response from a string slice. This is meant for the broker to use.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Response
impl<'de> Deserialize<'de> for Response
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Response
impl RefUnwindSafe for Response
impl Send for Response
impl Sync for Response
impl Unpin for Response
impl UnwindSafe for Response
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