Skip to content

Add Textual Encoding codec #453

@XAMPPRocky

Description

@XAMPPRocky

Rasn should be capable of outputting what the ASN.1 textual encoding of a type. I think this is something that would be useful for writing modules and for debugging types. I think this should probably be able to work with just the AsnType trait, since we don't actually need to traverse the type through the codec traits.

Example

#[derive(AsnType)]
struct Foo {
  member: String
}

println!("{}", rasn::text::to_string::<Foo>());

Output

Foo  ::=  SEQUENCE  {
     member       UTF8String
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions