Re-export key identifiers at crate root

This commit is contained in:
Isaiah Inuwa 2020-06-07 13:52:27 -05:00
parent 29a6c94a4f
commit baa8710456
2 changed files with 32 additions and 1 deletions

View File

@ -11,7 +11,7 @@ Breaking changes:
Improvements:
* Add `DeviceKeyId`, `KeyAlgorithm`, and `ServerKeyId`
* Add `DeviceKeyId`, `DeviceKeyAlgorithm`, `ServerKeyId`, and `ServerKeyAlgorithm`
# 0.16.2

View File

@ -36,6 +36,21 @@ pub mod room_version_id;
pub mod server_key_id;
pub mod user_id;
/// Allowed algorithms for homeserver signing keys.
pub type DeviceKeyAlgorithm = key_algorithms::DeviceKeyAlgorithm;
/// An owned device key identifier containing a key algorithm and device ID.
///
/// Can be created via `TryFrom<String>` and `TryFrom<&str>`; implements `Serialize`
/// and `Deserialize` if the `serde` feature is enabled.
pub type DeviceKeyId = device_key_id::DeviceKeyId<Box<str>>;
/// A reference to a device key identifier containing a key algorithm and device ID.
///
/// Can be created via `TryFrom<&str>`; implements `Serialize` and `Deserialize`
/// if the `serde` feature is enabled.
pub type DeviceKeyIdRef<'a> = device_key_id::DeviceKeyId<&'a str>;
/// An owned device ID.
///
/// While this is currently just a `String`, that will likely change in the future.
@ -103,6 +118,22 @@ pub type RoomVersionId = room_version_id::RoomVersionId<Box<str>>;
/// `Serialize` if the `serde` feature is enabled.
pub type RoomVersionIdRef<'a> = room_version_id::RoomVersionId<&'a str>;
/// Allowed algorithms for homeserver signing keys.
pub type ServerKeyAlgorithm = key_algorithms::ServerKeyAlgorithm;
/// An owned homeserver signing key identifier containing a key algorithm and version.
///
/// Can be created via `TryFrom<String>` and `TryFrom<&str>`; implements `Serialize`
/// and `Deserialize` if the `serde` feature is enabled.
pub type ServerKeyId = server_key_id::ServerKeyId<Box<str>>;
/// An reference to a homeserver signing key identifier containing a key
/// algorithm and version.
///
/// Can be created via `TryFrom<&str>`; implements `Serialize`
/// and `Deserialize` if the `serde` feature is enabled.
pub type ServerKeyIdRef<'a> = server_key_id::ServerKeyId<&'a str>;
/// An owned user ID.
///
/// Can be created via `new` (if the `rand` feature is enabled) and `TryFrom<String>` +