pub struct GitignoreManager { /* private fields */ }Expand description
Gitignore templates manager
Implementations§
Source§impl GitignoreManager
impl GitignoreManager
Sourcepub fn new() -> Result<Self>
pub fn new() -> Result<Self>
Creates a new GitignoreManager instance
§Errors
Returns an error if the home directory cannot be determined or if the configuration files cannot be created/loaded
Sourcepub async fn check_internet_connectivity(&self) -> bool
pub async fn check_internet_connectivity(&self) -> bool
Check if internet connectivity is available
§Examples
use flatten_rust::config::GitignoreManager;
let manager = GitignoreManager::new()?;
if manager.check_internet_connectivity().await {
println!("Internet is available");
}Sourcepub async fn update_if_needed(&mut self) -> Result<()>
pub async fn update_if_needed(&mut self) -> Result<()>
Update templates if needed
§Examples
use flatten_rust::config::GitignoreManager;
let mut manager = GitignoreManager::new()?;
manager.update_if_needed().await?;Sourcepub fn get_available_templates(&self) -> Vec<&str>
pub fn get_available_templates(&self) -> Vec<&str>
Get all available template keys
Sourcepub fn get_patterns_for_templates(
&self,
template_keys: &[String],
) -> Vec<String>
pub fn get_patterns_for_templates( &self, template_keys: &[String], ) -> Vec<String>
Get patterns for specific templates
Sourcepub fn set_check_internet(&mut self, check: bool) -> Result<()>
pub fn set_check_internet(&mut self, check: bool) -> Result<()>
Sourcepub async fn force_update(&mut self) -> Result<()>
pub async fn force_update(&mut self) -> Result<()>
Force update templates
§Examples
use flatten_rust::config::GitignoreManager;
let mut manager = GitignoreManager::new()?;
manager.force_update().await?;Auto Trait Implementations§
impl Freeze for GitignoreManager
impl RefUnwindSafe for GitignoreManager
impl Send for GitignoreManager
impl Sync for GitignoreManager
impl Unpin for GitignoreManager
impl UnwindSafe for GitignoreManager
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