pub enum GitiverseRequest {
RepoInfo {
repo_id: RepoId,
},
RefsList {
repo_id: RepoId,
prefix: Option<String>,
},
RefsUpdate {
repo_id: RepoId,
updates: Vec<RefUpdate>,
signed_refs: Option<SignedRefMap>,
},
PackFetch {
repo_id: RepoId,
wants: Vec<String>,
haves: Vec<String>,
},
PackPush {
repo_id: RepoId,
pack_bytes: Vec<u8>,
updates: Vec<RefUpdate>,
signed_refs: Option<SignedRefMap>,
},
CobSync {
repo_id: RepoId,
kind: String,
object_id: Option<String>,
have_tips: Vec<String>,
ops_cbor: Vec<Vec<u8>>,
},
ChecksList {
repo_id: RepoId,
commit_oid: String,
},
ChecksAttest {
repo_id: RepoId,
attestation_cbor: Vec<u8>,
},
InviteRedeem {
repo_id: RepoId,
invite_code: Vec<u8>,
},
}Expand description
Versioned canonical CBOR requests for exadev.io/gitiverse.
Variants§
RepoInfo
RefsList
RefsUpdate
PackFetch
PackPush
Fields
§
signed_refs: Option<SignedRefMap>CobSync
Fields
ChecksList
ChecksAttest
InviteRedeem
Implementations§
Source§impl GitiverseRequest
impl GitiverseRequest
pub const fn verb(&self) -> &'static str
pub const fn repo_id(&self) -> RepoId
Sourcepub fn required_action(&self) -> RepoAction
pub fn required_action(&self) -> RepoAction
Returns the repository action required to execute this specific request.
Sourcepub fn capability_verb(&self) -> &'static str
pub fn capability_verb(&self) -> &'static str
Returns the wire-mesh capability verb associated with this request.
pub fn encode_cbor(&self) -> Vec<u8> ⓘ
pub fn decode_cbor(bytes: &[u8]) -> Result<Self, ProtocolError>
Sourcepub fn to_manage_command(&self) -> ManageCommand
pub fn to_manage_command(&self) -> ManageCommand
Converts this request into a wire-mesh ManageCommand with canonical CBOR map params.
Sourcepub fn from_manage_command(
command: &ManageCommand,
) -> Result<Self, ProtocolError>
pub fn from_manage_command( command: &ManageCommand, ) -> Result<Self, ProtocolError>
Decodes a gitiverse request from a ManageCommand, checking the outer capability verb matches.
Trait Implementations§
Source§impl Clone for GitiverseRequest
impl Clone for GitiverseRequest
Source§impl Debug for GitiverseRequest
impl Debug for GitiverseRequest
Source§impl Decode<'_, ()> for GitiverseRequest
impl Decode<'_, ()> for GitiverseRequest
Source§impl Encode<()> for GitiverseRequest
impl Encode<()> for GitiverseRequest
impl Eq for GitiverseRequest
Source§impl PartialEq for GitiverseRequest
impl PartialEq for GitiverseRequest
impl StructuralPartialEq for GitiverseRequest
Auto Trait Implementations§
impl Forget for GitiverseRequest
impl Freeze for GitiverseRequestwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<RefUpdate>: Freeze,
*const LeafNode<String, String> is !null: Freeze,
PhantomData<(Owned, LeafOrInternal)>: Freeze,
PhantomData<Box<(String, String)>>: Freeze,
PhantomData<String>: Freeze,
PhantomData<Vec<u8>>: Freeze,
impl Move for GitiverseRequest
impl RefUnwindSafe for GitiverseRequest
impl Send for GitiverseRequest
impl Sync for GitiverseRequest
impl Unpin for GitiverseRequest
impl UnsafeUnpin for GitiverseRequestwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<RefUpdate>: UnsafeUnpin,
*const LeafNode<String, String> is !null: UnsafeUnpin,
PhantomData<(Owned, LeafOrInternal)>: UnsafeUnpin,
PhantomData<Box<(String, String)>>: UnsafeUnpin,
PhantomData<String>: UnsafeUnpin,
PhantomData<Vec<u8>>: UnsafeUnpin,
impl UnwindSafe for GitiverseRequest
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