pub struct Class {
pub name: String,
pub package: String,
pub imports: Vec<String>,
pub fields: Vec<Field>,
pub methods: Vec<Method>,
pub generics: Vec<TypeGeneric>,
pub wrapped: bool,
}Expand description
A Java class.
Fields§
§name: StringThe name of this class.
package: StringThe package
imports: Vec<String>A list of imports.
fields: Vec<Field>A list of fields.
methods: Vec<Method>A list of methods.
generics: Vec<TypeGeneric>A list of generics.
wrapped: boolShould it be a wrapper?
Implementations§
Source§impl Class
impl Class
Sourcepub fn default_imports() -> Vec<String>
pub fn default_imports() -> Vec<String>
Get default imports.
Sourcepub fn set_package(self, pkg: impl AsRef<str>) -> Self
pub fn set_package(self, pkg: impl AsRef<str>) -> Self
Set the package name.
Sourcepub fn create_wrapper(&self) -> String
pub fn create_wrapper(&self) -> String
Create the Rust code for a wrapper struct.
Trait Implementations§
Source§impl Ord for Class
impl Ord for Class
Source§impl PartialOrd for Class
impl PartialOrd for Class
impl Eq for Class
impl StructuralPartialEq for Class
Auto Trait Implementations§
impl Freeze for Class
impl RefUnwindSafe for Class
impl Send for Class
impl Sync for Class
impl Unpin for Class
impl UnwindSafe for Class
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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