pub struct StreamingState {
region: String,
_access_key: String,
_secret_key: String,
ts: DateTime<Utc>,
prior_sig: String,
signing_key: Vec<u8>,
}Expand description
Maximum chunk payload we read from the client before signing. (4 MiB is what the Java/AWS SDKs use, but any size works.) Runtime state for an in-progress streaming upload.
Stored in MyCtx::stream_state and consumed by
MyProxy::request_body_filter to sign each body chunk
as it flows through the proxy.
Fields§
§region: String§_access_key: String§_secret_key: String§ts: DateTime<Utc>§prior_sig: String§signing_key: Vec<u8>Implementations§
Source§impl StreamingState
impl StreamingState
Sourcepub fn new(
region: String,
access_key: String,
secret_key: String,
ts: DateTime<Utc>,
seed_signature: String,
) -> Self
pub fn new( region: String, access_key: String, secret_key: String, ts: DateTime<Utc>, seed_signature: String, ) -> Self
Create a new StreamingState from the seed values produced by
resign_streaming_request.
Sourcepub fn sign_chunk(&mut self, payload: &[u8]) -> Result<Bytes>
pub fn sign_chunk(&mut self, payload: &[u8]) -> Result<Bytes>
Sign a body chunk and return the framed AWS-chunked bytes.
Sourcepub fn final_chunk(&mut self) -> Result<Bytes>
pub fn final_chunk(&mut self) -> Result<Bytes>
Produce the terminal zero-length chunk that signals end-of-stream.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for StreamingState
impl RefUnwindSafe for StreamingState
impl Send for StreamingState
impl Sync for StreamingState
impl Unpin for StreamingState
impl UnsafeUnpin for StreamingState
impl UnwindSafe for StreamingState
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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