pub struct PackxelInitializer {
pub name: String,
pub version: String,
}Fields§
§name: Stringname of the package
creates folder of same name
version: Stringversion of the package
to be used in manifest inside config folder
Implementations§
Source§impl PackxelInitializer
Initializer is a struct that is used to initialize
the config and log directories.
impl PackxelInitializer
Initializer is a struct that is used to initialize the config and log directories.
This can further be used to setup logging.
use packxel_utils::initializer::PackxelInitializer;
// creates the config and log directories.
let version = env!("CARGO_PKG_VERSION");
let initializer = PackxelInitializer::init("packxel", version);
Sourcepub fn get_config_dir(&self) -> PathBuf
pub fn get_config_dir(&self) -> PathBuf
Returns the config directory of the user or creates it if it doesn’t exist.
Sourcepub fn get_log_dir(&self) -> PathBuf
pub fn get_log_dir(&self) -> PathBuf
Returns the log directory of the user or creates it if it doesn’t exist.
Sourcepub fn get_log_file(&self) -> PathBuf
pub fn get_log_file(&self) -> PathBuf
This does not create the file. Only returns the path to the log file.
use packxel_utils::initializer::PackxelInitializer;
let initializer = PackxelInitializer::init("testing", "0.0.1");
let log_file_path = initializer.get_log_file();Trait Implementations§
Source§impl Clone for PackxelInitializer
impl Clone for PackxelInitializer
Source§fn clone(&self) -> PackxelInitializer
fn clone(&self) -> PackxelInitializer
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for PackxelInitializer
impl RefUnwindSafe for PackxelInitializer
impl Send for PackxelInitializer
impl Sync for PackxelInitializer
impl Unpin for PackxelInitializer
impl UnsafeUnpin for PackxelInitializer
impl UnwindSafe for PackxelInitializer
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