pub struct Patch {
pub content: String,
pub repo: Coordinate,
pub repo_euc: Option<String>,
pub mentions: Vec<PublicKey>,
pub root: bool,
pub root_revision: bool,
pub commit: Option<String>,
pub parent_commit: Option<String>,
pub commit_pgp_sig: Option<String>,
pub committer: Option<Committer>,
}Expand description
Typed bundle for the kind: 1617 patch event.
Fields§
§content: String.content — full git format-patch output.
repo: CoordinateRepository pointer.
repo_euc: Option<String>Earliest-unique-commit hex of the target repo (mirrors
Repository::earliest_unique_commit).
mentions: Vec<PublicKey>People to notify (maintainers + ad-hoc reviewers).
root: boolt:root on the first patch in a series.
root_revision: boolt:root-revision on the first patch in a revision.
commit: Option<String>Optional commit hex (for stable-id replay).
parent_commit: Option<String>Optional parent-commit hex.
commit_pgp_sig: Option<String>Optional PGP signature blob.
committer: Option<Committer>Optional ["committer", name, email, timestamp, offset] row.
Implementations§
Source§impl Patch
impl Patch
Sourcepub fn new(repo: Coordinate, content: impl Into<String>) -> Self
pub fn new(repo: Coordinate, content: impl Into<String>) -> Self
Construct a patch bundle.
Render the typed bundle to the public tag list.
Sourcepub fn from_event(event: &Event) -> Result<Self, Nip34Error>
pub fn from_event(event: &Event) -> Result<Self, Nip34Error>
Parse a signed kind-1617 event into a typed bundle.
§Errors
Returns Nip34Error::WrongKind for the wrong kind;
returns Nip34Error::MissingRepository when the a tag
is absent; forwards every coordinate / pubkey parse error.
Trait Implementations§
impl Eq for Patch
impl StructuralPartialEq for Patch
Auto Trait Implementations§
impl Freeze for Patch
impl RefUnwindSafe for Patch
impl Send for Patch
impl Sync for Patch
impl Unpin for Patch
impl UnsafeUnpin for Patch
impl UnwindSafe for Patch
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.