Skip to main content

SignedRefsWriter

Struct SignedRefsWriter 

Source
pub struct SignedRefsWriter<'a, R, S> { /* private fields */ }
Expand description

A SignedRefsWriter write a commit to the rad/sigrefs reference of a namespace.

To create a new reader, use SignedRefsWriter::new.

The construction expects:

  • A Refs to write to the commit.
  • A NodeId which identifies the namespace for which rad/sigrefs reference should be read and written to.
  • A repository which is the Git repository being used for reading and writing.
  • A signer which is the entity that produces the cryptographic signature over the Refs.

Implementations§

Source§

impl<'a, R, S> SignedRefsWriter<'a, R, S>
where R: Writer + Reader + Writer + Reader, S: Signer<Signature>,

Source

pub fn new( refs: Refs, namespace: PublicKey, repository: &'a R, signer: &'a S, ) -> SignedRefsWriter<'a, R, S>

Construct a new SignedRefsWriter.

The construction removes the ref SIGREFS_BRANCH from Refs (if present).

When calling SignedRefsWriter::write, if the process is successful, the given Refs will be written to the provided namespace.

Source

pub fn write( self, committer: Committer, message: String, reflog: String, ) -> Result<Update, Write>

Write a commit using the SignedRefsWriter.

The commit written will be composed of:

Note that the SIGREFS_PARENT is not never included in the Refs outside of this process.

This commit is then written to the reference:

refs/namespaces/<namespace>/refs/rad/sigrefs

Auto Trait Implementations§

§

impl<'a, R, S> Freeze for SignedRefsWriter<'a, R, S>

§

impl<'a, R, S> RefUnwindSafe for SignedRefsWriter<'a, R, S>

§

impl<'a, R, S> Send for SignedRefsWriter<'a, R, S>
where R: Sync, S: Sync,

§

impl<'a, R, S> Sync for SignedRefsWriter<'a, R, S>
where R: Sync, S: Sync,

§

impl<'a, R, S> Unpin for SignedRefsWriter<'a, R, S>

§

impl<'a, R, S> UnsafeUnpin for SignedRefsWriter<'a, R, S>

§

impl<'a, R, S> UnwindSafe for SignedRefsWriter<'a, R, S>

Blanket Implementations§

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

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T