Skip to content

FtpStream::retr should allow a more generic error type #5

@dodomorandi

Description

@dodomorandi

FtpStream::retr is very useful, because it allows parsing streaming data from the server and, at the same time, it automatically handles FTP response statuses.

However, there is a major issue related to the error type of the inner function: if you need to perform non-trivial parsing of the remote data, you will end up with a richer set of errors, making FtpStream::retr unusable because FtpError cannot encapsulate all the possible errors anymore.

I propose to change the return type from Result<T, FtpError> to Result<T, E> where E: From<FtpError>. If you like the idea, I will be glad to send you a PR.

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