Benign cargo Download

bytes.rs

Rust test marker or harnessMegabyte-scale size constant in source
SHA-256d56de5b0aef728bd3424722f45d188ea3f6bce7d675380cbdf757312b643dc6f

Evidence

imports buf::Iter lines 1–20
1use {IntoBuf, Buf, BufMut};
2use buf::Iter;
3use debug;
4
5use std::{cmp, fmt, mem, hash, ops, slice, ptr, usize};
6use std::borrow::{Borrow, BorrowMut};
7use std::io::Cursor;
8use std::sync::atomic::{self, AtomicUsize, AtomicPtr};
9use std::sync::atomic::Ordering::{Relaxed, Acquire, Release, AcqRel};
10use std::iter::{FromIterator, Iterator};
11
12/// A reference counted contiguous slice of memory.
13///
14/// `Bytes` is an efficient container for storing and operating on contiguous
15/// slices of memory. It is intended for use primarily in networking code, but
16/// could have applications elsewhere as well.
17///
18/// `Bytes` values facilitate zero-copy network programming by allowing multiple
19/// `Bytes` objects to point to the same underlying memory. This is managed by
20/// using a reference count to track when the memory is no longer needed and can
English function-word token "that" lines 89–90
89:3… / guaranteed to be the only handle able to view that slice of memory. As such,
90/// `BytesMut` handles are able to mutate the underlying memory. Note …
Rust calls mem::transmute lines 1851–1856
1851:11… ine_len(&self) -> usize {
1852 let p: &usize = unsafe { mem::transmute(&self.arc) };
1853 (p & INLINE_LEN_MASK) >> INLINE_LEN_OFFSET
1854 }
1855
1856 /// Set the length of the inline buffer. This is don …
#[test] attribute lines 2497–2506
⋯4 lines
2501}
2502
2503#[test]
2504fn test_original_capacity_to_repr() {
2505 for &cap in &[0, 1, 16, 1000] {
2506 assert_eq!(0, original_capacity_to_repr(cap)) …
Megabyte-scale size constant in source lines 2517–2525
2517:13… more
2518
2519 for &cap in &[65536, 65537, 68000, 1 << 17, 1 << 18, 1 << 20, 1 << 30] {
2520 assert_eq!(7, original_capacity_to_repr(cap), "cap={}", cap);
2521 }
⋯4 lines

Keyboard shortcuts on this page: j for the next sample, k for the previous one, x to go back to the feed, d to download the original bytes, r to re-queue the sample for analysis.