pub struct SigningRequestBuilder { /* private fields */ }Expand description
Builder for SigningRequest.
Implementations§
Source§impl SigningRequestBuilder
impl SigningRequestBuilder
Sourcepub fn resource_url(self, url: impl Into<String>) -> Self
pub fn resource_url(self, url: impl Into<String>) -> Self
Sets the CloudFront resource URL to sign.
Sourcepub fn resource_pattern(self, pattern: impl Into<String>) -> Self
pub fn resource_pattern(self, pattern: impl Into<String>) -> Self
Sets a wildcard pattern for the policy’s Resource field.
Use this when you want the signed URL to grant access to multiple resources
matching a pattern. If not set, resource_url is used in the policy.
Wildcards:
*matches zero or more characters?matches exactly one character
§Example
ⓘ
// Sign a specific URL but grant access to all files under /videos/
SigningRequest::builder()
.resource_url("https://d111111abcdef8.cloudfront.net/videos/intro.mp4")
.resource_pattern("https://d111111abcdef8.cloudfront.net/videos/*")
// ...Sourcepub fn key_pair_id(self, id: impl Into<String>) -> Self
pub fn key_pair_id(self, id: impl Into<String>) -> Self
Sets the CloudFront key pair ID.
Sourcepub fn private_key(self, key: PrivateKey) -> Self
pub fn private_key(self, key: PrivateKey) -> Self
Sets the private key for signing.
Sourcepub fn expires_at(self, time: DateTime) -> Self
pub fn expires_at(self, time: DateTime) -> Self
Sets an absolute expiration time.
Sourcepub fn expires_in(self, duration: Duration) -> Self
pub fn expires_in(self, duration: Duration) -> Self
Sets a relative expiration time from now.
Sourcepub fn active_at(self, time: DateTime) -> Self
pub fn active_at(self, time: DateTime) -> Self
Sets an activation time (not-before date) for custom policy.
Sourcepub fn ip_range(self, cidr: impl Into<String>) -> Self
pub fn ip_range(self, cidr: impl Into<String>) -> Self
Sets an IP range restriction (CIDR notation) for custom policy.
Sourcepub fn build(self) -> Result<SigningRequest, SigningError>
pub fn build(self) -> Result<SigningRequest, SigningError>
Builds the signing request.
Trait Implementations§
Source§impl Debug for SigningRequestBuilder
impl Debug for SigningRequestBuilder
Source§impl Default for SigningRequestBuilder
impl Default for SigningRequestBuilder
Source§fn default() -> SigningRequestBuilder
fn default() -> SigningRequestBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for SigningRequestBuilder
impl !RefUnwindSafe for SigningRequestBuilder
impl Send for SigningRequestBuilder
impl Sync for SigningRequestBuilder
impl Unpin for SigningRequestBuilder
impl !UnwindSafe for SigningRequestBuilder
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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