JavaConfig

Struct JavaConfig 

Source
pub struct JavaConfig { /* private fields */ }
Expand description

Configuration for Java binding generation

Implementations§

Source§

impl JavaConfig

Source

pub fn new(output_dir: PathBuf, package_name: String) -> JavaConfig

Create JavaConfig

§Arguments
  • output_dir - directory where place generated java files
  • package_name - package name for generated java files
Source

pub fn use_null_annotation(self, import_annotation: String) -> JavaConfig

👎Deprecated: Use use_null_annotation_from_package instead

Use @NonNull for types where appropriate

§Arguments
  • import_annotation - import statement for @NonNull, for example android.support.annotation.NonNull
Source

pub fn use_null_annotation_from_package( self, null_annotation_package: String, ) -> JavaConfig

Use @NonNull/@Nullable for types where appropriate

§Arguments
  • null_annotation_package - from which package import annotations like NonNull, for example for Android Studio you should pass android.support.annotation
Source

pub fn use_optional_package(self, optional_package: String) -> JavaConfig

If you use JDK without java.util.Optional*, then you can provide name of custom package with Optional. Default value is “java.util”

Source

pub fn use_reachability_fence( self, reachability_fence: JavaReachabilityFence, ) -> JavaConfig

Choose reachability fence variant, JavaReachabilityFence::Std provide ability to generate better code, but not available untill Java 9 and Android API level 28

Trait Implementations§

Source§

impl Debug for JavaConfig

Source§

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

Formats the value using the given formatter. Read more

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

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. 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.