Comments (5)
There is a question of types. Looking at the Python version that does the wrapping, and imagining the same actions...
- A simple type is easy, I think.
|_:T| |x: u16| MessageItem::UInt16(x)
should do it, assuming a signature of 'q' The type is obvious. - An array is tricky, maybe. We have to take a function arg, the function for handling the array elements. So, something like:
|func| |vec: Vec<T>| MessageItem::Array(<calling func on each element>)
. What is the type of func?T -> MessageItem
, presumably.
The parameter type of the inner functiion will vary. Ultimately, it will depend on the signature.
But it will end up being applied to something of the correct type.
Of course, whether or not there is a Rust parser that will do the trick is not yet known.
There is not an obviously better way, though.
Probably the best way to use such a function would be to define methods that simply returned the message values as a tuple of native Rust types.
Then define a generic function that takes a return message and the arguments, transforms the arguments, and appends them to the message before returning.
from stratisd.
rust peg would work just fine: https://github.com/kevinmehall/rust-peg
from stratisd.
This blog article gives a long list of other: http://smallcultfollowing.com/babysteps/blog/2015/09/14/lalrpop/.
- nom is definitely overkill
- oak looks thorough and is embeddable as an extension, which is nice
- nailgun is not ready, says the developer
- peggler, ditto
- combine looks promising
- LALRPOP might be excessive
- racc is not ready
- lemon_rust doesn't look bad either
from stratisd.
Well, it turns out that the CLI approach is absolutely impossible, because it would require Rust to have dependent types, which it doesn't.
It also turns out that the dbus-rs has functionality that is supposed to make this much easier, but it seems to prevent our distinguishing between missing arguments and arguments with the wrong type.
See: diwic/dbus-rs#51.
from stratisd.
Closed by #76.
from stratisd.
Related Issues (20)
- Avoid creating XFS filesystems with 64 bit extent count
- Support origin field for filesystem snapshots
- missing stratis pool after update to Fedora 39: thin_repair out of metadata space HOT 47
- Add human readable result to stratis-dumpmetadata
- Should we log output of executable invocations at the info level, regardless of whether there is an error returned?
- Add ability to overwrite pool-level metadata to stratis-dumpmetadata
- Use already defined Name type to enforce validity of Names
- Address large_enum_variant clippy allow on DeviceInfo in identify.rs
- Address static_mut_refs clippy allow in dm.rs
- Address allowed use of deprecated flock function HOT 2
- `stratis-min pool start` fails with EBADF HOT 5
- stratis-fstab-setup calls `stratis-min pool is-encrypted` without argument
- Do password verification on user-entered password value in stratis-min
- Add support for online encrypt, decrypt, and reencrypt in stratisd metadata version 2
- Feature request for multiple encrypt unlock mechanisms HOT 6
- Usability of key descriptions
- For stratis-min, failure to scan a UUID when a UUID is expected should really be a parsing error
- Support issuing an instruction for Stratis filesystem merge and storing the instruction in filesystem metadata HOT 1
- Support merging a snapshot based on stored instruction in filesystem level metadata HOT 3
- D-Bus notification for org.storage.stratis3.filesystem.r*.Used is missing 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 stratisd.