[−][src]Struct proc_use::UseBuilder
The struct to represent the builder for proc_use.
Implementations
impl UseBuilder
[src]
pub fn new() -> Self
[src]
Returns a UserBuilder with no mod or use statemetns and unused defaulted to true.
pub fn mod_file(&mut self, file: PathBuf) -> &mut Self
[src]
pub fn use_file(&mut self, file: PathBuf, use_stmt: String) -> &mut Self
[src]
Adds a file to use to the builder, and use pattern.
Arguments
file
- A PathBuf to the file that needs to be modded.use_stmt
- A String that holds the use pattern for the file.
pub fn mod_file_alias(&mut self, file: PathBuf, alias: &str) -> &mut Self
[src]
Adds a file to use to the builder. Uses an alias on mod statement.
Arguments
file
- A PathBuf to the file that needs to be modded.alias
- Alternate name for imported mod. Eg importfoo.rs
asmod bar
.
pub fn use_file_alias(
&mut self,
file: PathBuf,
use_stmt: String,
alias: &str
) -> &mut Self
[src]
&mut self,
file: PathBuf,
use_stmt: String,
alias: &str
) -> &mut Self
Adds a file to use to the builder, and use pattern. Uses an alias on mod statement.
Arguments
file
- A PathBuf to the file that needs to be modded.use_stmt
- A String that holds the use pattern for the file.alias
- Alternate name for imported mod. Eg importfoo.rs
asmod bar
.
pub fn use_crate(&mut self, use_stmt: String) -> &mut Self
[src]
Adds a crate to use to the builder with a use pattern.
Arguments
use_stmt
- A String that holds the use pattern for the crate.
pub fn mod_glob(&mut self, globstring: &str) -> &mut Self
[src]
Glob a file path for files to mod.
Arguments
globstring
- The glob pattern string to match.
Example
let builder = UseBuilder::new() .mod_glob("src/util/*.rs");
pub fn use_glob(&mut self, globstring: &str, use_stmt: String) -> &mut Self
[src]
Glob a file path for files to use.
Arguments
globstring
- The glob pattern string to match.
Example
let builder = UseBuilder::new() .use_glob("src/util/*.rs", "*".into());
pub fn mod_glob_alias(&mut self, globstring: &str, alias: &str) -> &mut Self
[src]
Glob a file path for files to mod. Uses an alias on mod statement.
Arguments
globstring
- The glob pattern string to match.
Example
let builder = UseBuilder::new() .mod_glob("src/util/*.rs");
alias
- Alternate name for imported mod. Eg importfoo.rs
asmod bar
.
pub fn use_glob_alias(
&mut self,
globstring: &str,
use_stmt: String,
alias: &str
) -> &mut Self
[src]
&mut self,
globstring: &str,
use_stmt: String,
alias: &str
) -> &mut Self
Glob a file path for files to use. Uses an alias on mod statement.
Arguments
globstring
- The glob pattern string to match.
Example
let builder = UseBuilder::new() .use_glob("src/util/*.rs", "*".into());
alias
- Alternate name for imported mod. Eg importfoo.rs
asmod bar
.
pub fn allow_unused(&mut self) -> &mut Self
[src]
Disables the unused import error for each import.
pub fn warn_unused(&mut self) -> &mut Self
[src]
Enables the unused import error for each import.
pub fn write_to_file_use(&mut self, path: PathBuf) -> &mut Self
[src]
pub fn write_to_file_mod(&mut self, path: PathBuf) -> &mut Self
[src]
pub fn write_to_file_all(&mut self, path: PathBuf) -> &mut Self
[src]
Writes the mod and use statements to a file.
Arguments
path
- A PathBuf to the file that is to be written.
Auto Trait Implementations
impl RefUnwindSafe for UseBuilder
impl Send for UseBuilder
impl Sync for UseBuilder
impl Unpin for UseBuilder
impl UnwindSafe for UseBuilder
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,