AccessFlag

Enum AccessFlag 

Source
pub enum AccessFlag {
Show 19 variants ACC_PUBLIC, ACC_PRIVATE, ACC_PROTECTED, ACC_STATIC, ACC_FINAL, ACC_SYNCHRONIZED, ACC_VOLATILE, ACC_BRIDGE, ACC_TRANSIENT, ACC_VARARGS, ACC_NATIVE, ACC_INTERFACE, ACC_ABSTRACT, ACC_STRICT, ACC_SYNTHETIC, ACC_ANNOTATION, ACC_ENUM, ACC_CONSTRUCTOR, ACC_DECLARED_SYNCHRONIZED,
}
Expand description

Representation of the different access flag

Bitfields of these flags are used to indicate the accessibility and overall properties of classes and class members.

Variants§

§

ACC_PUBLIC

Public: visible everywhere

§

ACC_PRIVATE

Private: only visible to defining class

§

ACC_PROTECTED

Protected: visible to package and subclasses

§

ACC_STATIC

Static: meaning depends of where the flag is used

  • for classes: is not constructed with an outer this reference
  • for methods: does not take a this argument
  • for fields: global to defining class
§

ACC_FINAL

Final: meaning depends of where the flag is used

  • for classes: not subclassable
  • for methods: not overridable
  • for fields: immutable after construction
§

ACC_SYNCHRONIZED

Synchronized (only valid for methods): associated lock automatically acquired around call to this method. Note: only valid to set when ACC_NATIVE is also set.

§

ACC_VOLATILE

Volatile (only valid for fields): special access rules to help with thread safety

§

ACC_BRIDGE

Bridge (only valid for methods): method added automatically by the compiler as a type-safe bridge

§

ACC_TRANSIENT

Transient (only valid for fields): the field must not be saved by default serialization

§

ACC_VARARGS

Varargs (only valid for methods): the last argument to this method should be treated as a “rest” argument by the compiler

§

ACC_NATIVE

Native (only valid for methods): this method is implemented in native code

§

ACC_INTERFACE

Interface (only valid for classes): multiply-implementable abstract class

§

ACC_ABSTRACT

Abstract (only valid for classes and methods):

  • for classes: not directly instantiable
  • for methods: unimplemented by this class
§

ACC_STRICT

Strict floating-point (only valid for methods): strict rules for floating-point arithmetic

§

ACC_SYNTHETIC

Synthetic: not directly defined in source code

§

ACC_ANNOTATION

Annotation (only valid for classes): declared as an annotation class

§

ACC_ENUM

Enum (only valid for classes and fields):

  • for classes: declared as an enumerated type
  • for fields: declared as an enumerated value
§

ACC_CONSTRUCTOR

Constructor (only valid for methods): contructor method

§

ACC_DECLARED_SYNCHRONIZED

Declared synchronized (only valid for methods): method declared as synchronized

Implementations§

Source§

impl AccessFlag

Source

pub fn parse(raw: u32, for_type: AccessFlagType) -> Vec<Self>

Converts a raw flag (an unsigned 32 bits integer) into a vector for access flags

The result values will be different depending on where the type is used (for a class, a method, or a field)

Source

pub fn vec_to_string(flags: &[AccessFlag]) -> String

Pretty print a vector of access flags

Trait Implementations§

Source§

impl Debug for AccessFlag

Source§

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

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

impl Display for AccessFlag

Implementation of the Display trait for access flags

Source§

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

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

impl PartialEq for AccessFlag

Source§

fn eq(&self, other: &AccessFlag) -> 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 StructuralPartialEq for AccessFlag

Auto Trait Implementations§

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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. 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.