Struct umm::java::Project

source ·
pub struct Project {
    files: Vec<File>,
    names: Vec<String>,
    classpath: Vec<String>,
    sourcepath: Vec<String>,
    root_dir: String,
}
Expand description

Struct representing a Java project. Any index i in any collection in this struct always refers to the same JavaFile.

Fields§

§files: Vec<File>

Collection of java files in this project

§names: Vec<String>

Names of java files in this project.

§classpath: Vec<String>

Classpath

§sourcepath: Vec<String>

Source path

§root_dir: String

Root directory

Implementations§

source§

impl Project

source

pub fn check_health(&self) -> Result<()>

Checks the project for common CodingRooms errors

source§

impl Project

source

pub fn new() -> Result<Self>

Initializes a Project, by discovering java files in the UMM_DIR directory. Also downloads some jar files required for unit testing and mutation testing.

source

pub fn new_script() -> Result<Self, Box<EvalAltResult>>

Macro generated variant of #fn_name that returns EvalAltResult. This allows the function to be used in scripts.

source

pub fn identify(&self, name: &str) -> Result<File>

Attempts to identify the correct file from the project from a partial or fully formed name as expected by a java compiler.

Returns a reference to the identified file, if any.

  • name: partial/fully formed name of the Java file to look for.
source

pub fn identify_mut_script( &mut self, name: &str ) -> Result<File, Box<EvalAltResult>>

Macro generated variant of #fn_name that returns EvalAltResult. This allows the function to be used in scripts.

source

pub fn contains(&self, name: &str) -> bool

Returns true if project contains a file with the given name.

source

pub async fn download_libraries_if_needed(&self) -> Result<()>

Downloads certain libraries like JUnit if found in imports. times out after 20 seconds.

source

pub async fn update_vscode_settings(&self) -> Result<()>

Creates a vscode settings.json file for the project.

source

pub fn files(&self) -> &[File]

Get a reference to the project’s files.

source

pub fn info(&self) -> Result<()>

Prints project struct as a json

source

pub fn info_script(&self) -> Result<(), Box<EvalAltResult>>

Macro generated variant of #fn_name that returns EvalAltResult. This allows the function to be used in scripts.

source

pub fn describe(&self) -> String

Returns a short summary of the project, it’s files, their fields and methods.

source

pub async fn update_vscode_tasks(&self) -> Result<()>

Writes a .vscode/tasks.json file for the project.

source

pub fn serve_project_code(&self) -> Result<()>

Serves the project code as a static website.

Trait Implementations§

source§

impl Clone for Project

source§

fn clone(&self) -> Project

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl CustomType for Project

source§

fn build(builder: TypeBuilder<'_, Self>)

Builds the custom type for use with the [Engine]. Read more
source§

impl Debug for Project

source§

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

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

impl Default for Project

source§

fn default() -> Project

Returns the “default value” for a type. Read more
source§

impl<'de> Deserialize<'de> for Project

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Serialize for Project

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. 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.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

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

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

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

§

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>,

§

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.
§

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

§

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

The type returned in the event of a conversion error.
§

fn try_into<'async_trait>( self ) -> Pin<Box<dyn Future<Output = Result<U, <U as TryFrom<T>>::Error>> + 'async_trait>>
where T: 'async_trait,

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,