[−][src]Struct linkcheck::validation::Options
Options to be used with resolve_link()
.
Implementations
impl Options
[src]
pub const DEFAULT_FILE: &'static str
[src]
The name used by Options::default_file()
.
pub fn default_alternate_extensions(
) -> impl IntoIterator<Item = (OsString, impl IntoIterator<Item = OsString>)>
[src]
) -> impl IntoIterator<Item = (OsString, impl IntoIterator<Item = OsString>)>
A mapping of possible alternate extensions to try when checking a filesystem link.
pub fn new() -> Self
[src]
Create a new Options
populated with some sane defaults.
pub fn root_directory(&self) -> Option<&Path>
[src]
Get the root directory, if one was provided.
pub fn with_root_directory<P: AsRef<Path>>(
self,
root_directory: P
) -> Result<Self>
[src]
self,
root_directory: P
) -> Result<Self>
Set the Options::root_directory()
, automatically converting to its
canonical form with dunce::canonicalize()
.
pub fn default_file(&self) -> &OsStr
[src]
The default file name to use when a directory is linked to.
pub fn set_default_file<O: Into<OsString>>(self, default_file: O) -> Self
[src]
Set the Options::default_file()
.
pub fn alternate_extensions(
&self
) -> impl Iterator<Item = (&OsStr, impl Iterator<Item = &OsStr>)>
[src]
&self
) -> impl Iterator<Item = (&OsStr, impl Iterator<Item = &OsStr>)>
Get the map of alternate extensions to use when checking.
By default we only map *.md
to *.html
(Options::default_alternate_extensions()
).
pub fn set_alternate_extensions<S, I, V>(self, alternates: I) -> Self where
I: IntoIterator<Item = (S, V)>,
S: Into<OsString>,
V: IntoIterator<Item = S>,
[src]
I: IntoIterator<Item = (S, V)>,
S: Into<OsString>,
V: IntoIterator<Item = S>,
Set the Options::alternate_extensions()
mapping.
pub fn links_may_traverse_the_root_directory(&self) -> bool
[src]
Are links allowed to go outside of the Options::root_directory()
?
pub fn set_links_may_traverse_the_root_directory(self, value: bool) -> Self
[src]
pub fn set_custom_validation<F>(self, custom_validation: F) -> Self where
F: Fn(&Path, Option<&str>) -> Result<(), Reason> + 'static,
[src]
F: Fn(&Path, Option<&str>) -> Result<(), Reason> + 'static,
Set a function which will be executed after a link is resolved, allowing you to apply custom business logic.
Trait Implementations
impl Clone for Options
[src]
impl Debug for Options
[src]
impl Default for Options
[src]
impl<'de> Deserialize<'de> for Options where
Options: Default,
[src]
Options: Default,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl PartialEq<Options> for Options
[src]
impl Serialize for Options
[src]
Auto Trait Implementations
impl !RefUnwindSafe for Options
impl !Send for Options
impl !Sync for Options
impl Unpin for Options
impl !UnwindSafe for Options
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> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
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>,