actix-fs/README.md

38 lines
1.6 KiB
Markdown
Raw Normal View History

2020-05-25 19:47:10 +00:00
# Actix FS
_Asyncronous filesystem operations for actix-based systems_
## Usage
```rust
use std::io::SeekFrom;
#[actix_rt::main]
async fn main() -> Result<(), anyhow::Error> {
let file = actix_fs::open("tests/read.txt").await?;
let (file, position) = actix_fs::seek(file, SeekFrom::Start(7)).await?;
let bytes = actix_fs::read_bytes(file).await?;
assert!(position == 7);
assert!(bytes.as_ref() == b"World!\n");
Ok(())
}
```
### Contributing
Unless otherwise stated, all contributions to this project will be licensed under the CSL with
the exceptions listed in the License section of this file.
### License
This work is licensed under the Cooperative Software License. This is not a Free Software
License, but may be considered a "source-available License." For most hobbyists, self-employed
developers, worker-owned companies, and cooperatives, this software can be used in most
projects so long as this software is distributed under the terms of the CSL. For more
information, see the provided LICENSE file. If none exists, the license can be found online
[here](https://lynnesbian.space/csl/). If you are a free software project and wish to use this
software under the terms of the GNU Affero General Public License, please contact me at
[asonix@asonix.dog](mailto:asonix@asonix.dog) and we can sort that out. If you wish to use this
project under any other license, especially in proprietary software, the answer is likely no.
Actix FS is currently licensed under the AGPL to the Lemmy project, found
at [github.com/LemmyNet/lemmy](https://github.com/LemmyNet/lemmy)