#[non_exhaustive]pub enum Request {
Trigger {
common: EventCommonFields,
push: Option<PushEvent>,
patch: Option<PatchEvent>,
},
}
Expand description
A request message sent by the broker to its adapter child process.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Trigger
Trigger a run.
Fields
§
common: EventCommonFields
Common fields for all message variants.
§
patch: Option<PatchEvent>
The patch event, if any.
Implementations§
Source§impl Request
impl Request
Sourcepub fn commit(&self) -> Result<Oid, MessageError>
pub fn commit(&self) -> Result<Oid, MessageError>
Return the commit the event concerns. In other words, the commit that CI should run against.
Sourcepub fn to_json_pretty(&self) -> Result<String, MessageError>
pub fn to_json_pretty(&self) -> Result<String, MessageError>
Serialize the request as a pretty JSON, including the newline. This is meant for the broker to use.
Sourcepub fn to_writer<W: Write>(&self, writer: W) -> Result<(), MessageError>
pub fn to_writer<W: Write>(&self, writer: W) -> Result<(), MessageError>
Serialize the request as a single-line JSON, including the newline. This is meant for the broker to use.
Sourcepub fn from_reader<R: Read>(reader: R) -> Result<Self, MessageError>
pub fn from_reader<R: Read>(reader: R) -> Result<Self, MessageError>
Read a request from a reader. This is meant for the adapter to use.
Sourcepub fn try_from_str(s: &str) -> Result<Self, MessageError>
pub fn try_from_str(s: &str) -> Result<Self, MessageError>
Parse a request from a string. This is meant for tests to use.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Request
impl<'de> Deserialize<'de> for Request
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 Request
impl RefUnwindSafe for Request
impl Send for Request
impl Sync for Request
impl Unpin for Request
impl UnwindSafe for Request
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