Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Solve character string types in a nicer way #48

Open
kellerkindt opened this issue Mar 11, 2021 · 0 comments
Open

Solve character string types in a nicer way #48

kellerkindt opened this issue Mar 11, 2021 · 0 comments

Comments

@kellerkindt
Copy link
Owner

Currently each character string type has its own read_*/write_* fn which every Reader/Writer must implement

    fn read_utf8string<C: utf8string::Constraint>(&mut self) -> Result<String, Self::Error>;

    fn read_ia5string<C: ia5string::Constraint>(&mut self) -> Result<String, Self::Error>;

    fn read_numeric_string<C: numericstring::Constraint>(&mut self) -> Result<String, Self::Error>;

    fn read_visible_string<C: visiblestring::Constraint>(&mut self) -> Result<String, Self::Error>;

    fn read_printable_string<C: printablestring::Constraint>(
        &mut self,
    ) -> Result<String, Self::Error>;

Consider a common fn (like read_characters?) and pass the Charset as (type) parameter? Same with the Utf8String, Ia5String, ... types.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant