Skip to main content

WriteRepository

Trait WriteRepository 

Source
pub trait WriteRepository: ReadRepository + SignRepository {
    // Required methods
    fn set_symbolic_ref<Name, Target>(
        &self,
        name: &Name,
        target: &Target,
        message: &str,
    ) -> Result<(), RepositoryError>
       where Name: AsRef<RefStr>,
             Target: AsRef<RefStr>;
    fn set_default_branch_to_canonical_head(
        &self,
    ) -> Result<SetHead, RepositoryError>;
    fn set_remote_identity_root_to(
        &self,
        remote: &PublicKey,
        root: Oid,
    ) -> Result<(), RepositoryError>;
    fn set_identity_head_to(&self, commit: Oid) -> Result<(), RepositoryError>;
    fn set_user(&self, info: &UserInfo) -> Result<(), Error>;
    fn raw(&self) -> &Repository;

    // Provided methods
    fn set_canonical_symbolic_refs(
        &self,
        message: &str,
    ) -> Result<(), RepositoryError> { ... }
    fn set_identity_head(&self) -> Result<Oid, RepositoryError> { ... }
    fn set_remote_identity_root(
        &self,
        remote: &PublicKey,
    ) -> Result<Oid, RepositoryError> { ... }
}
Expand description

Allows read-write access to a repository.

Required Methods§

Source

fn set_symbolic_ref<Name, Target>( &self, name: &Name, target: &Target, message: &str, ) -> Result<(), RepositoryError>
where Name: AsRef<RefStr>, Target: AsRef<RefStr>,

Sets a symbolic reference, if it does not exist or its target is different from the given one.

Source

fn set_default_branch_to_canonical_head( &self, ) -> Result<SetHead, RepositoryError>

Computes the head of the default branch based on the delegate set, and sets it.

Source

fn set_remote_identity_root_to( &self, remote: &PublicKey, root: Oid, ) -> Result<(), RepositoryError>

Set the identity root reference to the given commit.

Source

fn set_identity_head_to(&self, commit: Oid) -> Result<(), RepositoryError>

Set the repository ‘rad/id’ to the given commit.

Source

fn set_user(&self, info: &UserInfo) -> Result<(), Error>

Set the user info of the Git repository.

Source

fn raw(&self) -> &Repository

Get the underlying git repository.

Provided Methods§

Source

fn set_canonical_symbolic_refs( &self, message: &str, ) -> Result<(), RepositoryError>

Sets the canonical symbolic references.

This only depends on canonical references (thus the xyz.radicle.crefs payload, and possibly the xyz.radicle.project payload in the identity document). The targeted canonical references are not computed and might not even exist.

Source

fn set_identity_head(&self) -> Result<Oid, RepositoryError>

Set the repository ‘rad/id’ to the canonical commit, agreed by quorum.

Source

fn set_remote_identity_root( &self, remote: &PublicKey, ) -> Result<Oid, RepositoryError>

Set the identity root reference to the canonical identity root commit.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§