Trait asn1_rs::TestValidCharset
source · pub trait TestValidCharset {
// Required method
fn test_valid_charset(i: &[u8]) -> Result<()>;
}
Expand description
Base trait for BER string objects and character set validation
This trait is implemented by several types, and is used to determine if some bytes would be valid for the given type.
§Example
use asn1_rs::{PrintableString, TestValidCharset, VisibleString};
let bytes: &[u8] = b"abcd*4";
let res = PrintableString::test_valid_charset(bytes);
assert!(res.is_err());
let res = VisibleString::test_valid_charset(bytes);
assert!(res.is_ok());
Required Methods§
sourcefn test_valid_charset(i: &[u8]) -> Result<()>
fn test_valid_charset(i: &[u8]) -> Result<()>
Check character set for this object type.
Object Safety§
This trait is not object safe.