clucompany / cluflock Goto Github PK
View Code? Open in Web Editor NEWInstallation and subsequent safe removal of flock locks for data streams.
License: Apache License 2.0
Installation and subsequent safe removal of flock locks for data streams.
License: Apache License 2.0
Any plans on extending the API to support range-based locks? Both fcntl & LockFileEx support this I think so all platforms should be doable.
If I have an async_std::fs::File
object, how do I use this API to acquire a lock? It seems like it operates on the actual std::fs::File
object rather than on AsRawFd
/AsRawHandle
traits?
When using cluFlock
on a wasm32-unknown-unknown
build target I receive the errors
error[E0277]: the trait bound `File: FlockElement` is not satisfied.
error[E0277]: the trait bound `File: WaitFlockUnlock` is not satisfied.
I am using the settings_manager
crate in a Tauri application. settings_manager
depends on cluFlock
. When building the application, which depends on settings_manager
, to a wasm32-unknown-unknown
target I receive the errors. However, when building to other targets (specifically x86_64-unknown-linux-gnu
) everything builds fine.
Dependency graph
cluFlock
<- settings_manager
<- Tauri application
I wasn't sure what the most useful info to provide here was, so tried to give an overview. If there is anything else that would be useful, please let me know.
I'm using the anyhow
crate for error handling, and when I declare a function to use the anyhow::Result
type, I can't get with_context
and ?
to work properly with functions from this crate here. For example:
SharedFlock::wait_lock(&lock_file)?
generates an error:
error[E0277]: the trait bound `FlockError<&std::fs::File>: StdError` is not satisfied
--> src\config_file.rs:65:47
|
65 | SharedFlock::wait_lock(&lock_file)?
| ^ the trait `StdError` is not implemented for `FlockError<&std::fs::File>`
|
= note: required because of the requirements on the impl of `From<FlockError<&std::fs::File>>` for `anyhow::Error`
= note: required because of the requirements on the impl of `FromResidual<Result<Infallible, FlockError<&std::fs::File>>>` for `Result<JuliaupConfig, anyhow::Error>`
note: required by `from_residual`
--> C:\Users\david\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib/rustlib/src/rust\library\core\src\ops\try_trait.rs:339:5
|
339 | fn from_residual(residual: R) -> Self;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
For more information about this error, try `rustc --explain E0277`.
Not entirely clear to me what the problem is, maybe the error struct in cluFlock
just needs to formally implement the std::Error
trait? https://crates.io/crates/anyhow might have some info that someone with more Rust experience than me might be able to understand :)
Great package, thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.