sozu-proxy / circular Goto Github PK
View Code? Open in Web Editor NEWstream abstraction designed for use with nom
License: MIT License
stream abstraction designed for use with nom
License: MIT License
It would be nice if this crate would provide optional glue code to the bytes
crate, with which I mean implementing the bytes::{Buf,BufMut}
traits, to allow easier integration with other existing code, e.g. poll-buf-utils
. It is probably a good idea to support a wide range of bytes
crate versions, as the Buf
& BufMut
traits are present in that crate since almost the first versions, and haven't changed at all.
When trying to run my program with miri, it reports UB, however with the note that "the Stacked Borrows rules it violated are still experimental". This minimal example UBs according to miri. I don't know how to make it more minimal unfortunately without investing too much time into it. I'm not using circular
directly, it's a transitive dependency through rc-zip
.
use rc_zip::prelude::*;
fn main() -> Result<(), Box<dyn std::error::Error>> {
let f = &include_bytes!("../tests/data/Test.docx")[..];
let a = f.read_zip_with_size(f.len() as u64).unwrap();
let entry = a.by_name("word/document.xml").unwrap();
let mut doc = xml::EventReader::new(entry.reader());
let _ = doc.next();
Ok(())
}
Cargo.toml:
[package]
name = "ziptest"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
rc-zip = "2.0.1"
xml-rs = "0.8.16"
Is this a valid concern or a false positive?
Test.docx (but any Word document should do I guess)
Output:
Full output: output.txt
Hi @Geal ,
The consume
method shifts data if >= half the buffer. I'm using the circular
crate as a fixed-position buffer (for multi-threading) and need to control when data is moved.
Would you be OK for adding a new method (consume_noshift
or something ilke that) which just adds cnt
without shifting data ? I can provide a patch :)
The memory
element has a capacity()
and a len()
method (I think memory.len()
might be the appropriate equivalent to self.capacity
), why is it necessary to have another struct element capacity
in the struct Buffer
? This seems like duplicate book-keeping to me, why is that necessary?
see also: example of reduction
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.