flag_set

Struct FlagSet

Source
pub struct FlagSet<T: Eq + Hash>(/* private fields */);

Implementations§

Source§

impl<'a, T: Eq + Hash + Clone> FlagSet<T>

Source

pub fn new(vector: Vec<T>, flag: bool) -> Self

用vector和bool新建实例。
Ccreating an instance with a vector and a boolean value.

Source

pub fn contains(&self, value: T) -> bool

判断集合是否包含值。
Identifying whether set contains value

Trait Implementations§

Source§

impl<T: Eq + Hash + Clone> Add for FlagSet<T>

Source§

fn add(self, other: Self) -> Self::Output

A + B
A和B会销毁,所以用希望保留A和B的话,请使用A.clone() + B.clone()。
A and B will be consumed. If you want to reserve A and B, using A.clone() + B.clone() instead of A + B.

Source§

type Output = FlagSet<T>

The resulting type after applying the + operator.
Source§

impl<T: Eq + Hash + Clone> BitAnd for FlagSet<T>

Source§

fn bitand(self, other: Self) -> Self::Output

A & B
A和B会销毁,所以用希望保留A和B的话,请使用A.clone() & B.clone()。
A and B will be consumed. If you want to reserve A and B, using A.clone() & B.clone() instead of A & B.

Source§

type Output = FlagSet<T>

The resulting type after applying the & operator.
Source§

impl<T: Eq + Hash + Clone> BitXor for FlagSet<T>

Source§

fn bitxor(self, other: Self) -> Self::Output

A ^ B
A和B会销毁,所以用希望保留A和B的话,请使用A.clone() ^ B.clone()。
A and B will be consumed. If you want to reserve A and B, using A.clone() ^ B.clone() instead of A ^ B.

Source§

type Output = FlagSet<T>

The resulting type after applying the ^ operator.
Source§

impl<T: Clone + Eq + Hash> Clone for FlagSet<T>

Source§

fn clone(&self) -> FlagSet<T>

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<T: Debug + Eq + Hash> Debug for FlagSet<T>

Source§

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

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

impl<T: Eq + Hash> Default for FlagSet<T>

Source§

fn default() -> Self

空集。
Creating an empty set.

Source§

impl<T: Eq + Hash + Clone> Not for FlagSet<T>

Source§

fn not(self) -> Self::Output

!A
不同于二(次)元操作,A不会销毁,只转换了A的布尔值。
! operation differs from the above binary operations. A only transforms its bool value. A is not destroyed.

Source§

type Output = FlagSet<T>

The resulting type after applying the ! operator.
Source§

impl<T: PartialEq + Eq + Hash> PartialEq for FlagSet<T>

Source§

fn eq(&self, other: &FlagSet<T>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<T: Eq + Hash + Clone> Sub for FlagSet<T>

Source§

fn sub(self, other: Self) -> Self::Output

A - B
A和B会销毁,所以用希望保留A和B的话,请使用A.clone() - B.clone()。
A and B will be consumed. If you want to reserve A and B, using A.clone() - B.clone() instead of A - B.

Source§

type Output = FlagSet<T>

The resulting type after applying the - operator.
Source§

impl<T: Eq + Eq + Hash> Eq for FlagSet<T>

Source§

impl<T: Eq + Hash> StructuralPartialEq for FlagSet<T>

Auto Trait Implementations§

§

impl<T> Freeze for FlagSet<T>

§

impl<T> RefUnwindSafe for FlagSet<T>
where T: RefUnwindSafe,

§

impl<T> Send for FlagSet<T>
where T: Send,

§

impl<T> Sync for FlagSet<T>
where T: Sync,

§

impl<T> Unpin for FlagSet<T>
where T: Unpin,

§

impl<T> UnwindSafe for FlagSet<T>
where T: UnwindSafe,

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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,

Source§

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>,

Source§

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>,

Source§

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.