Comments (5)
That's a good point. Made it public in 5.1.1
from suppaftp.
Probably a trait would be needed, but it's not that easy to implement here.
Anyway at the time I didn't think much about your request, but there's no need to use the plain FTP stream if secure is enabled. You can just use the RustlsFtpStream
or NativeTlsFtpStream
and call into_secure
only if secure = true
from suppaftp.
Thanks a lot for the quick response to this! I had a go at doing what I need to do with the new version but somehow didn't quite get it to work. I'm sure this will expose my ignorance when it comes to some Rust concepts, but since ImplFtpStream
is actually a struct and not a trait, I'm not able to use it as a dyn
type.
Is there a way to write code that will set up an ftp_stream
that is generic over ImplFtpStream
(regardless of whether the encapsulated stream is secure or not) and can then carry out the login()
and other methods that are common to both types of connection? Sorry if I'm missing something simple...
from suppaftp.
FWIW I wrote a bit about my attempts to do this, and got some advice on the user forum here: https://users.rust-lang.org/t/more-elegant-way-to-call-generic-methods-on-a-struct/92397
from suppaftp.
Oh wow, that's a very good point! Didn't occur to me to try that at all. Seems to work perfectly also.
from suppaftp.
Related Issues (20)
- [BUG] - features are not additive HOT 3
- [Feature Request] - Expose DataStream to users HOT 1
- Damaged uploaded image HOT 3
- [Feature Request] - Set a timeout on FTP connect
- [QUESTION] - Reading files when using AsyncFtpStream HOT 2
- [QUESTION] - How to properly use resume_transfer HOT 5
- Problem setting up TLS -> bad server or bad client? HOT 2
- [Feature Request] - Add Send trait to AsyncFtpStream/FtpStream
- [SECURITY] - upgrade chrono->time dependency HOT 1
- [QUESTION] - Is it support download large file? HOT 2
- [BUG] - Async TLS example fails to compile HOT 1
- [BUG] - list method request failed BadResponse HOT 6
- [Feature Request] - OPTS and FEAT commands support
- [BUG] - expected `AsyncNoTlsStream`, found `AsyncNativeTlsStream` HOT 1
- [BUG] - Ftp with TLS (native-tls) Not working HOT 4
- [QUESTION] - 522 SSL connection failed
- [Feature Request] - Build the docs with doc_cfg
- [BUG] - POSIX setgid/setuid/sticky bits not supported
- [Feature Request] - Better composability HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from suppaftp.