- Fix URI template expansion with
template::DynamicContext
to call the methodson_expansion_start
andon_expansion_end
.
- Fix URI template expansion with
template::DynamicContext
to call the methodson_expansion_start
andon_expansion_end
.
- Add
fragment_str()
methods that returns a fragment in a raw string slice.
- Add
fragment_str()
methods that returns a fragment in a raw string slice.- List of added methods:
RiStr::fragment_str()
RiReferenceStr::fragment_str()
RiRelativeStr::fragment_str()
- List of added methods:
- Fix unsoundness of
template::UriTemplateStr
- Fix unsoundness of
template::UriTemplateStr
- The type should have
#[repr(transparent)]
to compile safely but did not. - Any creations and uses of the value are undefined behavior without the fix, while the current version of the Rust compiler seems to happen to generate the expected binary (without any guarantee).
- The type should have
- Fix calculation of template expansion error location.
- Currently this just appears in an error message but not exposed through any other public API.
- Add an iterator of variables that appears in a URI template.
- Support URI template expansion with a mutable context.
- Add an iterator of variables that appears in a URI template.
- List of added items:
template::UriTemplateStr::variables()
methodtemplate::UriTemplateVariables<'_>
iterator type
- List of added items:
- Support URI template expansion with a mutable context.
- Add methods
template::UriTemplateStr::expand_dynamic()
andtemplate::UriTemplateStr::expand_dynamic_to_string()
. - Add
template::context::DynamicContext
trait for mutable context. - Add
template::context::Visitor::purpose()
method andtemplate::context::VisitPurpose
type to enable users to know for what purpose the variable is being visited.
- Add methods
- Fix calculation of template expansion error location.
- Currently this error location info just appears in an error message (from
<template::Error as std::fmt::Display>::fmt
), but not exposed through any other public API.
- Currently this error location info just appears in an error message (from
- Add easy conversion from an expanded template into IRI/URI string types.
- Add easy conversion from an expanded template into IRI/URI string types.
- List of added conversions:
TryFrom<template::Expanded<'_, S, C>> for types::RiAbsoluteString<S>
TryFrom<template::Expanded<'_, S, C>> for types::RiReferenceString<S>
TryFrom<template::Expanded<'_, S, C>> for types::RiRelativeString<S>
TryFrom<template::Expanded<'_, S, C>> for types::RiString<S>
- List of added conversions:
- Fix a bug that some abnormal IRIs that have no authority and end with
/.
resulted in wrong normalization that generate unintentional authorities.- Reported at #36.
- Fix a bug that the normalization incorrectly omits percent-encoded triplets
partially if they constitute invalid UTF-8 byte sequence.
- Reported at #36.
- Fix a bug that some abnormal IRIs that have no authority and end with
/.
resulted in wrong normalization that generate unintentional authorities.- Reported at #36.
- IRI resolution and normalization had this bug, but only for IRIs without authority.
- This happened when the resolution and normalization result should not contain
an authority but the path part resulted in
//.
.- For example,
a:/.//.
anda:/bar/..//.
should be normalized toa:/.//
, but the actual result wasa://
due to this bug.
- For example,
- Fix a bug that the normalization incorrectly omits percent-encoded triplets
partially if they constitute invalid UTF-8 byte sequence.
- Reported at #36.
- URIs and IRIs that only contains the percent-encoded triplets for valid UTF-8 byte sequences won't be affected.
- Add
new_unchecked()
methods to string types. - Move
template::VarName
type intotemplate::context
module and deprecate the old name. - Add
template::context::VarName::new()
method. - Add component getters to
resolve::FixedBaseResolver
. - Fix some lint warnings detected by newer clippy.
- Add
new_unchecked()
methods to string types.- List of added methods:
template::UriTemplateStr::new_unchecked()
template::UriTemplateString::new_unchecked()
types::RiAbsoluteStr::new_unchecked()
types::RiAbsoluteString::new_unchecked()
types::RiFragmentStr::new_unchecked()
types::RiFragmentString::new_unchecked()
types::RiQueryStr::new_unchecked()
types::RiQueryString::new_unchecked()
types::RiReferenceStr::new_unchecked()
types::RiReferenceString::new_unchecked()
types::RiRelativeStr::new_unchecked()
types::RiRelativeString::new_unchecked()
types::RiStr::new_unchecked()
types::RiString::new_unchecked()
- List of added methods:
- Add
template::context::VarName::new()
method. - Add component getters to
resolve::FixedBaseResolver
.- List of added methods:
resolve::FixedBaseResolver::scheme_str()
resolve::FixedBaseResolver::authority_str()
resolve::FixedBaseResolver::path_str()
resolve::FixedBaseResolver::query()
resolve::FixedBaseResolver::query_str()
resolve::FixedBaseResolver::fragment_str()
- List of added methods:
- Move
template::VarName
type intotemplate::context
module and deprecate the old name.- The old name (
template::VarName
) is still available while it is marked as deprecated.
- The old name (
- Add
template
module that contains URI Template (RFC 6570) processor. - Add
PercentEncoded::{unreserve,characters}
methods. - Remove "WHATWG" normalization.
- Add normalization that preserves relative path in some special condition.
- Add
template
module that contains URI Template (RFC 6570) processor.- The processor supports nostd environment.
- Add
PercentEncoded::{unreserve,characters}
methods.- List of added methods:
percent_encode::PercentEncoded::characters()
percent_encode::PercentEncoded::unreserve()
- List of added methods:
- Add normalization that preserves relative path in some special condition.
- When the authority component is absent and the path is relative, the dot-segments removal is not applied to the path. This behavior is inspired by WHATWG URL Standard, but the implementation is not guaranteed to follow that spec.
- List of added items:
types::RiStr::normalize_but_preserve_authorityless_relative_path()
types::RiStr::is_normalized_but_authorityless_relative_path_preserved()
types::RiAbsoluteStr::normalize_but_preserve_authorityless_relative_path()
types::RiAbsoluteStr::is_normalized_but_authorityless_relative_path_preserved()
normalize::Normalized::and_normalize_but_preserve_authorityless_relative_path()
normalize::Normalized::enable_normalization_preserving_authorityless_relative_path()
- Note that this normalization algorithm is not compatible with RFC 3986 algorithm for some inputs.
- Remove non-compliant "WHATWG" normalization.
- Fixes the issue #29 and #30.
- Previous implementations of normalization is described as "defined in WHATWG spec", but they were not compliant to the spec. Specifically, when the authority component is absent and the path is relative, WHATWG spec requires the path to be treated as "opaque", but the old implementation applied dot-segments removal to the path.
- List of removed items:
types::RiStr::is_normalized_whatwg()
types::RiAbsoluteStr::is_normalized_whatwg()
- Bump MSRV to 1.60.0.
- Remove
memchr-std
,serde-alloc
, andserde-std
features.- Now
alloc
and/orstd
features for additional dependencies are automatically enabled when all of dependent featuers are enabled.
- Now
- Support escaping username and password by
percent_encode::PercentEncode
. - Add
format
module that contains utilities for types withDisplay
trait impl.- Add
format::ToStringFallible
trait. - Add
format::ToDedicatedString
trait. - Add
format::write_to_slice
function andformat::CapacityOverflow
type. - Add
format::try_append_to_string
function.
- Add
- Remove
task
module andtask::ProcessAndWrite
trait.- Remove
task
module. - Remove
ProcessAndWrite
trait implementation frompercent_encode::PercentEncoded
type. - Remove
ProcessAndWrite
trait implementation fromconvert::MappedToUri
type.
- Remove
- Remove "task" types.
- Remove
normalize::NormalizationTask
type. - Remove
normalize::NormalizationTask
type.- Use
normalize::Normalized
instead.
- Use
- Remove
- Change return types of some functions from task types or string types to
Display
-able types.- Change return types of
{BorrowedIri}::encode_to_uri
toconvert::MappedToUri<'_, Self>
. - Change return type of
resolve::FixedBaseResolver::resolve()
method tonoramlize::Normalized
. - Change return type of
{BorrowedIri}::normalize()
method tonormalize::Normalized
. - Change return type of
{BorrowedIri}::resolve_against()
method tonormalize::Normalized
. - Remove
BufferError
type.
- Change return types of
- Change API of IRI-to-URI conversion.
- Rename
{OwnedIri}::encode_to_uri
to{OwnedIri}::encode_to_uri_inline
. - Add
{OwnedIri}::try_encode_to_uri_inline
method. - Add
{OwnedIri}::try_encode_into_uri
method.
- Rename
- Make the methods impl of
convert::MappedToUri<'_, T>
generic over the spec. - Revome functions under
resolve
module. - Add
normalize::Normalized
type. - Remove some methods of
resolve::FixedBaseResolver
. - Rename
{BorrowedIri}::is_normalized()
methods to{BorrowedIri}::is_normalized_rfc3986()
. - Remove some methods of borrowed IRI string types.
- Support password masking.
- Add
mask_password
module. - Add
{BorrowedIri}::mask_password
method. - Add
{OwnedIri}::remove_password_inline
and{OwnedIri}::remove_nonempty_password_inline()
methods.
- Add
- Remove deprecated
percent_encoding
module and aliases defined in it. - Unify normalization of
build::Builder
.- Add
build::Builder::normalize()
method. - Add
build::Built::ensure_rfc3986_normalizable()
method. - Change return type of
build::Builder::build()
. - Remove
build::Builder::normalize_rfc3986()
andbuild::Builder::normalize_whatwg()
methods. - Remove
build::Error
type.
- Add
- Stop accepting user part as
Option<&str>
type forbuild::Builder::userinfo
- Reject user with colon characters on IRI build.
- Allow builders to normalize
path
component of relative IRIs if safely possible.
- Support escaping username and password by
percent_encode::PercentEncode
.- List of added functions:
percen_encode::PercentEncode::from_user()
percen_encode::PercentEncode::from_password()
- List of added functions:
- Add
format::ToStringFallible
trait.- This trait allows users to convert
Display
-able values intoString
, but without panicking on OOM. - List of types that implements this trait:
build::Built<'_, RiReferenceStr<S>>
build::Built<'_, RiStr<S>>
build::Built<'_, RiAbsoluteStr<S>>
build::Built<'_, RiRelativeStr<S>>
- This trait allows users to convert
- Add
format::ToDedicatedString
trait.- This trait allows users to convert
Display
-able values into owned dedicated IRI string types, with or without panicking on OOM. - List of added implementations:
build::Built<'_, RiReferenceStr<S>>
(Target =RiReferenceString<S>
)build::Built<'_, RiStr<S>>
(Target =RiString<S>
)build::Built<'_, RiAbsoluteStr<S>>
(Target =RiAbsoluteString<S>
)build::Built<'_, RiRelativeStr<S>>
(Target =RiRelativeString<S>
)convert::MappedToUri<'_, RiReferenceStr<S>>
(Target =RiReferenceString<S>
)convert::MappedToUri<'_, RiStr<S>>
(Target =RiString<S>
)convert::MappedToUri<'_, RiAbsoluteStr<S>>
(Target =RiAbsoluteString<S>
)convert::MappedToUri<'_, RiRelativeStr<S>>
(Target =RiRelativeString<S>
)convert::MappedToUri<'_, RiQueryStr<S>>
(Target =RiQueryString<S>
)convert::MappedToUri<'_, RiFragmentStr<S>>
(Target =RiFragmentString<S>
)
- This trait allows users to convert
- Add
format::write_to_slice
function andformat::CapacityOverflow
type. - Add
format::try_append_to_string
function. - Add
{OwnedIri}::try_encode_to_uri_inline
method. - Add
{OwnedIri}::try_encode_into_uri
method. - Add
normalize::Normalized
type.- This replaces
normalize::NormalizationTask
type in previous versions.
- This replaces
- Add
mask_password
module.- Items in this module let users hide or replace password to keep sensitive information secret.
- List of added items:
mask_password::PasswordMasked
typemask_password::PasswordReplaced
type
- Add
{BorrowedIri}::mask_password
method.- List of added methods:
types::RiReferenceStr::mask_password()
types::RiStr::mask_password()
types::RiAbsoluteStr::mask_password()
types::RiRelativeStr::mask_password()
- List of added methods:
- Add
{OwnedIri}::remove_password_inline
and{OwnedIri}::remove_nonempty_password_inline()
methods.- List of added methods:
types::RiReferenceString::remove_password_inline()
types::RiReferenceString::remove_nonempty_password_inline()
types::RiString::remove_password_inline()
types::RiString::remove_nonempty_password_inline()
types::RiAbsoluteString::remove_password_inline()
types::RiAbsoluteString::remove_nonempty_password_inline()
types::RiRelativeString::remove_password_inline()
types::RiRelativeString::remove_nonempty_password_inline()
- List of added methods:
- Add
build::Builder::normalize()
method. - Add
build::Built::ensure_rfc3986_normalizable()
method.
- Bump MSRV to 1.60.0.
- Remove
memchr-std
,serde-alloc
, andserde-std
features.- Now
alloc
and/orstd
features for additional dependencies are automatically enabled when all of dependent featuers are enabled.
- Now
- Remove
ProcessAndWrite
trait implementation frompercent_encode::PercentEncoded
type. - Remove
ProcessAndWrite
trait implementation fromconvert::MappedToUri
type. - Change return types of
{BorrowedIri}::encode_to_uri
toconvert::MappedToUri<'_, Self>
.- The code
borrowed.encode_to_uri()
in older versions should be rewritten toborrowed.encode_to_uri().to_dedicated_string()
.
- The code
- Rename
{OwnedIri}::encode_to_uri
to{OwnedIri}::encode_to_uri_inline
. - Remove
normalize::NormalizationTask
type.- Use
normalized::Normalized
type instead.
- Use
- Revome functions under
resolve
module.- List of removed functions:
resolve::resolve()
resolve::resolve_normalize()
resolve::resolve_whatwg()
resolve::resolve_normalize_whatwg()
resolve::try_resolve()
resolve::try_resolve_normalize()
resolve::try_resolve_whatwg()
resolve::try_resolve_normalize_whatwg()
- List of removed functions:
- Remove
normalize::NormalizationTask
type.- Use
normalize::Normalized
instead.
- Use
- Remove some methods of
resolve::FixedBaseResolver
.- List fo removed methods:
resolve::FixedBaseResolver::try_resolve()
resolve::FixedBaseResolver::try_resolve_normalize()
resolve::FixedBaseResolver::resolve_normalize()
resolve::FixedBaseResolver::create_task()
resolve::FixedBaseResolver::create_normalizing_task()
- List fo removed methods:
- Change return type of
resolve::FixedBaseResolver::resolve()
tonoramlize::Normalized
. - Rename
{BorrowedIri}::is_normalized
methods to{BorrowedIri}::is_normalized_rfc3986
.- List of renamed methods:
types::RiStr::is_normalized
totypes::RiStr::is_normalized_rfc3986
types::RiAbsoluteStr::is_normalized
totypes::RiAbsoluteStr::is_normalized_rfc3986
- List of renamed methods:
- Change return type of
{BorrowedIri}::normalize()
method tonormalize::Normalized
.- List of affected methods:
types::RiStr::normalize()
types::RiAbsoluteStr::normalize()
- List of affected methods:
- Remove some methods of borrowed IRI string types.
- List of removed methods:
types::RiReferenceStr::try_resolve_against()
types::RiReferenceStr::try_resolve_whatwg_against()
types::RiReferenceStr::resolve_whatwg_against()
types::RiReferenceStr::try_resolve_normalize_against()
types::RiReferenceStr::resolve_normalize_against()
types::RiReferenceStr::try_resolve_normalize_whatwg_against()
types::RiReferenceStr::resolve_normalize_whatwg_against()
types::RiStr::try_normalize()
types::RiStr::try_normalize_whatwg()
types::RiStr::normalize_whatwg()
types::RiAbsoluteStr::try_normalize()
types::RiAbsoluteStr::try_normalize_whatwg()
types::RiAbsoluteStr::normalize_whatwg()
types::RiRelativeStr::try_resolve_against()
types::RiRelativeStr::try_resolve_whatwg_against()
types::RiRelativeStr::resolve_whatwg_against()
types::RiRelativeStr::try_resolve_normalize_against()
types::RiRelativeStr::resolve_normalize_against()
types::RiRelativeStr::try_resolve_normalize_whatwg_against()
types::RiRelativeStr::resolve_normalize_whatwg_against()
- List of removed methods:
- Change return type of
{BorrowedIri}::resolve()
method tonormalize::Normalized
.- List of affected methods:
types::RiReferenceStr::resolve_against()
types::RiRelativeStr::resolve_against()
- List of affected methods:
- Remove
BufferError
type. - Remove
task
module.- List of removed items:
task::Error
typetask::ProcessAndWrite
trait
- List of removed items:
- Remove deprecated
percent_encoding
module and aliases defined in it.- List of removed items:
percent_encoding
module.percent_encoding::PercentEncoded
type alias.percent_encoding::PercentEncodedForIri
type alias.percent_encoding::PercentEncodedForUri
type alias.
- List of removed items:
- Change return type of
build::Builder::build()
.- Now it returns
Result<(), validate::Error>
instead ofResult<(), build::Error>
.
- Now it returns
- Remove
build::Builder::normalize_rfc3986()
andbuild::Builder::normalize_whatwg()
methods.- Use
build::Builder::normalize()
andbuild::Builder::ensure_rfc3986_normalizable()
instead.
- Use
- Remove
build::Error
type. - Stop accepting user part as
Option<&str>
type forbuild::Builder::userinfo
- Now user part should be non-optional (but possibly empty)
&str
.
- Now user part should be non-optional (but possibly empty)
- Make methods of
convert::MappedToUri<'_, T>
generic over the spec.- Now methods of
convert::MappedToUri<'_, T>
can be called for{BorrowedIri}<S> where S: Spec
.
- Now methods of
- Reject user with colon characters on IRI build.
- Now
build::Builder::build()
fails whenuser
part contains a colon (:
).
- Now
- Allow builders to normalize
path
component of relative IRIs if safely possible.
- Fix normalization bug.
- Previously, trailing colon of an authority (with empty port) was not stripped. Now this is fixed.
- Add
ensure_rfc3986_normalizable()
methods to absolute IRI string types. - Add IRI builder in
build
module. - Deprecate
percent_encoding
module in favor of the new namepercent_encode
.
- Add
ensure_rfc3986_normalizable()
methods to absolute IRI string types.- List of added functions:
types::RiStr::ensure_rfc3986_normalizable()
types::RiAbsoluteStr::ensure_rfc3986_normalizable()
- List of added functions:
- Add IRI builder in
build
module.Builder
type is a builder.DisplayBulid
type is a validated build result (but not yet heap-allocates).PortBuilder
andUserinfoBuilder
types are intermediate types to provide convenient generics to component setters.Error
type is a builder error.Buildable
trait indicates the syntax corresponding to the string types (such asIriStr
orUriReferenceStr
) can be constructed by the builder.
- Fix normalization bug.
- Previously, trailing colon of an authority (with empty port) was not stripped. Now this is fixed.
- Deprecate
percent_encoding
module in favor of the new namepercent_encode
.- Previously exported items are still provided from
percent_encoding
module to keep backward compatibility.
- Previously exported items are still provided from
- Add
RiQueryStr
andRiQueryString
types for query. - Add functions with
try_
prefix are introduced for normalization and IRI resolution, and deprecate non-try
versions. - Add encoder types for percent-encoding in
percent_encoding
module.
- Add
RiQueryStr
andRiQueryString
types for query. - Add functions with
try_
prefix are introduced for normalization and resolution.- List of added functions:
types::RiStr::try_normalize()
types::RiStr::try_normalize_whatwg()
types::RiAbsoluteStr::try_normalize()
types::RiAbsoluteStr::try_normalize_whatwg()
resolve::try_resolve()
resolve::try_resolve_whatwg()
resolve::try_resolve_normalize()
resolve::try_resolve_normalize_whatwg()
types::RiReferenceStr::try_resolve_against()
types::RiReferenceStr::try_resolve_normalize_against()
types::RiReferenceStr::try_resolve_whatwg_against()
types::RiReferenceStr::try_resolve_normalize_whatwg_against()
types::RiRelativeStr::try_resolve_against()
types::RiRelativeStr::try_resolve_normalize_against()
types::RiRelativeStr::try_resolve_whatwg_against()
types::RiRelativeStr::try_resolve_normalize_whatwg_against()
- List of added functions:
- Add encoder types for percent-encoding in
percent_encoding
module.- List of added types:
percent_encoding::PercentEncoded
percent_encoding::PercentEncodedForIri
(type alias)percent_encoding::PercentEncodedForUri
(type alias)
- List of added types:
- Deprecate non-
try
function names for normalization and resolution.- List of deprecated functions:
types::RiStr::normalize()
types::RiStr::normalize_whatwg()
types::RiAbsoluteStr::normalize()
types::RiAbsoluteStr::normalize_whatwg()
resolve::resolve()
resolve::resolve_whatwg()
resolve::resolve_normalize()
resolve::resolve_normalize_whatwg()
types::RiReferenceStr::resolve_against()
types::RiReferenceStr::resolve_normalize_against()
types::RiReferenceStr::resolve_whatwg_against()
types::RiReferenceStr::resolve_normalize_whatwg_against()
types::RiRiAblosuteStrStr::resolve_against()
types::RiRiAblosuteStrStr::resolve_normalize_against()
types::RiRiAblosuteStrStr::resolve_whatwg_against()
types::RiRiAblosuteStrStr::resolve_normalize_whatwg_against()
- Use functions with
try_
prefix instead.
- List of deprecated functions:
- Implement IRI resolution and normalization that uses serialization algorithm described in WHATWG URL Standard.
- Implement IRI resolution and normalization that uses serialization algorithm
described in WHATWG URL Standard.
- They won't fail even when the input or result is abnormal (but of course they may still fail on memory shortage).
- The difference between RFC 3986/3987 versions and WHATWG versions is,
handling of absent host and path starting with
//
. The RFC versions fail sincescheme://not-a-host
is invalid, but WHATWG versions serializes the result asscheme:/.//not-a-host
. - List of added functions:
resolve::resolve_whatwg()
resolve::resolve_normalize_whatwg()
normalize::NormalizationTask::enable_normalization()
normalize::NormalizationTask::enable_whatwg_serialization()
types::RiStr::is_normalized_whatwg()
types::RiStr::normalize_whatwg()
types::RiAbsoluteStr::is_normalized_whatwg()
types::RiAbsoluteStr::normalize_whatwg()
types::RiReferenceStr::resolve_normalize_whatwg_against()
types::RiReferenceStr::resolve_whatwg_against()
types::RiRelativeStr::resolve_normalize_whatwg_against()
types::RiRelativeStr::resolve_whatwg_against()
- Decode percent-encoded unreserved characters on normalizaiton.
- Add
is_normalized
method to absolute URI/IRI types. - Implement more conversion traits from string types to
Cow
,Box
,Rc
, andArc
. - Improve documents.
- Add
is_normalized
method to absolute URI/IRI types.- They don't heap-allocate.
- Implement more conversion traits from string types to
Cow
,Box
,Rc
, andArc
.- List of added conversions:
From<&'a $slice> for Cow<'a, $slice>
From<&'_ $slice> for Box<$slice>
From<&'_ $slice> for Rc<$slice>
From<&'_ $slice> for Arc<$slice>
From<$owned> for Cow<'_, $owned>
From<$owned> for Box<$owned>
- List of added conversions:
- Decode percent-encoded unreserved characters on normalizaiton.
- Previous implementation incorrectly leave unreserved percent-encoded characters as is, but now this is fixed.
- Fix IPvFuture literal parsing again (#17).
- Fix IPvFuture literal parsing again (#17).
- Add
FixedBaseResolver::base()
method. - Fix IP literal parsing and decomposition (#17).
- Add
FixedBaseResolver::base()
method.
- Fix IP literal parsing and decomposition (#17).
This entry describes the changes since the previous stable release (v0.4.1).
- Bump MSRV to 1.58.0.
- Add more conversions from/to IRI string types.
- Implement
TryFrom<&[u8]>
for the IRI string types. - Implement
From<{owned URI}>
for the owned IRI string types. - Add
as_slice
method to the owned string types. - Add
convert::MappedToUri
type. - Add
encode_to_uri()
method for the IRI string types. - Add
encode_into_uri()
method for the owned IRI string types. - Add
as_uri()
method for the borrowed IRI string types. - Add
try_into_uri()
method for the owned IRI string types.
- Implement
- Add
capacity()
method to the owned string types. - Add components getters for borrowed string types.
- Add IRI normalization API and related types.
- Add normalizing variations for IRI resolution.
- Support nostd for IRI resolution.
- Change IRI resolution API incompatibly.
- Change number and types of parameters.
- Change return types.
- Let IRI resolution recognize percent-encoded period during normalization.
- Drop internal dependency to
nom
crate. - Permit
serde
+{alloc,std}
withoutserde-{alloc,std}
. - Update examples.
- Improve
parse
example to show more information. - Add
normalize
example.
- Improve
- Travis CI is no longer used.
- Checks should be run manually. See README for detail.
- Add more conversions from/to IRI string types.
- Implement
TryFrom<&[u8]>
for the IRI string types. - Implement
From<{owned URI}>
for the owned IRI string types. - Add
as_slice
method to the owned string types. - Add
convert::MappedToUri
type. - Add
encode_to_uri()
method for the IRI string types. - Add
encode_into_uri()
method for the owned IRI string types. - Add
as_uri()
method for the borrowed IRI string types. - Add
try_into_uri()
method for the owned IRI string types.
- Implement
- Add
capacity()
method to the owned string types. - Add components getters for borrowed string types.
- Add getters for major components of IRIs/URIs:
scheme
,authority
,path
, andquery
. - Add types and getters for subcomponents of
authority
:userinfo
,host
, andport
.components::AuthorityComponents
type andauthority_components
method.
- Add getters for major components of IRIs/URIs:
- Add IRI normalization API and related types.
- Add
{RiStr, RiAbsoluteStr}::normalize()
methods. - Add
normalize::NormalizationTask
.
- Add
- Add normalizing variations for IRI resolution.
resolve_normalize
forresolve
.resolve_normalize_against
forresolve_against
.
- Support nostd for IRI resolution.
- Add
resolve::FixedBaseResolver
to getnormalize::NormalizationTask
. - Users can write the resolution/normalization result to user-provided buffer by
NormalizationTask
.
- Add
- Update examples.
- Add
normalize
example.
- Add
- Bump MSRV to 1.58.0.
- Rust 1.58.0 is released at 2022-01-13.
- Change IRI resolution API incompatibly.
- Remove
is_strict: bool
parameter fromresolve::resolve()
. - Make IRI resolution fallible.
- Now IRI resolution returns
Result
. - For details about possible resolution/normalization failure, see the
documentation for
normalize
module and the issue How/..//bar
should be resolved aganstscheme:
? (#8).
- Now IRI resolution returns
- Remove
- Let IRI resolution recognize percent-encoded period during normalization.
- For example,
/%2e%2e/
in the path are now recognized as/../
, and handled specially as "parent directory".
- For example,
- Drop internal dependency to
nom
crate.- Parsers are rewritten manually, and are now much faster than before.
- Permit
serde
+{alloc,std}
withoutserde-{alloc,std}
.- Previously, compilation error are intentionally caused when both
serde
and{alloc,std}
are enabled but correspondingserde-{alloc,std}
is not. - Note that you still need to enable
serde-alloc
orserde-std
to use serde support for owned string types.- This change only intends to support the cases when flags are independently enabled from different indirect dependencies.
- Previously, compilation error are intentionally caused when both
- Update examples.
- Improve
parse
example to show more information.
- Improve
(0.5.0 from 0.5.0-rc.0)
- Travis CI is no longer used.
- Checks should be run manually. See README for detail.
No more API changes are planned until v0.5.0.
- Add more conversions from IRI to URI string types.
- Add
as_uri()
method for the borrowed IRI string types. - Add
try_into_uri()
method for the owned IRI string types.
- Add
- Update examples.
- Improve
parse
example to show more information. - Add
normalize
example.
- Improve
- Add more conversions from IRI to URI string types.
- Add
as_uri()
method for the borrowed IRI string types. - Add
try_into_uri()
method for the owned IRI string types.
- Add
- Update examples.
- Add
normalize
example.
- Add
- Update examples.
- Improve
parse
example to show more information.
- Improve
- Add more conversions from/to IRI string types.
- Implement
From<{owned URI}>
for the owned IRI string types. - Add
as_slice
method to the owned string types. - Add
convert::MappedToUri
type. - Add
encode_to_uri()
method for the IRI string types. - Add
encode_into_uri()
method for the owned IRI string types.
- Implement
- Refine task API
- Move some methods of
normalize::NormalizationTask
into newly addedtask::ProcessAndWrite
trait.allocate_and_write
,write_to_byte_slice
,append_to_std_string
, andtry_append_to_std_string
is moved.
- Change type parameter of
NormalizationTask
from a spec into a string slice type. - Change error type for
NormalizationTask
. - Remove
normalize::create_task()
function.
- Move some methods of
- Add more conversions from/to IRI string types.
- Implement
From<{owned URI}>
for the owned IRI string types. - Add
as_slice
method to the owned string types. - Add
convert::MappedToUri
type. - Add
encode_to_uri()
method for the IRI string types. - Add
encode_into_uri()
method for the owned IRI string types.
- Implement
- Move some methods of
normalize::NormalizationTask
into newly addedtask::ProcessAndWrite
trait.allocate_and_write
,write_to_byte_slice
,append_to_std_string
, andtry_append_to_std_string
is moved.
- Change type parameter of
NormalizationTask
from a spec into a string slice type.- Now
NormalizationTask<S>
should be changed toNormalizationTask<RiStr<S>>
orNormalizationTask<RiAbsoluteStr<S>>
. - This enables the task to return more appropriate type. For example,
returning
&RiAbsoluteStr<S>
rather than&RiStr<S>
when the input IRI type isRiAbsoluteStr<S>
.
- Now
- Change error type for
NormalizationTask
.- Now buffer error and processing error is split to different types.
- Remove
normalize::create_task()
function.
- Add
normalize
module, and unify it with IRI resolution.- Move
resolve::{Error, ErrorKind}
tonormalize
module. - Move and rename
resolve::ResolutionTask
tonormalize::NormalizationTask
. - Add
normalize::create_task
function. - Add
{RiStr, RiAbsoluteStr}::normalize()
methods.
- Move
- Add normalizing variations for IRI resolution.
- Add
normalize
module.- Add
normalize::create_task()
function. - Add
{RiStr, RiAbsoluteStr}::normalize()
methods.
- Add
- Add normalizing variations for IRI resolution.
resolve_normalize
forresolve
.resolve_normalize_against
forresolve_against
.
- Move
resolve::{Error, ErrorKind}
tonormalize
module. - Move and rename
resolve::ResolutionTask
tonormalize::NormalizationTask
.- Now
resolve::FixedBaseResolver::create_task()
returnsNormalizationTask
.
- Now
- Fix a bug that
serde-std
feature did not enable serde support for owned types.
- Fix a bug that
serde-std
feature did not enable serde support for owned types.- Now
serde-std
enablesalloc
features automatically.
- Now
- Add getters for major components of IRIs/URIs:
scheme
,authority
,path
, andquery
. - Add types and getters for subcomponents of
authority
:userinfo
,host
, andport
.components::AuthorityComponents
type andauthority_components
method.
- Fix a bug that
serde-std
feature did not enable serde support for owned types.
- Add getters for major components of IRIs/URIs:
scheme
,authority
,path
, andquery
.- Method names are
scheme_str
,authority_str
,path_str
, andquery_str
, respectively. - Getters for
fragment
component is already provided.
- Method names are
- Add getter for subcomponents of
authority
:userinfo
,host
, andport
.components::AuthorityComponents
type andauthority_components
method.
- Fix a bug that
serde-std
feature did not enable serde support for owned types.- Now
serde-std
enablesalloc
features automatically.
- Now
- Bump MSRV to 1.58.0.
- Add conversion from a byte slice (
&[u8]
) into IRI string types. - Add
capacity
method to allocated string types. - Remove
is_strict: bool
parameter fromresolve::resolve()
. - Add
resolve::FixedBaseResolver
,resolve::ResolutionTask
, andresolve::Error
types.- Some methods for IRI resolution are now available even when
alloc
feature is disabled. - See IRI resolution using user-provided buffers (#6).
- Some methods for IRI resolution are now available even when
- Make IRI resolution fallible.
- Now
resolve()
and its family returnsResult<_, resolve::Error>
. - See How
/..//bar
should be resolved aganstscheme:
? (#8).
- Now
- Make IRI resolution recognize percent-encoded period.
- Now
%2E
and%2e
in path segment is handled as a plain period.
. - See Recognize percent-encoded periods (
%2E
) during IRI resolution (#9)
- Now
- Make parsers faster.
- Drop internal dependency to
nom
. - Stop emitting compilation error when both
serde
andstd
/alloc
are enabled without correspondingserde-{std,alloc}
features.
- Add conversion from a byte slice (
&[u8]
) into IRI string types. - Add
capacity
method to allocated string types.shrink_to_fit()
andlen()
already exists, so this would be useful to determine when to doshrink_to_fit
.
- Add
resolve::FixedBaseResolver
,resolve::ResolutionTask
, andresolve::Error
types.- They provide more efficient and controllable IRI resolution.
- Some methods for IRI resolution are now available even when
alloc
feature is disabled.
- Bump MSRV to 1.58.0.
- Rust 1.58.0 is released at 2022-01-13.
- Remove
is_strict: bool
parameter fromresolve::resolve()
.- The IRI parsers provided by this crate is "strict", so resolution algorithm should use an algorithm for the strict parser.
- Make IRI resolution fallible.
- Now
resolve()
and its family returnsResult<_, resolve::Error>
. - For the reasons behind, see crate-level documentation.
- See How
/..//bar
should be resolved aganstscheme:
? (#8).
- Now
- Make IRI resolution recognize percent-encoded period.
- Now
%2E
and%2e
in path segment is handled as a plain period.
. - Period is
unreserved
character, and can be escaped at any time (see RFC 3986 section 2.4. This means that%2E
and%2e
in the path can be normalized to.
before IRI resolution, and thus they should also be handled specially duringremove_dot_segments
algorithm. - See Recognize percent-encoded periods (
%2E
) during IRI resolution (#9)
- Now
- Make parsers faster.
- Parsers are rewritten, and they became very fast!
- Almost all usages are affected: type conversions, validations, and IRI resolutions.
- See Make the parsers faster (#7)
- Drop internal dependency to
nom
.- Parsers are rewritten without
nom
.
- Parsers are rewritten without
- Stop emitting compilation error when both
serde
andstd
/alloc
are enabled without correspondingserde-{std,alloc}
features.serde
andstd
/alloc
might be enabled independently from the different indirect dependencies, so this situation should not be compilation error.
- Bump internal dependency.
nom
from v6 to v7.
- Bump internal dependency.
nom
from v6 to v7.
- MSRV is bumped to 1.48.0.
- Internal dependencies are bumped.
nom
crate is bumped to 6.
serde::{Serialize, Deserialize}
is now implemented only for types with valid spec types.- Feature flags are refactored.
- MSRV is bumped to 1.48.0.
- Rust 1.48.0 is released at 2020-11-19.
serde::{Serialize, Deserialize}
is now implemented only for types with valid spec types.- Strictly this is a breaking change, but this only forbids the meaningless trait impls, so no real world use cases won't be affected by this change.
- Feature flags are refactored.
serde-alloc
andserde-std
flags are added to control serde's alloc and std support.- Unintended dependency from
std
use flag toserde
crate is now fixed. Users who want to enableserde
andstd
at the same time should also enableserde-std
feature. Same applies forserde
andalloc
pair.
This release contains huge changes, and CHANGELOG may be incomplete. Beleive rustdoc rather than this CHANGELOG.
- Minimum supported Rust version is now 1.41 or above.
- Make IRI string types polymorphic, and rename some types.
- Now IRI types and URI types can share the same codebase.
- This makes it easy for users to implement functions for both IRI types and URI types.
- Add URI types.
- Remove
Deref
impls for IRI string types. - Remove depraceted items.
- Add and change methods for IRI string types.
resolve::resolve_iri
is now (more) polymorphic, and renamed toresolve::resolve
.- Update some internal dependencies.
- This has no effect for usual users, and this does not introduce any API changes.
- By this change, the crate now successfully compiles with minimal dependency versions.
- Support
no_std
environment.std
andalloc
feature flags are added.std
feature is enabled by default (andstd
enablesalloc
automatically).
- Update some internal dependencies to make the crate buildable with minimal dependency versions.
- This has no effect for usual users, and this does not introduce any API changes.
- By this change, the crate now successfully compiles with minimal dependency versions.
- To test that, you can run
cargo +nightly update -Z minimal-versions && cargo test --all-features
.
- To test that, you can run
- Make IRI string types polymorphic, and rename some types.
- Now IRI types and URI types can share the same codebase.
- This makes it easy for users to implement functions for both IRI types and URI types.
- Polymorphic types are named
types::Ri{,Absolute,Fragment,Reference,Relative}Str{,ing}
. - Type aliases for monomorphized types are also provided, but naming convertions are the same.
They are named
{Iri,Uri}{..}Str{,ing}
.- For example, there is
IriAbsoluteStr
instead of legacyAbsoluteIriStr
.
- For example, there is
types::CreationError
is now revived.types::IriCreationError
is now removed in favor oftypes::CreationError
.
- Remove depraceted items.
IriReferenceStr::resolve()
is now removed. UseIriReferenceStr::resolve_against()
instead.
- Remove
Deref
impls for IRI string types.- IRI string types should not implement
Deref
, because they are not smart pointer types.
- IRI string types should not implement
- Change methods types.
IriReferenceStr::resolve_against()
now returnsCow<'_, IriStr>
, rather thanIriString
.
resolve::resolve_iri
is now polymorphic, and renamed toresolve::resolve
.- Now it can be used for both IRI types and URI types.
- Support
no_std
environment.std
andalloc
feature flags are added.std
feature is enabled by default (andstd
enablesalloc
automatically).- In
no_std
environment with allocator support, you can enablealloc
feature.
- Add methods for IRI string types.
len()
andis_empty()
methods are added to all IRI string slice types.IriStr::fragment()
is added.RelativeIriStr::resolve_against()
is added.
- Add URI types.
- Fixed a bug that URI validators wrongly accepts non-ASCII characters.
- Now they rejects non-ASCII characters correctly.
- Fixed a bug that abnormal URIs (such as
foo://
orfoo:////
) are wrongly rejected.- Now they are accepted as valid IRIs.
- Fixed a bug that URI validators wrongly accepts non-ASCII characters
(9b8011f54dab3c2f8da78dc2251353453317d8af).
- Now they rejects non-ASCII characters correctly.
- Fixed a bug that abnormal URIs (such as
foo://
orfoo:////
) are wrongly rejected (7a40f4b72964d498970a356368dc320917d88e43).- Now they are accepted as valid IRIs.
- Documents are added to explain why they are valid.
- More tests are added to ensure invalid URIs/IRIs are rejected as expected (9b8011f54dab3c2f8da78dc2251353453317d8af).
IriReferenceStr::resolve()
is renamed toresolve_against()
.- The old name will be kept until the next minor version bump to keep compatibility.
IriReferenceStr::resolve()
is renamed toresolve_against()
(4d64ee9884713644b69b8f227f32637d877a9d5f).resolve()
was an ambiguous name, and people cannot know whichfoo.resolve(bar)
means: "resolve foo against bar" or "foo resolves bar".- The new name
resolve_against()
is more clear.foo.resolve_against(bar)
can be natuarally interpreted as "resolve foo against bar". - The old name will be kept until the next minor version bump to keep compatibility.
*Str::new()
methods are added.IriFragmentStr::from_prefixed()
is added.types::CreationError
is renamed totypes::IriCreationError
.- The old name will be kept until the next minor version bump to keep compatibility.
- Reduced indirect dependencies
*Str::new()
methods are added (39c8f735ccf6f28aaf2f16dcdc579fb3838bb5fb).- Previously the string slices are created as
<&FooStr>::try_from(s)
(wheres: &str
), but this is redundant. NowFooStr::new(s)
can be used instead of<&FooStr>::try_from(s)
fors: &str
.
- Previously the string slices are created as
IriFragmentStr::from_prefixed()
is added (34cec2f422ba8046134668bdb662f69c9db7f52c).- This creates
IriFragmentStr
from the given string with leading hash (#
) character. For example,IriFragmentStr::from_prefixed("#foo")
is same asIriFragmentStr::new("foo")
.
- This creates
types::CreationError
is renamed totypes::IriCreationError
(c6e930608f158281d059e632ffc6117bddf18ebc, c0e650c5e19f1775cf82960afc9610994afba66e).- The old name will be kept until the next minor version bump to keep compatibility.
- Disabled
lexical
feature ofnom
crate (a2d5bcd02e02e80af1c4fc8c14d768ca519ef467).- This reduces indirect dependencies.
- Migrate code generator from proc-macro crate to non-proc-macro one
(363337e720a9fdfa7e17153ffc63192bd49f7cc3).
- This reduces indirect dependencies, and may also reduce compilation time.
- Use nom 5.0.0.
- This is non-breaking change.
- Implement
Clone
andCopy
for validation error types. - Let an error type contain source string for conversion from owned string.
- Add
shrink_to_fit()
methods fortypes::iri::*String
types. - Add
set_fragment()
methods fortypes::iri::*String
types (except forAbsoluteIriString
). - Add
as_str()
method fortypes::iri::*Str
types. - Add
types::iri::IriFragment{Str,String}
type. - Move
fragment()
fromIriStr
toIriReferenceStr
.
- Implement
Clone
andCopy
for validation error types (validate::{iri,uri}::Error
) (8c6af409963a).
- Add
shrink_to_fit()
methods fortypes::iri::*String
types (c8671876229f). - Add
set_fragment()
methods fortypes::iri::*String
types (except forAbsoluteIriString
) (5ae09a327d93). - Add
as_str()
method fortypes::iri::*Str
types (0984140105a1). - Add
types::iri::IriFragment{Str,String}
type (1c5e06192cf8).- This represents fragment part of an IRI.
types::iri::{AbsoluteIri,Iri,IriReference,RelativeIri}String::TryFrom<_>
now returnstypes::iri::CreationError
as an error (8c6af409963a).CreationError
owns the source data so that it is not lost on conversion failure.CreationError::into_source()
returns the source data which cannot be converted into an IRI type.- Previously
validate::iri::Error
is used to represent error, but it does not own the source data.
- Move
fragment()
fromIriStr
toIriReferenceStr
(1c5e06192cf8).v.fragment()
forv: &IriStr
is still available thanks toDeref
.
Totally rewritten.