Infinity.AclMask¶
Fields¶
Name |
Type |
Access |
Description |
---|---|---|---|
mask |
[ |
r/w |
A 256 bit wide bitfield of |
Methods¶
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Details¶
- class Infinity.AclMask¶
This structure represents a mask of
Infinity.AclSetting
s, where each setting can be either turned on or off.- and1(setting)¶
- Parameters:
setting (
Infinity.AclSetting
) – The setting to unset.- Returns:
The mask itself.
- Return type:
Disables the bit corresponding to setting in self, leaving all other bits alone.
- and_(rhs)¶
- Parameters:
rhs (
Infinity.AclMask
) – Second mask.- Returns:
The output mask.
- out:
Output mask.
- Return type:
(
Infinity.AclMask
, out:Infinity.AclMask
)
Computes the bitwise AND of self and rhs and writes the result to out. out is allowed to be equivalent to self and/or rhs.
- clear()¶
Resets a mask so that all fields are zero.
- copy()¶
- Returns:
A new
Infinity.AclMask
. Free withInfinity.AclMask.free
() when no longer needed.- Return type:
Creates a dynamically allocated copy of self. This function should not usually be used since masks can simply created on the stack and copied by value. This function is mainly meant for the boxed type definition and for language bindings.
- empty()¶
-
Checks whether the given mask is empty, i.e. all fields are set to zero.
- equal(rhs)¶
- Parameters:
rhs (
Infinity.AclMask
) – The second mask.- Returns:
- Return type:
Checks whether the two masks are equal.
- free()¶
Releases a
Infinity.AclMask
that was created withInfinity.AclMask.copy
().
- has(setting)¶
- Parameters:
setting (
Infinity.AclSetting
) – The setting to check.- Returns:
True
if the bit corresponding to setting is set in self.- Return type:
Returns
True
if the given mask has the bit which corresponds to setting set, orFalse
otherwise.
- neg()¶
- Returns:
The output mask.
- out:
The output mask.
- Return type:
(
Infinity.AclMask
, out:Infinity.AclMask
)
Negates the given mask bitwise and writes the result to out. The output mask is allowed to be equivalent to self itself.
- or1(setting)¶
- Parameters:
setting (
Infinity.AclSetting
) – The setting to add.- Returns:
The mask itself.
- Return type:
Enables the bit corresponding to setting in self, leaving all other bits alone.
- or_(rhs)¶
- Parameters:
rhs (
Infinity.AclMask
) – Second mask.- Returns:
The output mask.
- out:
Output mask.
- Return type:
(
Infinity.AclMask
, out:Infinity.AclMask
)
Computes the bitwise OR of self and rhs and writes the result to out. out is allowed to be equivalent to self and/or rhs.
- set1(setting)¶
- Parameters:
setting (
Infinity.AclSetting
) – The permission to set.- Returns:
The mask itself.
- Return type:
Initializes self such that all permissions are off except the one corresponding to setting.
- setv(settings)¶
- Parameters:
settings ([
Infinity.AclSetting
]) – An array ofInfinity.AclSetting
s to set.- Returns:
The mask itself.
- Return type:
Initializes self such that all permissions are off except the ones specified in the settings array.