Struct thrift_codec::data::Set

source ·
pub struct Set { /* private fields */ }
Expand description

Set.

Note that internally this has the same representation with List. No duplicate elements are removed.

Implementations§

source§

impl Set

source

pub fn new(elements: Elements) -> Self

Makes a new Set instance.

Methods from Deref<Target = Elements>§

source

pub fn get(&self, index: usize) -> Option<DataRef<'_>>

Returns the element placed at the specified index.

source

pub fn len(&self) -> usize

Returns the element count of this sequence.

source

pub fn is_empty(&self) -> bool

Returns true if this sequence has no elements.

source

pub fn iter(&self) -> ElementIter<'_>

Returns an iterator over the elements of this sequence.

source

pub fn kind(&self) -> DataKind

Returns the kind of the elements in this sequence.

Trait Implementations§

source§

impl BinaryDecode for Set

source§

fn binary_decode<R: Read>(reader: &mut R) -> Result<Self>

Decodes an object.
source§

impl BinaryEncode for Set

source§

fn binary_encode<W: Write>(&self, writer: &mut W) -> Result<()>

Encodes an object.
source§

impl Clone for Set

source§

fn clone(&self) -> Set

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl CompactDecode for Set

source§

fn compact_decode<R: Read>(reader: &mut R) -> Result<Self>

Decodes an object.
source§

impl CompactEncode for Set

source§

fn compact_encode<W: Write>(&self, writer: &mut W) -> Result<()>

Encodes an object.
source§

impl Debug for Set

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Deref for Set

§

type Target = Elements

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl From<Set> for Data

source§

fn from(f: Set) -> Self

Converts to this type from the input type.
source§

impl From<Vec<List>> for Set

source§

fn from(f: Vec<List>) -> Self

Converts to this type from the input type.
source§

impl From<Vec<Map>> for Set

source§

fn from(f: Vec<Map>) -> Self

Converts to this type from the input type.
source§

impl From<Vec<Set>> for Set

source§

fn from(f: Vec<Set>) -> Self

Converts to this type from the input type.
source§

impl From<Vec<Struct>> for Set

source§

fn from(f: Vec<Struct>) -> Self

Converts to this type from the input type.
source§

impl From<Vec<Uuid>> for Set

source§

fn from(f: Vec<Uuid>) -> Self

Converts to this type from the input type.
source§

impl From<Vec<Vec<u8>>> for Set

source§

fn from(f: Vec<Vec<u8>>) -> Self

Converts to this type from the input type.
source§

impl From<Vec<bool>> for Set

source§

fn from(f: Vec<bool>) -> Self

Converts to this type from the input type.
source§

impl From<Vec<f64>> for Set

source§

fn from(f: Vec<f64>) -> Self

Converts to this type from the input type.
source§

impl From<Vec<i16>> for Set

source§

fn from(f: Vec<i16>) -> Self

Converts to this type from the input type.
source§

impl From<Vec<i32>> for Set

source§

fn from(f: Vec<i32>) -> Self

Converts to this type from the input type.
source§

impl From<Vec<i64>> for Set

source§

fn from(f: Vec<i64>) -> Self

Converts to this type from the input type.
source§

impl From<Vec<i8>> for Set

source§

fn from(f: Vec<i8>) -> Self

Converts to this type from the input type.
source§

impl PartialEq for Set

source§

fn eq(&self, other: &Set) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl StructuralPartialEq for Set

Auto Trait Implementations§

§

impl RefUnwindSafe for Set

§

impl Send for Set

§

impl Sync for Set

§

impl Unpin for Set

§

impl UnwindSafe for Set

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.