mod path_private { pub trait Sealed { } }
pub trait IsntPathExt: path_private::Sealed {
#[must_use]
fn is_not_absolute(&self) -> bool;
#[must_use]
fn is_not_relative(&self) -> bool;
#[must_use]
fn not_has_root(&self) -> bool;
#[must_use]
fn not_starts_with<P: std::convert::AsRef<std::path::Path>>(&self, base: P) -> bool;
#[must_use]
fn not_ends_with<P: std::convert::AsRef<std::path::Path>>(&self, child: P) -> bool;
#[must_use]
fn not_exists(&self) -> bool;
#[must_use]
fn is_not_file(&self) -> bool;
#[must_use]
fn is_not_dir(&self) -> bool;
#[must_use]
fn is_not_symlink(&self) -> bool;
}
impl path_private::Sealed for std::path::Path { }
impl IsntPathExt for std::path::Path {
#[inline]
fn is_not_absolute(&self) -> bool {
!self.is_absolute()
}
#[inline]
fn is_not_relative(&self) -> bool {
!self.is_relative()
}
#[inline]
fn not_has_root(&self) -> bool {
!self.has_root()
}
#[inline]
fn not_starts_with<P: std::convert::AsRef<std::path::Path>>(&self, base: P) -> bool {
!self.starts_with::<P>(base)
}
#[inline]
fn not_ends_with<P: std::convert::AsRef<std::path::Path>>(&self, child: P) -> bool {
!self.ends_with::<P>(child)
}
#[inline]
fn not_exists(&self) -> bool {
!self.exists()
}
#[inline]
fn is_not_file(&self) -> bool {
!self.is_file()
}
#[inline]
fn is_not_dir(&self) -> bool {
!self.is_dir()
}
#[inline]
fn is_not_symlink(&self) -> bool {
!self.is_symlink()
}
}
mod path_buf_private { pub trait Sealed { } }
pub trait IsntPathBufExt: path_buf_private::Sealed {
#[must_use]
fn not_pop(&mut self) -> bool;
#[must_use]
fn not_set_extension<S: std::convert::AsRef<std::ffi::OsStr>>(&mut self, extension: S) -> bool;
}
impl path_buf_private::Sealed for std::path::PathBuf { }
impl IsntPathBufExt for std::path::PathBuf {
#[inline]
fn not_pop(&mut self) -> bool {
!self.pop()
}
#[inline]
fn not_set_extension<S: std::convert::AsRef<std::ffi::OsStr>>(&mut self, extension: S) -> bool {
!self.set_extension::<S>(extension)
}
}
mod prefix_private { pub trait Sealed<'a> { } }
pub trait IsntPrefixExt<'a>: prefix_private::Sealed<'a> {
#[must_use]
fn is_not_verbatim(&self) -> bool;
}
impl<'a> prefix_private::Sealed<'a> for std::path::Prefix<'a> { }
impl<'a> IsntPrefixExt<'a> for std::path::Prefix<'a> {
#[inline]
fn is_not_verbatim(&self) -> bool {
!self.is_verbatim()
}
}