pub struct TagSet(pub Vec<(String, String)>);Expand description
An ordered tag set. Insertion order is preserved (mirrors the AWS
XML wire format, which is order-significant for the response). For
duplicates on the same key, the last pair wins on lookup, matching
AWS S3 behaviour for x-amz-tagging.
Tuple Fields§
§0: Vec<(String, String)>Implementations§
Source§impl TagSet
impl TagSet
Sourcepub fn from_pairs(pairs: Vec<(String, String)>) -> Result<Self, TagError>
pub fn from_pairs(pairs: Vec<(String, String)>) -> Result<Self, TagError>
Construct a tag set from (key, value) pairs, validating the
AWS S3 limits (max 10, key ≤ 128 B, value ≤ 256 B). Duplicate
keys are retained in insertion order; lookup picks the last one.
Sourcepub fn get(&self, key: &str) -> Option<&str>
pub fn get(&self, key: &str) -> Option<&str>
Look up the value for key. Last-wins on duplicates.
Sourcepub fn iter(&self) -> impl Iterator<Item = &(String, String)>
pub fn iter(&self) -> impl Iterator<Item = &(String, String)>
Iterate the pairs in insertion order.
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Trait Implementations§
Source§impl<'de> Deserialize<'de> for TagSet
impl<'de> Deserialize<'de> for TagSet
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>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for TagSet
impl StructuralPartialEq for TagSet
Auto Trait Implementations§
impl Freeze for TagSet
impl RefUnwindSafe for TagSet
impl Send for TagSet
impl Sync for TagSet
impl Unpin for TagSet
impl UnsafeUnpin for TagSet
impl UnwindSafe for TagSet
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§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
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
Compare self to
key and return true if they are equal.