Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

URL

Note

Requires the url feature.

Validate a string is a specification-compliant URL using the url crate.

#![allow(unused)]
fn main() {
extern crate fortifier;

use fortifier::Validate;

#[derive(Validate)]
struct User {
    #[validate(url)]
    url: String
}
}

Types

String

Validate the string is a specification-compliant URL.

URL

Validate the value is a specification-compliant URL.

A Url can only be constructed by parsing it, so no re-validation is performed.