InboundData

Struct InboundData 

Source
pub struct InboundData {
Show 18 fields pub sender: User, pub action: Option<String>, pub repository: Option<Repository>, pub organization: Option<Organization>, pub comment: Option<Comment>, pub discussion: Option<Discussion>, pub forkee: Option<Repository>, pub issue: Option<Issue>, pub label: Option<Label>, pub marketplace_purchase: Option<MarketplacePurchase>, pub pull_request: Option<PullRequest>, pub review: Option<Review>, pub release: Option<Release>, pub starred_at: Option<String>, pub workflow_job: Option<WorkflowJob>, pub head_commit: Option<Commit>, pub commits: Option<Vec<Commit>>, pub extra: HashMap<String, Value>,
}

Fields§

§sender: User§action: Option<String>§repository: Option<Repository>§organization: Option<Organization>§comment: Option<Comment>§discussion: Option<Discussion>§forkee: Option<Repository>§issue: Option<Issue>§label: Option<Label>§marketplace_purchase: Option<MarketplacePurchase>§pull_request: Option<PullRequest>§review: Option<Review>§release: Option<Release>§starred_at: Option<String>§workflow_job: Option<WorkflowJob>§head_commit: Option<Commit>§commits: Option<Vec<Commit>>§extra: HashMap<String, Value>

Implementations§

Source§

impl InboundData

Source

pub fn get<T: DeserializeOwned, I: ToString>( &self, index: &I, ) -> Result<T, String>

Gets the value from extra and deserializes into T.

eg.

let r#ref: String = payload.get("ref").unwrap();
Source

pub fn get_action(&self) -> Result<&String, String>

Source

pub fn get_repository(&self) -> Result<&Repository, String>

Source

pub fn get_comment(&self) -> Result<&Comment, String>

Source

pub fn get_discussion(&self) -> Result<&Discussion, String>

Source

pub fn get_fork(&self) -> Result<&Repository, String>

Source

pub fn get_issue(&self) -> Result<&Issue, String>

Source

pub fn get_label(&self) -> Result<&Label, String>

Source

pub fn get_marketplace_purchase(&self) -> Result<&MarketplacePurchase, String>

Source

pub fn get_pull_request(&self) -> Result<&PullRequest, String>

Source

pub fn get_review(&self) -> Result<&Review, String>

Source

pub fn get_release(&self) -> Result<&Release, String>

Source

pub fn get_starred_at(&self) -> Result<&String, String>

Source

pub fn get_workflow_job(&self) -> Result<&WorkflowJob, String>

Source

pub fn get_head_commit(&self) -> Result<&Commit, String>

Source

pub fn get_commits(&self) -> Result<&Vec<Commit>, String>

Trait Implementations§

Source§

impl Debug for InboundData

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for InboundData

Source§

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§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,