Skip to main content

Event

Enum Event 

Source
pub enum Event {
    Commented {
        body: String,
        path: String,
        line: u32,
        blob_oid: String,
    },
    Approved {
        commit: String,
    },
    Rejected {
        commit: String,
        reason: String,
    },
    IssueOpened {
        title: String,
        body: String,
    },
    IssueCommented {
        body: String,
    },
    IssueClosed {
        reason: String,
    },
}
Expand description

What happened.

A closed set on purpose. An open one — a kind: String — would let a client invent an event nobody can fold, and a log that holds events its reader does not understand is a log whose state depends on who is reading it.

Variants§

§

Commented

A comment on a pull request, or — when path is set — on ONE line of ONE file version.

§The anchor follows the code, not the pull request

An empty path is the original per-pull-request comment, and its signed bytes are byte-for-byte what they were before the anchor existed. A non-empty path anchors the comment to (path, line, blob_oid), and the blob is the load-bearing field: it names the exact file version the line lived in. A rebase that does not touch the file leaves that blob’s oid unchanged, so the comment stays on its line; a rebase that rewrites the file gives it a new blob, so the comment stops matching and the line it was about is visibly gone. Anchoring to the pull request number instead would carry the comment onto a rewritten file it was never made on.

Fields

§body: String

What was said.

§path: String

The file the comment is on, as a path within the tree. Empty for a comment on the pull request as a whole.

§line: u32

The one-based line number within blob_oid.

§blob_oid: String

The full hex oid of the blob the commented line lived in.

§

Approved

An approval of a specific commit.

The commit is part of what is signed, so an approval cannot silently come to cover a different tip: force-push after a review and the approval still names the commit that was reviewed, which is exactly the fact an auditor needs and the one a mutable approved: bool destroys.

Fields

§commit: String

The commit that was reviewed.

§

Rejected

A withdrawal of an earlier approval.

Fields

§commit: String

The commit the withdrawn approval named.

§reason: String

Why.

§

IssueOpened

An issue opened.

The one place the forge grows a state machine of its own, because an issue — unlike a pull request’s review — has no crate::pulls record that owns whether it is open. The issue IS the fold of its events, and this is the event that says it exists. Its number is not signed: it is fold_issues’s to assign, so that two readers of the same log agree on it the way they agree on everything else here.

That the OPENING is signed at all is the property GitHub, GitLab and Gitea have no equivalent for: who filed this is the actor’s own sshsig.

Fields

§title: String

A one-line summary.

§body: String

The body, as filed.

§

IssueCommented

A comment on an issue.

The issue number is ForgeEvent::pull — the subject the event is about — so a comment is bound by the signature to its thread.

Fields

§body: String

What was said.

§

IssueClosed

An issue closed, with the reason it was.

Appended, never deleted: what the fold shows is that the issue is shut, and the close — the reason with it — stays readable, which is the fact an auditor wants.

Fields

§reason: String

Why it was closed.

Trait Implementations§

Source§

impl Clone for Event

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Event

Source§

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

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

impl<'de> Deserialize<'de> for Event

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Eq for Event

Source§

impl PartialEq for Event

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for Event

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for Event

Auto Trait Implementations§

§

impl Freeze for Event

§

impl RefUnwindSafe for Event

§

impl Send for Event

§

impl Sync for Event

§

impl Unpin for Event

§

impl UnsafeUnpin for Event

§

impl UnwindSafe for Event

Blanket Implementations§

Source§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,

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<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

Source§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

Source§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

Source§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

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

Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more