pub struct Action {
pub href: String,
pub header: HashMap<String, String>,
pub expires_in: Option<i64>,
pub expires_at: Option<String>,
}Expand description
One concrete HTTP request the transfer adapter should make.
Fields§
§href: StringAbsolute URL to dial.
header: HashMap<String, String>Headers to include with the request (typically Authorization).
expires_in: Option<i64>Seconds until the action URL stops being valid. Preferred over
expires_at when both are given. Per the spec, range is roughly
±2^31 seconds.
expires_at: Option<String>Absolute uppercase RFC 3339 timestamp at which the action URL
stops being valid. Carried as a string (see Lock).
Implementations§
Source§impl Action
impl Action
Sourcepub fn is_expired_within(&self, now: SystemTime, buffer: Duration) -> bool
pub fn is_expired_within(&self, now: SystemTime, buffer: Duration) -> bool
Has this action expired (or will it within buffer)?
Mirrors upstream’s tq.Action.IsExpiredWithin /
tools.IsExpiredAtOrIn: expires_in is taken relative to
now (preferred when non-zero), otherwise expires_at is
parsed as RFC 3339. An action without either field never
expires. The check is expiration < now + buffer — i.e. the
action must have at least buffer of validity left.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Action
impl<'de> Deserialize<'de> for Action
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for Action
impl StructuralPartialEq for Action
Auto Trait Implementations§
impl Freeze for Action
impl RefUnwindSafe for Action
impl Send for Action
impl Sync for Action
impl Unpin for Action
impl UnsafeUnpin for Action
impl UnwindSafe for Action
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.