pub struct TargetsMetadataBuilder { /* private fields */ }Expand description
Helper to construct TargetsMetadata.
Implementations§
Source§impl TargetsMetadataBuilder
impl TargetsMetadataBuilder
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new TargetsMetadataBuilder. It defaults to:
- version: 1
- expires: 90 days from the current time.
Sourcepub fn insert_target_from_slice(
self,
path: TargetPath,
buf: &[u8],
hash_algs: &[HashAlgorithm],
) -> Result<Self>
pub fn insert_target_from_slice( self, path: TargetPath, buf: &[u8], hash_algs: &[HashAlgorithm], ) -> Result<Self>
Add target to the target metadata.
Sourcepub async fn insert_target_from_reader<R>(
self,
path: TargetPath,
read: R,
hash_algs: &[HashAlgorithm],
) -> Result<Self>
pub async fn insert_target_from_reader<R>( self, path: TargetPath, read: R, hash_algs: &[HashAlgorithm], ) -> Result<Self>
Add target to the target metadata.
Sourcepub fn insert_target_description(
self,
path: TargetPath,
description: TargetDescription,
) -> Self
pub fn insert_target_description( self, path: TargetPath, description: TargetDescription, ) -> Self
Add TargetDescription to this target metadata target description.
Sourcepub fn delegations(self, delegations: Delegations) -> Self
pub fn delegations(self, delegations: Delegations) -> Self
Add Delegations to this target metadata.
Sourcepub fn build(self) -> Result<TargetsMetadata>
pub fn build(self) -> Result<TargetsMetadata>
Construct a new TargetsMetadata.
Sourcepub fn signed<D>(
self,
private_key: &dyn PrivateKey,
) -> Result<SignedMetadata<D, TargetsMetadata>>where
D: Pouf,
pub fn signed<D>(
self,
private_key: &dyn PrivateKey,
) -> Result<SignedMetadata<D, TargetsMetadata>>where
D: Pouf,
Construct a new SignedMetadata<D, TargetsMetadata>.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TargetsMetadataBuilder
impl RefUnwindSafe for TargetsMetadataBuilder
impl Send for TargetsMetadataBuilder
impl Sync for TargetsMetadataBuilder
impl Unpin for TargetsMetadataBuilder
impl UnsafeUnpin for TargetsMetadataBuilder
impl UnwindSafe for TargetsMetadataBuilder
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