You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I hope you get a head start in the new year. In fact, the influenza is wild this year. Hope you are well too!
I am starting the final part of OpenDAL's Ruby binding. I am implementing:
A base class called Layer that works as a marker to accept any "layers". A layer is a concept that adds functionality to an operator (Operator is the main API to access files).
RetryLayer
ConcurrentLimitLayer.
Both of these subclasses are builders that I will build binding functions for users to configure. Usage should look like this:
layer=RetryLayer.newop=Operator.new.layer(layer)
On Rust end, the Operator#layer is simple:
fnlayer(&self,layer:&layers::Layer) -> Result<Self,Error>{let op = layer.0.layer()// ...}
The layers that I want to implement look like this:
Bind a subclass to interface and pass that to a function.
The reason not to use enum is that most of the functions for these layers are different. What would be a good approach to use only a Rust function in a class hierarchy?
As a side, this idea of implementation is mostly from OpenDAL python binding and pyo3.
Hi, I hope you get a head start in the new year. In fact, the influenza is wild this year. Hope you are well too!
I am starting the final part of OpenDAL's Ruby binding. I am implementing:
Layer
that works as a marker to accept any "layers". A layer is a concept that adds functionality to an operator (Operator
is the main API to access files).RetryLayer
ConcurrentLimitLayer
.Both of these subclasses are builders that I will build binding functions for users to configure. Usage should look like this:
On Rust end, the
Operator#layer
is simple:The layers that I want to implement look like this:
I want to have ways to:
The reason not to use
enum
is that most of the functions for these layers are different. What would be a good approach to use only a Rust function in a class hierarchy?As a side, this idea of implementation is mostly from OpenDAL python binding and pyo3.
The code is here.
The text was updated successfully, but these errors were encountered: