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:
Implementations§
Source§impl<'a, R, S> SignedRefsWriter<'a, R, S>
impl<'a, R, S> SignedRefsWriter<'a, R, S>
Sourcepub fn new(
refs: Refs,
namespace: PublicKey,
repository: &'a R,
signer: &'a S,
) -> SignedRefsWriter<'a, R, S>
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.
Sourcepub fn write(
self,
committer: Committer,
message: String,
reflog: String,
) -> Result<Update, Write>
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:
- The parent commit of the previous entry, unless it is the root commit.
- The
Refsunder the/refsblob. TheRefsmust include:- The
SIGREFS_PARENTentry. - The
IDENTITY_ROOTentry.
- The
- The
crypto::Signatureof theRefsbytes, under the/signatureblob.
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/sigrefsAuto Trait Implementations§
impl<'a, R, S> Freeze for SignedRefsWriter<'a, R, S>
impl<'a, R, S> RefUnwindSafe for SignedRefsWriter<'a, R, S>where
R: RefUnwindSafe,
S: RefUnwindSafe,
impl<'a, R, S> Send for SignedRefsWriter<'a, R, S>
impl<'a, R, S> Sync for SignedRefsWriter<'a, R, S>
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>where
R: RefUnwindSafe,
S: RefUnwindSafe,
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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