pub struct Issue {
pub number: u64,
pub title: String,
pub body: String,
pub state: IssueStateGithub,
pub labels: Vec<String>,
pub assignee: Option<String>,
pub created_at: DateTime<Utc>,
pub updated_at: DateTime<Utc>,
pub url: String,
}Expand description
GitHub Issue
Represents a GitHub issue with its metadata, state, and lifecycle information.
Fields§
§number: u64Issue number (starts at 1 in GitHub)
title: StringIssue title (max 256 characters recommended)
body: StringIssue body/description in Markdown format
state: IssueStateGithubGitHub state (open/closed)
labels: Vec<String>List of label names attached to this issue
assignee: Option<String>Optional GitHub username of assigned user
created_at: DateTime<Utc>Timestamp when the issue was created
updated_at: DateTime<Utc>Timestamp when the issue was last updated
url: StringFull URL to the issue (e.g., “https://github.com/owner/repo/issues/123”)
Implementations§
Source§impl Issue
impl Issue
Sourcepub fn validate(&self) -> Result<(), String>
pub fn validate(&self) -> Result<(), String>
Validate issue fields
§Returns
Ok(())if all validations passErr(String)with detailed error message if validation fails
§Examples
use miyabi_types::issue::{Issue, IssueStateGithub};
let issue = Issue {
number: 123,
title: "Valid issue".to_string(),
body: "Description".to_string(),
state: IssueStateGithub::Open,
labels: vec![],
assignee: None,
created_at: chrono::Utc::now(),
updated_at: chrono::Utc::now(),
url: "https://github.com/owner/repo/issues/123".to_string(),
};
assert!(issue.validate().is_ok());Trait Implementations§
Source§impl<'de> Deserialize<'de> for Issue
impl<'de> Deserialize<'de> for Issue
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Issue, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Issue, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for Issue
impl Serialize for Issue
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for Issue
impl RefUnwindSafe for Issue
impl Send for Issue
impl Sync for Issue
impl Unpin for Issue
impl UnwindSafe for Issue
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FromResponse for Twhere
T: DeserializeOwned,
impl<T> FromResponse for Twhere
T: DeserializeOwned,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more