FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    Uri

    struct · ferroui-base · v0.5.0

    struct Uri
    

    A uniform resource identifier.

    Cloning is cheap (one reference count).

    View source

    Members

    new

    fn new(uri_string: &str, kind: UriKind) -> Result<Uri, UriFormatError>
    

    Parses a URI of the given kind (C# new Uri(string, UriKind)).

    Source

    absolute

    fn absolute(uri_string: &str) -> Result<Uri, UriFormatError>
    

    Parses an absolute URI (C# new Uri(string)).

    Source

    try_create

    fn try_create(uri_string: &str, kind: UriKind) -> Option<Uri>
    

    Parses a URI of the given kind (C# Uri.TryCreate).

    Source

    combine

    fn combine(base: &Uri, relative: &Uri) -> Uri
    

    Resolves relative against the absolute base (C# new Uri(Uri, Uri)).

    Panics when base is not absolute. An absolute relative is returned unchanged.

    Source

    is_absolute_uri

    fn is_absolute_uri(self: &Self) -> bool
    

    Whether the URI is absolute (C# IsAbsoluteUri).

    Source

    original_string

    fn original_string(self: &Self) -> &str
    

    The string the URI was created from (C# OriginalString).

    Source

    scheme

    fn scheme(self: &Self) -> &str
    

    The lower-cased scheme (C# Scheme).

    Panics for a relative URI (C# throws InvalidOperationException).

    Source

    absolute_uri

    fn absolute_uri(self: &Self) -> &str
    

    The canonical absolute text (C# AbsoluteUri).

    Panics for a relative URI (C# throws InvalidOperationException).

    Source

    absolute_path

    fn absolute_path(self: &Self) -> &str
    

    The path component (C# AbsolutePath).

    Panics for a relative URI (C# throws InvalidOperationException).

    Source

    query

    fn query(self: &Self) -> &str
    

    The query component including the leading ?, or an empty string (C# Query).

    Source

    local_path

    fn local_path(self: &Self) -> String
    

    The local operating-system representation of a file name (C# LocalPath): the unescaped path, which for a file URI of a drive path (file:///C:/dir) is the drive path with back slashes (C:\dir) and for a file URI with a host is the UNC path (\\host\share).

    Panics for a relative URI (C# throws InvalidOperationException).

    Source

    ensure_absolute

    fn ensure_absolute(self: &Self, base_uri: Option<&Uri>) -> Uri
    

    Makes a relative URI absolute using base_uri; absolute URIs are returned unchanged.

    Panics when the URI is relative and base_uri is missing or relative (C# throws ArgumentException).

    Source

    Trait implementations

    Availability

    Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.