跳到主要内容

Flags

搜索

结构体 Flags 

源代码
pub struct Flags(/* 私有字段 */);

实现§

源代码§

impl Flags

源代码

pub const FAST_BILINEAR: Self

源代码

pub const BILINEAR: Self

源代码

pub const BICUBIC: Self

源代码

pub const X: Self

源代码

pub const POINT: Self

源代码

pub const AREA: Self

源代码

pub const BICUBLIN: Self

源代码

pub const GAUSS: Self

源代码

pub const SINC: Self

源代码

pub const LANCZOS: Self

源代码

pub const SPLINE: Self

源代码

pub const SRC_V_CHR_DROP_MASK: Self

源代码

pub const SRC_V_CHR_DROP_SHIFT: Self

源代码

pub const PARAM_DEFAULT: Self

源代码

pub const PRINT_INFO: Self

源代码

pub const FULL_CHR_H_INT: Self

源代码

pub const FULL_CHR_H_INP: Self

源代码

pub const DIRECT_BGR: Self

源代码

pub const ACCURATE_RND: Self

源代码

pub const BITEXACT: Self

源代码

pub const ERROR_DIFFUSION: Self

源代码§

impl Flags

源代码

pub const fn empty() -> Self

获取一个所有位均为 0 的 flags 值。

源代码

pub const fn all() -> Self

获取一个所有已知位均为 1 的 flags 值。

源代码

pub const fn bits(&self) -> c_int

获取底层的位值。返回值正是该 flags 值中已设置的位。

源代码

pub const fn from_bits(bits: c_int) -> Option<Self>

从位值转换。若设置了任何未知位,则该方法将返回 None。

源代码

pub const fn from_bits_truncate(bits: c_int) -> Self

从位值转换,未知的位会被清除。

源代码

pub const fn from_bits_retain(bits: c_int) -> Self

按位值原样转换(保留所有位)。

源代码

pub fn from_name(name: &str) -> Option<Self>

获取一个 flags 值,其位为具有给定名称的 flag 所对应的位。若 name 为空或不与任何已命名的 flag 对应,则该方法将返回 None。

源代码

pub const fn is_empty(&self) -> bool

判断 self 中的所有位是否都未设置。

源代码

pub const fn is_all(&self) -> bool

判断该 flags 值的所有已知位是否都已设置。

源代码

pub const fn intersects(&self, other: Self) -> bool

判断 other 中是否至少有一位也在 self 中被设置。

源代码

pub const fn contains(&self, other: Self) -> bool

判断 other 中所有已设置的位是否都在 self 中被设置(即 self ⊇ other)。

源代码

pub fn insert(&mut self, other: Self)

self 与 other 的按位或(|)。

源代码

pub fn remove(&mut self, other: Self)

self 与 other 的补的交集(&!)。当 other 含有未知位时,该方法不等价于 self & !other。remove 不会截断 other,而 ! 运算符会。

源代码

pub fn toggle(&mut self, other: Self)

self 与 other 的按位异或(^)。

源代码

pub fn set(&mut self, other: Self, value: bool)

当 value 为 true 时调用 insert,当 value 为 false 时调用 remove。

源代码

pub const fn intersection(self, other: Self) -> Self

self 与 other 的按位与(&)。

源代码

pub const fn union(self, other: Self) -> Self

self 与 other 的按位或(|)。

源代码

pub const fn difference(self, other: Self) -> Self

self 与 other 的补的交集(&!)。当 other 含有未知位时,该方法不等价于 self & !other。该方法不会截断 other,而 ! 运算符会。

源代码

pub const fn symmetric_difference(self, other: Self) -> Self

self 与 other 的按位异或(^)。

源代码

pub const fn complement(self) -> Self

对 self 的位按位取反(!),并截断结果。

源代码§

impl Flags

源代码

pub const fn iter(&self) -> Iter<Flags>

Yield a set of contained flags values.

每个产出的 flag 值对应一个已定义的具名 flag。任何未知位将作为最终的flags 值一起产出。

源代码

pub const fn iter_names(&self) -> IterNames<Flags>

逐个产出该 flags 值中所包含的已命名 flag 集合。

This method is like iter, except only yields bits in contained named flags. Any unknown bits, or bits not corresponding to a contained flag will not be yielded.

trait 实现§

源代码§

impl Binary for Flags

源代码§

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

使用给定的格式化器格式化该值。 阅读更多
源代码§

impl BitAnd for Flags

源代码§

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

self 与 other 的按位与(&)。

源代码§

type Output = Flags

应用 & 运算符后得到的类型。
源代码§

impl BitAndAssign for Flags

源代码§

fn bitand_assign(&mut self, other: Self)

self 与 other 的按位与(&)。

源代码§

impl BitOr for Flags

源代码§

fn bitor(self, other: Flags) -> Self

self 与 other 的按位或(|)。

源代码§

type Output = Flags

应用 | 运算符后得到的类型。
源代码§

impl BitOrAssign for Flags

源代码§

fn bitor_assign(&mut self, other: Self)

self 与 other 的按位或(|)。

源代码§

impl BitXor for Flags

源代码§

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

self 与 other 的按位异或(^)。

源代码§

type Output = Flags

应用 ^ 运算符后得到的类型。
源代码§

impl BitXorAssign for Flags

源代码§

fn bitxor_assign(&mut self, other: Self)

self 与 other 的按位异或(^)。

源代码§

impl Clone for Flags

源代码§

fn clone(&self) -> Flags

返回值的副本。 阅读更多
1.0.0 · 源代码§

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

source 执行拷贝赋值。 阅读更多
源代码§

impl Debug for Flags

源代码§

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

使用给定的格式化器格式化该值。 阅读更多
源代码§

impl Extend<Flags> for Flags

源代码§

fn extend<T: IntoIterator<Item = Self>>(&mut self, iterator: T)

对每个 flags 值按位取或(|)。

源代码§

fn extend_one(&mut self, item: A)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
源代码§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. 阅读更多
源代码§

impl Flags for Flags

源代码§

const FLAGS: &'static [Flag<Flags>]

The set of defined flags.
源代码§

type Bits = i32

The underlying bits type.
源代码§

fn bits(&self) -> c_int

Get the underlying bits value. 阅读更多
源代码§

fn from_bits_retain(bits: c_int) -> Flags

按位值原样转换(保留所有位)。
源代码§

fn all_named() -> Flags

Get a flags value with all bits from named flags set. 阅读更多
源代码§

fn empty() -> Self

获取一个所有位均为 0 的 flags 值。
源代码§

fn all() -> Self

获取一个所有已知位均为 1 的 flags 值。
源代码§

fn known_bits(&self) -> Self::Bits

Get the known bits from a flags value.
源代码§

fn unknown_bits(&self) -> Self::Bits

Get the unknown bits from a flags value.
源代码§

fn contains_unknown_bits(&self) -> bool

This method will return true if any unknown bits are set.
源代码§

fn from_bits(bits: Self::Bits) -> Option<Self>

Convert from a bits value. 阅读更多
源代码§

fn from_bits_truncate(bits: Self::Bits) -> Self

从位值转换,未知的位会被清除。
源代码§

fn from_name(name: &str) -> Option<Self>

Get a flags value with the bits of a flag with the given name set. 阅读更多
源代码§

fn iter(&self) -> Iter<Self>

Yield a set of contained flags values. 阅读更多
源代码§

fn iter_names(&self) -> IterNames<Self>

逐个产出该 flags 值中所包含的已命名 flag 集合。 阅读更多
源代码§

fn iter_defined_names() -> IterDefinedNames<Self>

Yield a set of all named flags defined by Self::FLAGS.
源代码§

fn iter_equal_names(&self) -> IterEqualNames<Self>

Get an iterator over all defined names for this flags value. 阅读更多
源代码§

fn is_empty(&self) -> bool

Whether all bits in this flags value are unset.
源代码§

fn is_all(&self) -> bool

判断该 flags 值的所有已知位是否都已设置。
源代码§

fn intersects(&self, other: Self) -> bool
where Self: Sized,

Whether any set bits in other are also set in self.
源代码§

fn contains(&self, other: Self) -> bool
where Self: Sized,

Whether all set bits in other are also set in self.
源代码§

fn truncate(&mut self)
where Self: Sized,

Remove any unknown bits from the flags.
源代码§

fn insert(&mut self, other: Self)
where Self: Sized,

The bitwise or (|) of the bits in self and other.
源代码§

fn remove(&mut self, other: Self)
where Self: Sized,

The intersection of self with the complement of other (&!). 阅读更多
源代码§

fn toggle(&mut self, other: Self)
where Self: Sized,

The bitwise exclusive-or (^) of the bits in self and other.
源代码§

fn set(&mut self, other: Self, value: bool)
where Self: Sized,

Call Flags::insert when value is true or Flags::remove when value is false.
源代码§

fn clear(&mut self)
where Self: Sized,

Unsets all bits in the flags.
源代码§

fn intersection(self, other: Self) -> Self

The bitwise and (&) of the bits in self and other.
源代码§

fn union(self, other: Self) -> Self

The bitwise or (|) of the bits in self and other.
源代码§

fn difference(self, other: Self) -> Self

The intersection of self with the complement of other (&!). 阅读更多
源代码§

fn symmetric_difference(self, other: Self) -> Self

The bitwise exclusive-or (^) of the bits in self and other.
源代码§

fn complement(self) -> Self

The bitwise negation (!) of the bits in self, truncating the result.
源代码§

impl FromIterator<Flags> for Flags

源代码§

fn from_iter<T: IntoIterator<Item = Self>>(iterator: T) -> Self

对每个 flags 值按位取或(|)。

源代码§

impl IntoIterator for Flags

源代码§

type Item = Flags

被迭代的元素类型。
源代码§

type IntoIter = Iter<Flags>

我们将其转换为哪种迭代器?
源代码§

fn into_iter(self) -> Self::IntoIter

从值创建一个迭代器。 阅读更多
源代码§

impl LowerHex for Flags

源代码§

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

使用给定的格式化器格式化该值。 阅读更多
源代码§

impl Not for Flags

源代码§

fn not(self) -> Self

对 self 的位按位取反(!),并截断结果。

源代码§

type Output = Flags

应用 ! 运算符后得到的类型。
源代码§

impl Octal for Flags

源代码§

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

使用给定的格式化器格式化该值。 阅读更多
源代码§

impl PartialEq for Flags

源代码§

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

测试 selfother 值是否相等,供 == 运算符使用。
1.0.0 · 源代码§

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

测试 !=。默认实现几乎总是足够的,没有充分理由不应被重写。
源代码§

impl PublicFlags for Flags

源代码§

type Primitive = i32

The type of the underlying storage.
源代码§

type Internal = InternalBitFlags

The type of the internal field on the generated flags type.
源代码§

impl Sub for Flags

源代码§

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

self 与 other 的补的交集(&!)。当 other 含有未知位时,该方法不等价于 self & !other。该方法不会截断 other,而 ! 运算符会。

源代码§

type Output = Flags

应用 - 运算符后得到的类型。
源代码§

impl SubAssign for Flags

源代码§

fn sub_assign(&mut self, other: Self)

self 与 other 的补的交集(&!)。当 other 含有未知位时,该方法不等价于 self & !other。该方法不会截断 other,而 ! 运算符会。

源代码§

impl UpperHex for Flags

源代码§

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

使用给定的格式化器格式化该值。 阅读更多
源代码§

impl Copy for Flags

源代码§

impl Eq for Flags

源代码§

impl StructuralPartialEq for Flags

自动 trait 实现§

§

impl Freeze for Flags

§

impl RefUnwindSafe for Flags

§

impl Send for Flags

§

impl Sync for Flags

§

impl Unpin for Flags

§

impl UnsafeUnpin for Flags

§

impl UnwindSafe for Flags

blanket 实现§

源代码§

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

源代码§

fn type_id(&self) -> TypeId

获取 selfTypeId阅读更多
源代码§

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

源代码§

fn borrow(&self) -> &T

从拥有的值不可变地借用。 阅读更多
源代码§

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

源代码§

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

从拥有的值可变地借用。 阅读更多
源代码§

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

源代码§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
self 执行拷贝赋值到 dest阅读更多
源代码§

impl<T> From<T> for T

源代码§

fn from(t: T) -> T

原样返回参数。

源代码§

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

源代码§

fn into(self) -> U

调用 U::from(self)

That is, this conversion is whatever the implementation of From<T> for U 实现选择执行的操作。

源代码§

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

源代码§

type Owned = T

获取所有权后得到的类型。
源代码§

fn to_owned(&self) -> T

通常通过克隆,从借用数据创建拥有的数据。 阅读更多
源代码§

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

通常通过克隆,使用借用数据替换拥有的数据。 阅读更多
源代码§

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

源代码§

type Error = Infallible

转换出错时返回的类型。
源代码§

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

执行该转换。
源代码§

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

源代码§

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

转换出错时返回的类型。
源代码§

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

执行该转换。