Skip to main content

SecureEncoding

Trait SecureEncoding 

Source
pub trait SecureEncoding { }
Expand description

Marker trait for types that support secure encoding operations.

Automatically implemented for any type that implements AsRef<[u8]>, such as &[u8], Vec<u8>, [u8; N], etc.

It does not gate the encoding traits. Every To* blanket is bounded on AsRef<[u8]> + EncodableBytes, and this marker is implemented for str and String too — precisely the types EncodableBytes exists to reject. Nothing in the crate bounds on this trait; the 0.9 line removed it. It is retained here for backwards compatibility.

Since this is a marker trait (no methods), it exists only to allow trait bounds and extension methods to be available where appropriate.

Requires at least one encoding-* feature to be enabled.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<T: AsRef<[u8]> + ?Sized> SecureEncoding for T

Available on crate features encoding-base32 or encoding-base64 or encoding-bech32 or encoding-hex only.