repo
stringlengths
6
65
file_url
stringlengths
81
311
file_path
stringlengths
6
227
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-04 15:31:58
2026-01-04 20:25:31
truncated
bool
2 classes
neon-bindings/neon
https://github.com/neon-bindings/neon/blob/22098e4d9f1c4b29447671298bc839476b6826dc/crates/neon/src/types_impl/extract/json.rs
crates/neon/src/types_impl/extract/json.rs
//! Extract JavaScript values with JSON serialization //! //! For complex objects that implement [`serde::Serialize`] and [`serde::Deserialize`], //! it is more ergonomic--and often faster--to extract with JSON serialization. The [`Json`] //! extractor automatically calls `JSON.stringify` and `JSON.parse` as necessary....
rust
Apache-2.0
22098e4d9f1c4b29447671298bc839476b6826dc
2026-01-04T15:47:42.000902Z
false
neon-bindings/neon
https://github.com/neon-bindings/neon/blob/22098e4d9f1c4b29447671298bc839476b6826dc/crates/neon/src/types_impl/extract/error.rs
crates/neon/src/types_impl/extract/error.rs
use std::{convert::Infallible, error, fmt, marker::PhantomData}; use crate::{ context::{Context, Cx}, result::JsResult, types::{ extract::{private, TryIntoJs}, JsError, JsValue, Value, }, }; type BoxError = Box<dyn error::Error + Send + Sync + 'static>; /// Error returned when a JavaS...
rust
Apache-2.0
22098e4d9f1c4b29447671298bc839476b6826dc
2026-01-04T15:47:42.000902Z
false
neon-bindings/neon
https://github.com/neon-bindings/neon/blob/22098e4d9f1c4b29447671298bc839476b6826dc/crates/neon/src/types_impl/extract/either.rs
crates/neon/src/types_impl/extract/either.rs
use std::{any, error, fmt}; use either::Either; use crate::{ context::Cx, handle::Handle, object::Object, result::{JsResult, NeonResult}, types::{ extract::{private, TryFromJs, TryIntoJs}, JsError, JsValue, }, }; impl<'cx, L, R> TryFromJs<'cx> for Either<L, R> where L: Try...
rust
Apache-2.0
22098e4d9f1c4b29447671298bc839476b6826dc
2026-01-04T15:47:42.000902Z
false
neon-bindings/neon
https://github.com/neon-bindings/neon/blob/22098e4d9f1c4b29447671298bc839476b6826dc/crates/neon/src/types_impl/extract/mod.rs
crates/neon/src/types_impl/extract/mod.rs
//! Traits and utilities for extract Rust data from JavaScript values. //! //! The full list of included extractors can be found on [`TryFromJs`]. //! //! ## Extracting Handles //! //! JavaScript arguments may be extracted into a Rust tuple. //! //! ``` //! # use neon::{prelude::*, types::extract::*}; //! fn greet(mut ...
rust
Apache-2.0
22098e4d9f1c4b29447671298bc839476b6826dc
2026-01-04T15:47:42.000902Z
false
neon-bindings/neon
https://github.com/neon-bindings/neon/blob/22098e4d9f1c4b29447671298bc839476b6826dc/crates/neon/src/types_impl/extract/try_into_js.rs
crates/neon/src/types_impl/extract/try_into_js.rs
use crate::{ context::{Context, Cx}, handle::{Handle, Root}, object::Object, result::{JsResult, Throw}, types::{extract::TryIntoJs, JsBoolean, JsNumber, JsString, JsUndefined, JsValue, Value}, }; #[cfg(feature = "napi-5")] use crate::{ result::ResultExt, types::{extract::Date, JsDate}, }; ...
rust
Apache-2.0
22098e4d9f1c4b29447671298bc839476b6826dc
2026-01-04T15:47:42.000902Z
false
neon-bindings/neon
https://github.com/neon-bindings/neon/blob/22098e4d9f1c4b29447671298bc839476b6826dc/crates/neon/src/types_impl/extract/boxed.rs
crates/neon/src/types_impl/extract/boxed.rs
use crate::{ context::{Context, Cx}, handle::Handle, result::{JsResult, NeonResult}, types::{ extract::{private, TryFromJs, TryIntoJs, TypeExpected}, Finalize, JsBox, JsValue, }, }; /// Wrapper to extract `T` from a [`JsBox<T>`](JsBox) or create a [`JsBox`] /// from a `T`. /// /// [...
rust
Apache-2.0
22098e4d9f1c4b29447671298bc839476b6826dc
2026-01-04T15:47:42.000902Z
false
neon-bindings/neon
https://github.com/neon-bindings/neon/blob/22098e4d9f1c4b29447671298bc839476b6826dc/crates/neon/src/types_impl/extract/buffer.rs
crates/neon/src/types_impl/extract/buffer.rs
use crate::{ context::Cx, handle::Handle, result::{JsResult, NeonResult}, types::{ buffer::{Binary, TypedArray}, extract::{private, TryFromJs, TryIntoJs, TypeExpected}, JsArrayBuffer, JsBigInt64Array, JsBigUint64Array, JsBuffer, JsFloat32Array, JsFloat64Array, JsInt16Arra...
rust
Apache-2.0
22098e4d9f1c4b29447671298bc839476b6826dc
2026-01-04T15:47:42.000902Z
false
neon-bindings/neon
https://github.com/neon-bindings/neon/blob/22098e4d9f1c4b29447671298bc839476b6826dc/crates/neon/src/types_impl/extract/private.rs
crates/neon/src/types_impl/extract/private.rs
use std::{ cell::{Ref, RefCell, RefMut}, rc::Rc, sync::Arc, }; use crate::{ context::FunctionContext, handle::{Handle, Root}, object::Object, result::{NeonResult, Throw}, types::{ extract::{Error, TryIntoJs}, Value, }, }; pub trait Sealed {} pub trait FromArgsInter...
rust
Apache-2.0
22098e4d9f1c4b29447671298bc839476b6826dc
2026-01-04T15:47:42.000902Z
false
neon-bindings/neon
https://github.com/neon-bindings/neon/blob/22098e4d9f1c4b29447671298bc839476b6826dc/crates/neon/src/types_impl/function/mod.rs
crates/neon/src/types_impl/function/mod.rs
//! Types and traits for working with JavaScript functions. use smallvec::smallvec; use crate::{ context::{Context, Cx}, handle::Handle, object::Object, result::{JsResult, NeonResult}, types::{ extract::{TryFromJs, TryIntoJs}, private::ValueInternal, JsFunction, JsObject, J...
rust
Apache-2.0
22098e4d9f1c4b29447671298bc839476b6826dc
2026-01-04T15:47:42.000902Z
false
neon-bindings/neon
https://github.com/neon-bindings/neon/blob/22098e4d9f1c4b29447671298bc839476b6826dc/crates/neon/src/types_impl/function/private.rs
crates/neon/src/types_impl/function/private.rs
use smallvec::SmallVec; use crate::{context::Cx, handle::Handle, result::NeonResult, types::JsValue}; pub type ArgsVec<'a> = SmallVec<[Handle<'a, JsValue>; 8]>; /// This type marks the `TryIntoArguments` trait as sealed. pub trait TryIntoArgumentsInternal<'cx> { fn try_into_args_vec(self, cx: &mut Cx<'cx>) -> Ne...
rust
Apache-2.0
22098e4d9f1c4b29447671298bc839476b6826dc
2026-01-04T15:47:42.000902Z
false
neon-bindings/neon
https://github.com/neon-bindings/neon/blob/22098e4d9f1c4b29447671298bc839476b6826dc/crates/neon/src/types_impl/buffer/lock.rs
crates/neon/src/types_impl/buffer/lock.rs
use std::{cell::RefCell, ops::Range}; use crate::{ context::Context, types::buffer::{BorrowError, Ref, RefMut}, }; #[derive(Debug)] /// A temporary lock of an execution context. /// /// While a lock is alive, no JavaScript code can be executed in the execution context. /// /// Values that support the `Borrow`...
rust
Apache-2.0
22098e4d9f1c4b29447671298bc839476b6826dc
2026-01-04T15:47:42.000902Z
false
neon-bindings/neon
https://github.com/neon-bindings/neon/blob/22098e4d9f1c4b29447671298bc839476b6826dc/crates/neon/src/types_impl/buffer/types.rs
crates/neon/src/types_impl/buffer/types.rs
use std::{marker::PhantomData, slice}; use crate::{ context::{ internal::{ContextInternal, Env}, Context, Cx, }, handle::{internal::TransparentNoCopyWrapper, Handle}, object::Object, result::{JsResult, Throw}, sys::{self, raw, typedarray::TypedArrayInfo, TypedArrayType}, typ...
rust
Apache-2.0
22098e4d9f1c4b29447671298bc839476b6826dc
2026-01-04T15:47:42.000902Z
false
neon-bindings/neon
https://github.com/neon-bindings/neon/blob/22098e4d9f1c4b29447671298bc839476b6826dc/crates/neon/src/types_impl/buffer/mod.rs
crates/neon/src/types_impl/buffer/mod.rs
//! Types and traits for working with binary buffers. use std::{ cell::RefCell, error::Error, fmt::{self, Debug, Display}, marker::PhantomData, ops::{Deref, DerefMut}, }; use crate::{ context::Context, handle::Handle, result::{JsResult, NeonResult, ResultExt}, types::{ buff...
rust
Apache-2.0
22098e4d9f1c4b29447671298bc839476b6826dc
2026-01-04T15:47:42.000902Z
false
vi/websocat
https://github.com/vi/websocat/blob/29c8c54d6f275519abc28f4cb90e1fa69e2fbcae/src/process_peer.rs
src/process_peer.rs
extern crate tokio_process; use futures; use std::io::Result as IoResult; use std::io::{Read, Write}; use std::{self, process::ExitStatus}; use tokio_io::{AsyncRead, AsyncWrite}; use super::{L2rUser, LeftSpecToRightSpec}; use std::cell::RefCell; use std::rc::Rc; use std::process::Command; use self::tokio_process::...
rust
MIT
29c8c54d6f275519abc28f4cb90e1fa69e2fbcae
2026-01-04T15:48:03.314466Z
false
vi/websocat
https://github.com/vi/websocat/blob/29c8c54d6f275519abc28f4cb90e1fa69e2fbcae/src/net_peer.rs
src/net_peer.rs
extern crate net2; use futures; use futures::future::Future; use futures::stream::Stream; use futures::unsync::oneshot::{channel, Receiver, Sender}; use std; use std::io::Result as IoResult; use std::io::{Read, Write}; use std::net::SocketAddr; use tokio_io::{AsyncRead, AsyncWrite}; use std::cell::RefCell; use std::r...
rust
MIT
29c8c54d6f275519abc28f4cb90e1fa69e2fbcae
2026-01-04T15:48:03.314466Z
false
vi/websocat
https://github.com/vi/websocat/blob/29c8c54d6f275519abc28f4cb90e1fa69e2fbcae/src/socks5_peer.rs
src/socks5_peer.rs
#![allow(clippy::needless_pass_by_value,clippy::cast_lossless,clippy::identity_op)] use futures::future::{err, ok, Future}; use std::rc::Rc; use super::{box_up_err, peer_strerr, BoxedNewPeerFuture, Peer}; use super::{ConstructParams, L2rUser, PeerConstructor, Specifier}; use tokio_io::io::{read_exact, write_all}; use...
rust
MIT
29c8c54d6f275519abc28f4cb90e1fa69e2fbcae
2026-01-04T15:48:03.314466Z
false
vi/websocat
https://github.com/vi/websocat/blob/29c8c54d6f275519abc28f4cb90e1fa69e2fbcae/src/specparse.rs
src/specparse.rs
use super::{Result}; use super::specifier::{Specifier, SpecifierClass, SpecifierStack, SpecifierNode}; use std::rc::Rc; use std::str::FromStr; pub fn spec(s: &str) -> Result<Rc<dyn Specifier>> { <dyn Specifier>::from_stack(&SpecifierStack::from_str(s)?) } fn some_checks(s: &str) -> Result<()> { #[cfg(not(feat...
rust
MIT
29c8c54d6f275519abc28f4cb90e1fa69e2fbcae
2026-01-04T15:48:03.314466Z
false
vi/websocat
https://github.com/vi/websocat/blob/29c8c54d6f275519abc28f4cb90e1fa69e2fbcae/src/timestamp_peer.rs
src/timestamp_peer.rs
use futures::future::ok; use std::rc::Rc; use super::{BoxedNewPeerFuture, Peer}; use super::{ConstructParams, PeerConstructor, Specifier}; use std::time::{SystemTime, UNIX_EPOCH, Instant}; use std::io::Read; use tokio_io::AsyncRead; use std::io::Error as IoError; #[derive(Debug)] pub struct TimestampPeer<T: Specif...
rust
MIT
29c8c54d6f275519abc28f4cb90e1fa69e2fbcae
2026-01-04T15:48:03.314466Z
false
vi/websocat
https://github.com/vi/websocat/blob/29c8c54d6f275519abc28f4cb90e1fa69e2fbcae/src/lib.rs
src/lib.rs
//! Note: library usage is not semver/API-stable //! //! Type evolution of a websocat run: //! //! 1. `&str` - string as passed to command line. When it meets the list of `SpecifierClass`es, there appears: //! 2. `SpecifierStack` - specifier class, final string argument and vector of overlays. //! 3. `Specifier` - more...
rust
MIT
29c8c54d6f275519abc28f4cb90e1fa69e2fbcae
2026-01-04T15:48:03.314466Z
false
vi/websocat
https://github.com/vi/websocat/blob/29c8c54d6f275519abc28f4cb90e1fa69e2fbcae/src/ws_peer.rs
src/ws_peer.rs
extern crate tokio_codec; extern crate websocket; extern crate base64; use self::websocket::stream::r#async::Stream as WsStream; use self::websocket::OwnedMessage; use futures; use futures::sink::Sink; use futures::stream::Stream; use std; use std::io::Result as IoResult; use std::io::{Read, Write}; use tokio_io::{Asy...
rust
MIT
29c8c54d6f275519abc28f4cb90e1fa69e2fbcae
2026-01-04T15:48:03.314466Z
false
vi/websocat
https://github.com/vi/websocat/blob/29c8c54d6f275519abc28f4cb90e1fa69e2fbcae/src/foreachmsg_peer.rs
src/foreachmsg_peer.rs
use futures::future::ok; use std::rc::Rc; use super::{BoxedNewPeerFuture, Peer}; use super::{ConstructParams, PeerConstructor, Specifier}; use std::cell::RefCell; use std::io::{Error as IoError, Read, Write}; use tokio_io::{AsyncRead, AsyncWrite}; use super::{once, simple_err, wouldblock}; use futures::{Async, Fut...
rust
MIT
29c8c54d6f275519abc28f4cb90e1fa69e2fbcae
2026-01-04T15:48:03.314466Z
false
vi/websocat
https://github.com/vi/websocat/blob/29c8c54d6f275519abc28f4cb90e1fa69e2fbcae/src/stdio_threaded_peer.rs
src/stdio_threaded_peer.rs
extern crate tokio_stdin_stdout; use super::{BoxedNewPeerFuture, Peer}; use super::{once, ConstructParams, PeerConstructor, Specifier}; use std::rc::Rc; #[derive(Debug, Clone)] pub struct ThreadedStdio; impl Specifier for ThreadedStdio { fn construct(&self, _: ConstructParams) -> PeerConstructor { once(...
rust
MIT
29c8c54d6f275519abc28f4cb90e1fa69e2fbcae
2026-01-04T15:48:03.314466Z
false
vi/websocat
https://github.com/vi/websocat/blob/29c8c54d6f275519abc28f4cb90e1fa69e2fbcae/src/sessionserve.rs
src/sessionserve.rs
use super::futures::{Future, Stream}; use super::{ futures, my_copy, ConstructParams, L2rUser, L2rWriter, Options, Peer, PeerConstructor, ProgramState, Session, Specifier, Transfer, }; use crate::spawn_hack; use std; use std::cell::RefCell; use std::rc::Rc; use tokio_io; impl Session { pub fn run(self) -> ...
rust
MIT
29c8c54d6f275519abc28f4cb90e1fa69e2fbcae
2026-01-04T15:48:03.314466Z
false
vi/websocat
https://github.com/vi/websocat/blob/29c8c54d6f275519abc28f4cb90e1fa69e2fbcae/src/broadcast_reuse_peer.rs
src/broadcast_reuse_peer.rs
extern crate futures; extern crate tokio_io; use futures::future::ok; use std::cell::RefCell; use std::rc::Rc; use super::{brokenpipe, simple_err, wouldblock, BoxedNewPeerFuture, Peer}; use std::io::{Error as IoError, Read, Write}; use tokio_io::{AsyncRead, AsyncWrite}; use super::{once, ConstructParams, PeerConstr...
rust
MIT
29c8c54d6f275519abc28f4cb90e1fa69e2fbcae
2026-01-04T15:48:03.314466Z
false
vi/websocat
https://github.com/vi/websocat/blob/29c8c54d6f275519abc28f4cb90e1fa69e2fbcae/src/windows_np_peer.rs
src/windows_np_peer.rs
extern crate tokio_named_pipes; use futures; use std; use std::io::Result as IoResult; use std::io::{Read, Write}; use tokio_io::{AsyncRead, AsyncWrite}; use std::path::{Path, PathBuf}; //use super::{L2rUser, LeftSpecToRightSpec}; use std::cell::RefCell; use std::rc::Rc; use tokio_named_pipes::NamedPipe; use supe...
rust
MIT
29c8c54d6f275519abc28f4cb90e1fa69e2fbcae
2026-01-04T15:48:03.314466Z
false
vi/websocat
https://github.com/vi/websocat/blob/29c8c54d6f275519abc28f4cb90e1fa69e2fbcae/src/ssl_peer.rs
src/ssl_peer.rs
use futures::future::{ok, Future}; use std::rc::Rc; use super::{box_up_err, peer_err, BoxedNewPeerFuture, Peer}; use super::{ConstructParams, L2rUser, Options, PeerConstructor, Specifier}; pub extern crate native_tls; extern crate readwrite; extern crate tokio_tls; use self::native_tls::{Identity as Pkcs12, TlsAcce...
rust
MIT
29c8c54d6f275519abc28f4cb90e1fa69e2fbcae
2026-01-04T15:48:03.314466Z
false
vi/websocat
https://github.com/vi/websocat/blob/29c8c54d6f275519abc28f4cb90e1fa69e2fbcae/src/line_peer.rs
src/line_peer.rs
use futures::future::ok; use std::rc::Rc; use super::{BoxedNewPeerFuture, Peer}; use super::{ConstructParams, PeerConstructor, Specifier}; use std::io::Read; use tokio_io::AsyncRead; use std::io::Error as IoError; #[derive(Debug)] pub struct Message2Line<T: Specifier>(pub T); impl<T: Specifier> Specifier for Messa...
rust
MIT
29c8c54d6f275519abc28f4cb90e1fa69e2fbcae
2026-01-04T15:48:03.314466Z
false
vi/websocat
https://github.com/vi/websocat/blob/29c8c54d6f275519abc28f4cb90e1fa69e2fbcae/src/my_copy.rs
src/my_copy.rs
use std::io; use futures::{Future, Poll}; use crate::{AsyncRead, AsyncWrite}; #[derive(Debug, Copy, Clone)] pub struct CopyOptions { pub stop_on_reader_zero_read: bool, pub once: bool, pub buffer_size: usize, /// Because of -u or -U pub skip: bool, pub max_ops: Option<usize>, } /// A future ...
rust
MIT
29c8c54d6f275519abc28f4cb90e1fa69e2fbcae
2026-01-04T15:48:03.314466Z
false
vi/websocat
https://github.com/vi/websocat/blob/29c8c54d6f275519abc28f4cb90e1fa69e2fbcae/src/help.rs
src/help.rs
use super::{Opt, SpecifierClass, StructOpt}; fn spechelp(sc: &dyn SpecifierClass, overlays: bool, advanced: bool) { if !advanced && sc.help().contains("[A]") { return; } if overlays ^ sc.is_overlay() { return; } let first_prefix = sc.get_prefixes()[0]; let mut first_help_line ...
rust
MIT
29c8c54d6f275519abc28f4cb90e1fa69e2fbcae
2026-01-04T15:48:03.314466Z
false
vi/websocat
https://github.com/vi/websocat/blob/29c8c54d6f275519abc28f4cb90e1fa69e2fbcae/src/readdebt.rs
src/readdebt.rs
use std; #[derive(Debug, Clone, Copy)] pub enum DebtHandling { Silent, Warn, DropMessage, } pub enum ZeroMessagesHandling { Drop, Deliver, } pub enum ProcessMessageResult { Return(std::result::Result<usize, std::io::Error>), Recurse, } /// A `Read` utility to deal with partial reads pub ...
rust
MIT
29c8c54d6f275519abc28f4cb90e1fa69e2fbcae
2026-01-04T15:48:03.314466Z
false
vi/websocat
https://github.com/vi/websocat/blob/29c8c54d6f275519abc28f4cb90e1fa69e2fbcae/src/prometheus_peer.rs
src/prometheus_peer.rs
use futures::future::ok; use futures::{Async}; use prometheus::core::{AtomicU64, Atomic}; use std::cell::RefCell; use std::net::{SocketAddr, TcpListener}; use std::rc::Rc; use std::time::Duration; use crate::ws_server_peer::http_serve::get_static_file_reply; use super::{BoxedNewPeerFuture, Peer}; use super::{Constru...
rust
MIT
29c8c54d6f275519abc28f4cb90e1fa69e2fbcae
2026-01-04T15:48:03.314466Z
false
vi/websocat
https://github.com/vi/websocat/blob/29c8c54d6f275519abc28f4cb90e1fa69e2fbcae/src/crypto_peer.rs
src/crypto_peer.rs
use argon2::Argon2; use futures::Async; use futures::future::ok; use std::rc::Rc; use super::{BoxedNewPeerFuture, Peer}; use super::{ConstructParams, PeerConstructor, Specifier}; use std::io::{Read, Write}; use tokio_io::{AsyncRead, AsyncWrite}; use std::io::Error as IoError; use chacha20poly1305::ChaCha20Poly1305...
rust
MIT
29c8c54d6f275519abc28f4cb90e1fa69e2fbcae
2026-01-04T15:48:03.314466Z
false
vi/websocat
https://github.com/vi/websocat/blob/29c8c54d6f275519abc28f4cb90e1fa69e2fbcae/src/util.rs
src/util.rs
use super::{ futures, AsyncRead, AsyncWrite, BoxedNewPeerFuture, BoxedNewPeerStream, L2rUser, Peer, PeerConstructor, Rc, HupToken, }; use super::{Future, Stream}; pub fn wouldblock<T>() -> std::io::Result<T> { Err(std::io::Error::new(std::io::ErrorKind::WouldBlock, "")) } pub fn brokenpipe<T>() -> std::io:...
rust
MIT
29c8c54d6f275519abc28f4cb90e1fa69e2fbcae
2026-01-04T15:48:03.314466Z
false
vi/websocat
https://github.com/vi/websocat/blob/29c8c54d6f275519abc28f4cb90e1fa69e2fbcae/src/lengthprefixed_peer.rs
src/lengthprefixed_peer.rs
use futures::future::ok; use std::rc::Rc; use crate::{io_other_error, simple_err, peer_strerr}; use super::{BoxedNewPeerFuture, Peer}; use super::{ConstructParams, PeerConstructor, Specifier}; use std::io::{Read, Write}; use tokio_io::{AsyncRead, AsyncWrite}; use std::io::Error as IoError; #[derive(Debug)] pub st...
rust
MIT
29c8c54d6f275519abc28f4cb90e1fa69e2fbcae
2026-01-04T15:48:03.314466Z
false
vi/websocat
https://github.com/vi/websocat/blob/29c8c54d6f275519abc28f4cb90e1fa69e2fbcae/src/reconnect_peer.rs
src/reconnect_peer.rs
extern crate futures; extern crate tokio_io; use futures::future::ok; use std::cell::RefCell; use std::rc::Rc; use super::{BoxedNewPeerFuture, Peer}; use std::io::{Error as IoError, Read, Write}; use tokio_io::{AsyncRead, AsyncWrite}; use super::{once, simple_err, wouldblock, ConstructParams, PeerConstructor, Speci...
rust
MIT
29c8c54d6f275519abc28f4cb90e1fa69e2fbcae
2026-01-04T15:48:03.314466Z
false
vi/websocat
https://github.com/vi/websocat/blob/29c8c54d6f275519abc28f4cb90e1fa69e2fbcae/src/mirror_peer.rs
src/mirror_peer.rs
use super::{BoxedNewPeerFuture, Peer}; use super::{brokenpipe, io_other_error, wouldblock}; use futures; use futures::sink::Sink; use futures::stream::Stream; use std; use std::io::Result as IoResult; use std::io::{Read, Write}; use futures::Async::{NotReady, Ready}; use std::rc::Rc; use futures::sync::mpsc; use to...
rust
MIT
29c8c54d6f275519abc28f4cb90e1fa69e2fbcae
2026-01-04T15:48:03.314466Z
false
vi/websocat
https://github.com/vi/websocat/blob/29c8c54d6f275519abc28f4cb90e1fa69e2fbcae/src/specifier.rs
src/specifier.rs
use super::{L2rUser, Options, Result}; use super::{PeerConstructor, ProgramState}; use std; use std::cell::RefCell; use std::rc::Rc; pub enum ClassMessageBoundaryStatus { StreamOriented, MessageOriented, MessageBoundaryStatusDependsOnInnerType, } pub enum ClassMulticonnectStatus { MultiConnect, Si...
rust
MIT
29c8c54d6f275519abc28f4cb90e1fa69e2fbcae
2026-01-04T15:48:03.314466Z
false
vi/websocat
https://github.com/vi/websocat/blob/29c8c54d6f275519abc28f4cb90e1fa69e2fbcae/src/options.rs
src/options.rs
pub use super::socks5_peer::SocksSocketAddr; use super::readdebt::DebtHandling; use std::ffi::OsString; use std::net::SocketAddr; #[derive(Debug, Clone)] pub struct StaticFile { pub uri: String, pub file: ::std::path::PathBuf, pub content_type: String, } extern crate http_bytes; use http_bytes::http; #...
rust
MIT
29c8c54d6f275519abc28f4cb90e1fa69e2fbcae
2026-01-04T15:48:03.314466Z
false
vi/websocat
https://github.com/vi/websocat/blob/29c8c54d6f275519abc28f4cb90e1fa69e2fbcae/src/jsonrpc_peer.rs
src/jsonrpc_peer.rs
use futures::future::ok; use std::rc::Rc; use super::{BoxedNewPeerFuture, Peer}; use super::{ConstructParams, PeerConstructor, Specifier}; use std::io::Read; use tokio_io::AsyncRead; use std::io::Error as IoError; #[derive(Debug)] pub struct JsonRpc<T: Specifier>(pub T); impl<T: Specifier> Specifier for JsonRpc<T>...
rust
MIT
29c8c54d6f275519abc28f4cb90e1fa69e2fbcae
2026-01-04T15:48:03.314466Z
false
vi/websocat
https://github.com/vi/websocat/blob/29c8c54d6f275519abc28f4cb90e1fa69e2fbcae/src/http_peer.rs
src/http_peer.rs
#![allow(unused)] #![allow(clippy::needless_pass_by_value,clippy::cast_lossless,clippy::identity_op)] use futures::future::{err, ok, Future}; use std::rc::Rc; use super::{box_up_err, peer_strerr, BoxedNewPeerFuture, Peer}; use super::{ConstructParams, L2rUser, PeerConstructor, Specifier}; use tokio_io::io::{read_exa...
rust
MIT
29c8c54d6f275519abc28f4cb90e1fa69e2fbcae
2026-01-04T15:48:03.314466Z
false
vi/websocat
https://github.com/vi/websocat/blob/29c8c54d6f275519abc28f4cb90e1fa69e2fbcae/src/all_peers.rs
src/all_peers.rs
// This is an X-Macro. #[macro_export] macro_rules! list_of_all_specifier_classes { ($your_macro:ident) => { $your_macro!($crate::ws_client_peer::WsClientClass); #[cfg(feature = "ssl")] $your_macro!($crate::ws_client_peer::WsClientSecureClass); $your_macro!($crate::ws_server_peer::Ws...
rust
MIT
29c8c54d6f275519abc28f4cb90e1fa69e2fbcae
2026-01-04T15:48:03.314466Z
false
vi/websocat
https://github.com/vi/websocat/blob/29c8c54d6f275519abc28f4cb90e1fa69e2fbcae/src/stdio_peer.rs
src/stdio_peer.rs
#[cfg(unix)] extern crate tokio_file_unix; extern crate tokio_reactor; #[cfg(all(unix, feature = "signal_handler"))] extern crate tokio_signal; extern crate tokio_stdin_stdout; use futures; use futures::future::Future; use std; use std::cell::RefCell; use std::io::Result as IoResult; use std::io::{Read, Write}; use st...
rust
MIT
29c8c54d6f275519abc28f4cb90e1fa69e2fbcae
2026-01-04T15:48:03.314466Z
false
vi/websocat
https://github.com/vi/websocat/blob/29c8c54d6f275519abc28f4cb90e1fa69e2fbcae/src/unix_seqpacket_peer.rs
src/unix_seqpacket_peer.rs
extern crate tokio_reactor; use super::{ futures, libc, multi, once, peer_err_s, simple_err, BoxedNewPeerFuture, BoxedNewPeerStream, ConstructParams, MyUnixStream, Options, Peer, PeerConstructor, Specifier, UnixListener, UnixStream, }; use futures::Stream; use std::path::{Path, PathBuf}; use std::rc::Rc; ...
rust
MIT
29c8c54d6f275519abc28f4cb90e1fa69e2fbcae
2026-01-04T15:48:03.314466Z
false
vi/websocat
https://github.com/vi/websocat/blob/29c8c54d6f275519abc28f4cb90e1fa69e2fbcae/src/main.rs
src/main.rs
#![allow(renamed_and_removed_lints)] #![allow(unknown_lints)] #![allow(clippy::deprecated_cfg_attr)] #[macro_use] extern crate websocat; extern crate futures; extern crate tokio; extern crate tokio_stdin_stdout; extern crate websocket_base; extern crate env_logger; #[macro_use] extern crate log; #[cfg(feature = "o...
rust
MIT
29c8c54d6f275519abc28f4cb90e1fa69e2fbcae
2026-01-04T15:48:03.314466Z
true
vi/websocat
https://github.com/vi/websocat/blob/29c8c54d6f275519abc28f4cb90e1fa69e2fbcae/src/ws_lowlevel_peer.rs
src/ws_lowlevel_peer.rs
#![allow(unused)] extern crate websocket_base; use futures::future::Future; use futures::stream::Stream; use std::cell::RefCell; use std::rc::Rc; use super::{box_up_err, peer_err, peer_strerr, BoxedNewPeerFuture, Peer, Result}; use super::ws_peer::{Mode1, PeerForWs, WsReadWrapper, WsWriteWrapper}; use super::{once...
rust
MIT
29c8c54d6f275519abc28f4cb90e1fa69e2fbcae
2026-01-04T15:48:03.314466Z
false
vi/websocat
https://github.com/vi/websocat/blob/29c8c54d6f275519abc28f4cb90e1fa69e2fbcae/src/file_peer.rs
src/file_peer.rs
use futures; use futures::Async; use std; use std::io::Result as IoResult; use std::io::{Read, Write}; use std::path::{Path, PathBuf}; use tokio_io::{AsyncRead, AsyncWrite}; use std::fs::{File, OpenOptions}; use std::rc::Rc; use super::{BoxedNewPeerFuture, Peer, Result}; use super::{once, ConstructParams, PeerConstr...
rust
MIT
29c8c54d6f275519abc28f4cb90e1fa69e2fbcae
2026-01-04T15:48:03.314466Z
false
vi/websocat
https://github.com/vi/websocat/blob/29c8c54d6f275519abc28f4cb90e1fa69e2fbcae/src/trivial_peer.rs
src/trivial_peer.rs
use super::{BoxedNewPeerFuture, Peer}; use futures; use rand::RngCore; use std; use std::io::Result as IoResult; use std::io::{Read, Write}; use futures::Async::Ready; use std::rc::Rc; use tokio_io::{AsyncRead, AsyncWrite}; use super::readdebt::{DebtHandling, ReadDebt, ZeroMessagesHandling}; use super::wouldblock; ...
rust
MIT
29c8c54d6f275519abc28f4cb90e1fa69e2fbcae
2026-01-04T15:48:03.314466Z
false
vi/websocat
https://github.com/vi/websocat/blob/29c8c54d6f275519abc28f4cb90e1fa69e2fbcae/src/primitive_reuse_peer.rs
src/primitive_reuse_peer.rs
extern crate futures; extern crate tokio_io; use futures::future::ok; use std::cell::RefCell; use std::rc::Rc; use super::{BoxedNewPeerFuture, Peer}; use std::io::{Error as IoError, Read, Write}; use tokio_io::{AsyncRead, AsyncWrite}; use super::{once, ConstructParams, PeerConstructor, Specifier}; use futures::Futu...
rust
MIT
29c8c54d6f275519abc28f4cb90e1fa69e2fbcae
2026-01-04T15:48:03.314466Z
false
vi/websocat
https://github.com/vi/websocat/blob/29c8c54d6f275519abc28f4cb90e1fa69e2fbcae/src/http_serve.rs
src/http_serve.rs
use self::hyper::http::h1::Incoming; use self::hyper::method::Method; use self::hyper::uri::RequestUri; use self::hyper::uri::RequestUri::AbsolutePath; use super::hyper; use futures::future::Future; use std::fs::File; use std::rc::Rc; use crate::options::StaticFile; use crate::trivial_peer::get_literal_peer_now; use ...
rust
MIT
29c8c54d6f275519abc28f4cb90e1fa69e2fbcae
2026-01-04T15:48:03.314466Z
false
vi/websocat
https://github.com/vi/websocat/blob/29c8c54d6f275519abc28f4cb90e1fa69e2fbcae/src/ws_server_peer.rs
src/ws_server_peer.rs
extern crate hyper; extern crate websocket; use self::hyper::uri::RequestUri::AbsolutePath; use self::websocket::WebSocketError; use futures::future::{err, Future}; use std::rc::Rc; use crate::options::StaticFile; use self::websocket::server::upgrade::r#async::IntoWs; use super::ws_peer::{PeerForWs}; use super::{...
rust
MIT
29c8c54d6f275519abc28f4cb90e1fa69e2fbcae
2026-01-04T15:48:03.314466Z
false
vi/websocat
https://github.com/vi/websocat/blob/29c8c54d6f275519abc28f4cb90e1fa69e2fbcae/src/unix_peer.rs
src/unix_peer.rs
extern crate tokio_reactor; extern crate tokio_uds; extern crate libc; use futures; use futures::stream::Stream; use std; use std::io::Result as IoResult; use std::io::{Read, Write}; use tokio_io::{AsyncRead, AsyncWrite}; use std::cell::RefCell; use std::rc::Rc; use std::path::{Path, PathBuf}; use self::tokio_uds:...
rust
MIT
29c8c54d6f275519abc28f4cb90e1fa69e2fbcae
2026-01-04T15:48:03.314466Z
false
vi/websocat
https://github.com/vi/websocat/blob/29c8c54d6f275519abc28f4cb90e1fa69e2fbcae/src/ws_client_peer.rs
src/ws_client_peer.rs
extern crate hyper; extern crate websocket; use self::websocket::client::r#async::ClientNew; use self::websocket::stream::r#async::Stream as WsStream; use self::websocket::ClientBuilder; use futures::future::Future; use std::net::SocketAddr; use std::rc::Rc; use self::websocket::client::Url; use super::{box_up_err,...
rust
MIT
29c8c54d6f275519abc28f4cb90e1fa69e2fbcae
2026-01-04T15:48:03.314466Z
false
vi/websocat
https://github.com/vi/websocat/blob/29c8c54d6f275519abc28f4cb90e1fa69e2fbcae/src/lints.rs
src/lints.rs
#![allow(clippy::collapsible_if,clippy::needless_pass_by_value)] use super::{Options, Result, SpecifierClass, SpecifierStack, WebsocatConfiguration2}; use super::specifier::SpecifierNode; use std::rc::Rc; use std::str::FromStr; use std::ops::Not; extern crate hyper; extern crate url; use std::net::{IpAddr, SocketAdd...
rust
MIT
29c8c54d6f275519abc28f4cb90e1fa69e2fbcae
2026-01-04T15:48:03.314466Z
false
vi/websocat
https://github.com/vi/websocat/blob/29c8c54d6f275519abc28f4cb90e1fa69e2fbcae/tests/test.rs
tests/test.rs
extern crate websocat; extern crate env_logger; extern crate futures; extern crate tokio; extern crate tokio_timer; use futures::future::Future; use websocat::{spec, Options, WebsocatConfiguration3}; fn dflt() -> Options { Default::default() } macro_rules! wt { ($core:ident, $s1:expr, $s2:expr,delay = $ms:...
rust
MIT
29c8c54d6f275519abc28f4cb90e1fa69e2fbcae
2026-01-04T15:48:03.314466Z
false
crossbeam-rs/crossbeam
https://github.com/crossbeam-rs/crossbeam/blob/983d56b6007ca4c22b56a665a7785f40f55c2a53/build-common.rs
build-common.rs
// The target triplets have the form of 'arch-vendor-system'. // // When building for Linux (e.g. the 'system' part is // 'linux-something'), replace the vendor with 'unknown' // so that mapping to rust standard targets happens correctly. fn convert_custom_linux_target(target: String) -> String { let mut parts: Vec...
rust
Apache-2.0
983d56b6007ca4c22b56a665a7785f40f55c2a53
2026-01-04T15:48:03.794677Z
false
crossbeam-rs/crossbeam
https://github.com/crossbeam-rs/crossbeam/blob/983d56b6007ca4c22b56a665a7785f40f55c2a53/no_atomic.rs
no_atomic.rs
// This file is @generated by no_atomic.sh. // It is not intended for manual editing. const NO_ATOMIC: &[&str] = &[ "bpfeb-unknown-none", "bpfel-unknown-none", "mipsel-sony-psx", "msp430-none-elf", ];
rust
Apache-2.0
983d56b6007ca4c22b56a665a7785f40f55c2a53
2026-01-04T15:48:03.794677Z
false
crossbeam-rs/crossbeam
https://github.com/crossbeam-rs/crossbeam/blob/983d56b6007ca4c22b56a665a7785f40f55c2a53/crossbeam-epoch/src/guard.rs
crossbeam-epoch/src/guard.rs
use core::fmt; use core::mem; use crate::atomic::Shared; use crate::collector::Collector; use crate::deferred::Deferred; use crate::internal::Local; /// A guard that keeps the current thread pinned. /// /// # Pinning /// /// The current thread is pinned by calling [`pin`], which returns a new guard: /// /// ``` /// u...
rust
Apache-2.0
983d56b6007ca4c22b56a665a7785f40f55c2a53
2026-01-04T15:48:03.794677Z
false
crossbeam-rs/crossbeam
https://github.com/crossbeam-rs/crossbeam/blob/983d56b6007ca4c22b56a665a7785f40f55c2a53/crossbeam-epoch/src/lib.rs
crossbeam-epoch/src/lib.rs
//! Epoch-based memory reclamation. //! //! An interesting problem concurrent collections deal with comes from the remove operation. //! Suppose that a thread removes an element from a lock-free map, while another thread is reading //! that same element at the same time. The first thread must wait until the second thre...
rust
Apache-2.0
983d56b6007ca4c22b56a665a7785f40f55c2a53
2026-01-04T15:48:03.794677Z
false
crossbeam-rs/crossbeam
https://github.com/crossbeam-rs/crossbeam/blob/983d56b6007ca4c22b56a665a7785f40f55c2a53/crossbeam-epoch/src/internal.rs
crossbeam-epoch/src/internal.rs
//! The global data and participant for garbage collection. //! //! # Registration //! //! In order to track all participants in one place, we need some form of participant //! registration. When a participant is created, it is registered to a global lock-free //! singly-linked list of registries; and when a participan...
rust
Apache-2.0
983d56b6007ca4c22b56a665a7785f40f55c2a53
2026-01-04T15:48:03.794677Z
false
crossbeam-rs/crossbeam
https://github.com/crossbeam-rs/crossbeam/blob/983d56b6007ca4c22b56a665a7785f40f55c2a53/crossbeam-epoch/src/default.rs
crossbeam-epoch/src/default.rs
//! The default garbage collector. //! //! For each thread, a participant is lazily initialized on its first use, when the current thread //! is registered in the default collector. If initialized, the thread's participant will get //! destructed on thread exit, which in turn unregisters the thread. use crate::collec...
rust
Apache-2.0
983d56b6007ca4c22b56a665a7785f40f55c2a53
2026-01-04T15:48:03.794677Z
false
crossbeam-rs/crossbeam
https://github.com/crossbeam-rs/crossbeam/blob/983d56b6007ca4c22b56a665a7785f40f55c2a53/crossbeam-epoch/src/epoch.rs
crossbeam-epoch/src/epoch.rs
//! The global epoch //! //! The last bit in this number is unused and is always zero. Every so often the global epoch is //! incremented, i.e. we say it "advances". A pinned participant may advance the global epoch only //! if all currently pinned participants have been pinned in the current epoch. //! //! If an objec...
rust
Apache-2.0
983d56b6007ca4c22b56a665a7785f40f55c2a53
2026-01-04T15:48:03.794677Z
false
crossbeam-rs/crossbeam
https://github.com/crossbeam-rs/crossbeam/blob/983d56b6007ca4c22b56a665a7785f40f55c2a53/crossbeam-epoch/src/collector.rs
crossbeam-epoch/src/collector.rs
/// Epoch-based garbage collector. /// /// # Examples /// /// ``` /// use crossbeam_epoch::Collector; /// /// let collector = Collector::new(); /// /// let handle = collector.register(); /// drop(collector); // `handle` still works after dropping `collector` /// /// handle.pin().flush(); /// ``` use core::fmt; use cra...
rust
Apache-2.0
983d56b6007ca4c22b56a665a7785f40f55c2a53
2026-01-04T15:48:03.794677Z
false
crossbeam-rs/crossbeam
https://github.com/crossbeam-rs/crossbeam/blob/983d56b6007ca4c22b56a665a7785f40f55c2a53/crossbeam-epoch/src/atomic.rs
crossbeam-epoch/src/atomic.rs
use alloc::boxed::Box; use core::alloc::Layout; use core::borrow::{Borrow, BorrowMut}; use core::cmp; use core::fmt; use core::marker::PhantomData; use core::mem::{self, MaybeUninit}; use core::ops::{Deref, DerefMut}; use core::ptr; use core::slice; use crate::guard::Guard; #[cfg(not(miri))] use crate::primitive::sync...
rust
Apache-2.0
983d56b6007ca4c22b56a665a7785f40f55c2a53
2026-01-04T15:48:03.794677Z
true
crossbeam-rs/crossbeam
https://github.com/crossbeam-rs/crossbeam/blob/983d56b6007ca4c22b56a665a7785f40f55c2a53/crossbeam-epoch/src/deferred.rs
crossbeam-epoch/src/deferred.rs
use alloc::boxed::Box; use core::fmt; use core::marker::PhantomData; use core::mem::{self, MaybeUninit}; use core::ptr; /// Number of words a piece of `Data` can hold. /// /// Three words should be enough for the majority of cases. For example, you can fit inside it the /// function pointer together with a fat pointer...
rust
Apache-2.0
983d56b6007ca4c22b56a665a7785f40f55c2a53
2026-01-04T15:48:03.794677Z
false
crossbeam-rs/crossbeam
https://github.com/crossbeam-rs/crossbeam/blob/983d56b6007ca4c22b56a665a7785f40f55c2a53/crossbeam-epoch/src/sync/list.rs
crossbeam-epoch/src/sync/list.rs
//! Lock-free intrusive linked list. //! //! Ideas from Michael. High Performance Dynamic Lock-Free Hash Tables and List-Based Sets. SPAA //! 2002. <http://dl.acm.org/citation.cfm?id=564870.564881> use core::marker::PhantomData; use core::sync::atomic::Ordering::{Acquire, Relaxed, Release}; use crate::{unprotected...
rust
Apache-2.0
983d56b6007ca4c22b56a665a7785f40f55c2a53
2026-01-04T15:48:03.794677Z
false
crossbeam-rs/crossbeam
https://github.com/crossbeam-rs/crossbeam/blob/983d56b6007ca4c22b56a665a7785f40f55c2a53/crossbeam-epoch/src/sync/once_lock.rs
crossbeam-epoch/src/sync/once_lock.rs
// Based on unstable std::sync::OnceLock. // // Source: https://github.com/rust-lang/rust/blob/8e9c93df464b7ada3fc7a1c8ccddd9dcb24ee0a0/library/std/src/sync/once_lock.rs use core::cell::UnsafeCell; use core::mem::MaybeUninit; use std::sync::Once; pub(crate) struct OnceLock<T> { once: Once, value: UnsafeCell<M...
rust
Apache-2.0
983d56b6007ca4c22b56a665a7785f40f55c2a53
2026-01-04T15:48:03.794677Z
false
crossbeam-rs/crossbeam
https://github.com/crossbeam-rs/crossbeam/blob/983d56b6007ca4c22b56a665a7785f40f55c2a53/crossbeam-epoch/src/sync/mod.rs
crossbeam-epoch/src/sync/mod.rs
//! Synchronization primitives. pub(crate) mod list; #[cfg(feature = "std")] #[cfg(not(crossbeam_loom))] pub(crate) mod once_lock; pub(crate) mod queue;
rust
Apache-2.0
983d56b6007ca4c22b56a665a7785f40f55c2a53
2026-01-04T15:48:03.794677Z
false
crossbeam-rs/crossbeam
https://github.com/crossbeam-rs/crossbeam/blob/983d56b6007ca4c22b56a665a7785f40f55c2a53/crossbeam-epoch/src/sync/queue.rs
crossbeam-epoch/src/sync/queue.rs
//! Michael-Scott lock-free queue. //! //! Usable with any number of producers and consumers. //! //! Michael and Scott. Simple, Fast, and Practical Non-Blocking and Blocking Concurrent Queue //! Algorithms. PODC 1996. <http://dl.acm.org/citation.cfm?id=248106> //! //! Simon Doherty, Lindsay Groves, Victor Luchangco...
rust
Apache-2.0
983d56b6007ca4c22b56a665a7785f40f55c2a53
2026-01-04T15:48:03.794677Z
false
crossbeam-rs/crossbeam
https://github.com/crossbeam-rs/crossbeam/blob/983d56b6007ca4c22b56a665a7785f40f55c2a53/crossbeam-epoch/tests/loom.rs
crossbeam-epoch/tests/loom.rs
#![cfg(crossbeam_loom)] use crossbeam_epoch as epoch; use loom_crate as loom; use epoch::*; use epoch::{Atomic, Owned}; use loom::sync::atomic::Ordering::{self, Acquire, Relaxed, Release}; use loom::sync::Arc; use loom::thread::spawn; use std::mem::ManuallyDrop; use std::ptr; #[test] fn it_works() { loom::model(...
rust
Apache-2.0
983d56b6007ca4c22b56a665a7785f40f55c2a53
2026-01-04T15:48:03.794677Z
false
crossbeam-rs/crossbeam
https://github.com/crossbeam-rs/crossbeam/blob/983d56b6007ca4c22b56a665a7785f40f55c2a53/crossbeam-epoch/benches/flush.rs
crossbeam-epoch/benches/flush.rs
#![feature(test)] extern crate test; use std::sync::Barrier; use crossbeam_epoch as epoch; use crossbeam_utils::thread::scope; use test::Bencher; #[bench] fn single_flush(b: &mut Bencher) { const THREADS: usize = 16; let start = Barrier::new(THREADS + 1); let end = Barrier::new(THREADS + 1); scope...
rust
Apache-2.0
983d56b6007ca4c22b56a665a7785f40f55c2a53
2026-01-04T15:48:03.794677Z
false
crossbeam-rs/crossbeam
https://github.com/crossbeam-rs/crossbeam/blob/983d56b6007ca4c22b56a665a7785f40f55c2a53/crossbeam-epoch/benches/defer.rs
crossbeam-epoch/benches/defer.rs
#![feature(test)] extern crate test; use crossbeam_epoch::{self as epoch, Owned}; use crossbeam_utils::thread::scope; use test::Bencher; #[bench] fn single_alloc_defer_free(b: &mut Bencher) { b.iter(|| { let guard = &epoch::pin(); let p = Owned::new(1).into_shared(guard); unsafe { ...
rust
Apache-2.0
983d56b6007ca4c22b56a665a7785f40f55c2a53
2026-01-04T15:48:03.794677Z
false
crossbeam-rs/crossbeam
https://github.com/crossbeam-rs/crossbeam/blob/983d56b6007ca4c22b56a665a7785f40f55c2a53/crossbeam-epoch/benches/pin.rs
crossbeam-epoch/benches/pin.rs
#![feature(test)] extern crate test; use crossbeam_epoch as epoch; use crossbeam_utils::thread::scope; use test::Bencher; #[bench] fn single_pin(b: &mut Bencher) { b.iter(epoch::pin); } #[bench] fn multi_pin(b: &mut Bencher) { const THREADS: usize = 16; const STEPS: usize = 100_000; b.iter(|| { ...
rust
Apache-2.0
983d56b6007ca4c22b56a665a7785f40f55c2a53
2026-01-04T15:48:03.794677Z
false
crossbeam-rs/crossbeam
https://github.com/crossbeam-rs/crossbeam/blob/983d56b6007ca4c22b56a665a7785f40f55c2a53/crossbeam-epoch/examples/sanitize.rs
crossbeam-epoch/examples/sanitize.rs
use std::sync::atomic::AtomicUsize; use std::sync::atomic::Ordering::{AcqRel, Acquire, Relaxed}; use std::sync::Arc; use std::thread; use std::time::{Duration, Instant}; use crossbeam_epoch::{self as epoch, Atomic, Collector, LocalHandle, Owned, Shared}; fn worker(a: Arc<Atomic<AtomicUsize>>, handle: LocalHandle) -> ...
rust
Apache-2.0
983d56b6007ca4c22b56a665a7785f40f55c2a53
2026-01-04T15:48:03.794677Z
false
crossbeam-rs/crossbeam
https://github.com/crossbeam-rs/crossbeam/blob/983d56b6007ca4c22b56a665a7785f40f55c2a53/crossbeam-queue/src/lib.rs
crossbeam-queue/src/lib.rs
//! Concurrent queues. //! //! This crate provides concurrent queues that can be shared among threads: //! //! * [`ArrayQueue`], a bounded MPMC queue that allocates a fixed-capacity buffer on construction. //! * [`SegQueue`], an unbounded MPMC queue that allocates small buffers, segments, on demand. #![no_std] #![doc(...
rust
Apache-2.0
983d56b6007ca4c22b56a665a7785f40f55c2a53
2026-01-04T15:48:03.794677Z
false
crossbeam-rs/crossbeam
https://github.com/crossbeam-rs/crossbeam/blob/983d56b6007ca4c22b56a665a7785f40f55c2a53/crossbeam-queue/src/seg_queue.rs
crossbeam-queue/src/seg_queue.rs
use alloc::alloc::{alloc_zeroed, handle_alloc_error, Layout}; use alloc::boxed::Box; use core::cell::UnsafeCell; use core::fmt; use core::marker::PhantomData; use core::mem::MaybeUninit; use core::panic::{RefUnwindSafe, UnwindSafe}; use core::ptr; use core::sync::atomic::{self, AtomicPtr, AtomicUsize, Ordering}; use c...
rust
Apache-2.0
983d56b6007ca4c22b56a665a7785f40f55c2a53
2026-01-04T15:48:03.794677Z
false
crossbeam-rs/crossbeam
https://github.com/crossbeam-rs/crossbeam/blob/983d56b6007ca4c22b56a665a7785f40f55c2a53/crossbeam-queue/src/array_queue.rs
crossbeam-queue/src/array_queue.rs
//! The implementation is based on Dmitry Vyukov's bounded MPMC queue. //! //! Source: //! - <http://www.1024cores.net/home/lock-free-algorithms/queues/bounded-mpmc-queue> use alloc::boxed::Box; use core::cell::UnsafeCell; use core::fmt; use core::mem::{self, MaybeUninit}; use core::panic::{RefUnwindSafe, UnwindSafe...
rust
Apache-2.0
983d56b6007ca4c22b56a665a7785f40f55c2a53
2026-01-04T15:48:03.794677Z
false
crossbeam-rs/crossbeam
https://github.com/crossbeam-rs/crossbeam/blob/983d56b6007ca4c22b56a665a7785f40f55c2a53/crossbeam-queue/tests/seg_queue.rs
crossbeam-queue/tests/seg_queue.rs
use std::sync::atomic::{AtomicUsize, Ordering}; use crossbeam_queue::SegQueue; use crossbeam_utils::thread::scope; #[test] fn smoke() { let q = SegQueue::new(); q.push(7); assert_eq!(q.pop(), Some(7)); q.push(8); assert_eq!(q.pop(), Some(8)); assert!(q.pop().is_none()); } #[test] fn len_empt...
rust
Apache-2.0
983d56b6007ca4c22b56a665a7785f40f55c2a53
2026-01-04T15:48:03.794677Z
false
crossbeam-rs/crossbeam
https://github.com/crossbeam-rs/crossbeam/blob/983d56b6007ca4c22b56a665a7785f40f55c2a53/crossbeam-queue/tests/array_queue.rs
crossbeam-queue/tests/array_queue.rs
use std::sync::atomic::{AtomicUsize, Ordering}; use crossbeam_queue::ArrayQueue; use crossbeam_utils::thread::scope; #[test] fn smoke() { let q = ArrayQueue::new(1); q.push(7).unwrap(); assert_eq!(q.pop(), Some(7)); q.push(8).unwrap(); assert_eq!(q.pop(), Some(8)); assert!(q.pop().is_none())...
rust
Apache-2.0
983d56b6007ca4c22b56a665a7785f40f55c2a53
2026-01-04T15:48:03.794677Z
false
crossbeam-rs/crossbeam
https://github.com/crossbeam-rs/crossbeam/blob/983d56b6007ca4c22b56a665a7785f40f55c2a53/src/lib.rs
src/lib.rs
//! Tools for concurrent programming. //! //! ## Atomics //! //! * [`AtomicCell`], a thread-safe mutable memory location. //! * [`AtomicConsume`], for reading from primitive atomic types with "consume" ordering. //! //! ## Data structures //! //! * [`deque`], work-stealing deques for building task schedulers. //! * [`A...
rust
Apache-2.0
983d56b6007ca4c22b56a665a7785f40f55c2a53
2026-01-04T15:48:03.794677Z
false
crossbeam-rs/crossbeam
https://github.com/crossbeam-rs/crossbeam/blob/983d56b6007ca4c22b56a665a7785f40f55c2a53/tests/subcrates.rs
tests/subcrates.rs
//! Makes sure subcrates are properly re-exported. use crossbeam::select; #[test] fn channel() { let (s, r) = crossbeam::channel::bounded(1); select! { send(s, 0) -> res => res.unwrap(), recv(r) -> res => assert!(res.is_ok()), } } #[test] fn deque() { let w = crossbeam::deque::Worker...
rust
Apache-2.0
983d56b6007ca4c22b56a665a7785f40f55c2a53
2026-01-04T15:48:03.794677Z
false
crossbeam-rs/crossbeam
https://github.com/crossbeam-rs/crossbeam/blob/983d56b6007ca4c22b56a665a7785f40f55c2a53/crossbeam-deque/src/lib.rs
crossbeam-deque/src/lib.rs
//! Concurrent work-stealing deques. //! //! These data structures are most commonly used in work-stealing schedulers. The typical setup //! involves a number of threads, each having its own FIFO or LIFO queue (*worker*). There is also //! one global FIFO queue (*injector*) and a list of references to *worker* queues t...
rust
Apache-2.0
983d56b6007ca4c22b56a665a7785f40f55c2a53
2026-01-04T15:48:03.794677Z
false
crossbeam-rs/crossbeam
https://github.com/crossbeam-rs/crossbeam/blob/983d56b6007ca4c22b56a665a7785f40f55c2a53/crossbeam-deque/src/deque.rs
crossbeam-deque/src/deque.rs
use std::alloc::{alloc_zeroed, handle_alloc_error, Layout}; use std::boxed::Box; use std::cell::{Cell, UnsafeCell}; use std::cmp; use std::fmt; use std::marker::PhantomData; use std::mem::{self, MaybeUninit}; use std::ptr; use std::sync::atomic::{self, AtomicIsize, AtomicPtr, AtomicUsize, Ordering}; use std::sync::Arc;...
rust
Apache-2.0
983d56b6007ca4c22b56a665a7785f40f55c2a53
2026-01-04T15:48:03.794677Z
true
crossbeam-rs/crossbeam
https://github.com/crossbeam-rs/crossbeam/blob/983d56b6007ca4c22b56a665a7785f40f55c2a53/crossbeam-deque/tests/steal.rs
crossbeam-deque/tests/steal.rs
use crossbeam_deque::Steal::Success; use crossbeam_deque::{Injector, Worker}; #[test] fn steal_fifo() { let w = Worker::new_fifo(); for i in 1..=3 { w.push(i); } let s = w.stealer(); assert_eq!(s.steal(), Success(1)); assert_eq!(s.steal(), Success(2)); assert_eq!(s.steal(), Success...
rust
Apache-2.0
983d56b6007ca4c22b56a665a7785f40f55c2a53
2026-01-04T15:48:03.794677Z
false
crossbeam-rs/crossbeam
https://github.com/crossbeam-rs/crossbeam/blob/983d56b6007ca4c22b56a665a7785f40f55c2a53/crossbeam-deque/tests/injector.rs
crossbeam-deque/tests/injector.rs
use std::sync::atomic::Ordering::SeqCst; use std::sync::atomic::{AtomicBool, AtomicUsize}; use std::sync::{Arc, Mutex}; use crossbeam_deque::Steal::{Empty, Success}; use crossbeam_deque::{Injector, Worker}; use crossbeam_utils::thread::scope; #[test] fn smoke() { let q = Injector::new(); assert_eq!(q.steal(),...
rust
Apache-2.0
983d56b6007ca4c22b56a665a7785f40f55c2a53
2026-01-04T15:48:03.794677Z
false
crossbeam-rs/crossbeam
https://github.com/crossbeam-rs/crossbeam/blob/983d56b6007ca4c22b56a665a7785f40f55c2a53/crossbeam-deque/tests/fifo.rs
crossbeam-deque/tests/fifo.rs
use std::sync::atomic::Ordering::SeqCst; use std::sync::atomic::{AtomicBool, AtomicUsize}; use std::sync::{Arc, Mutex}; use crossbeam_deque::Steal::{Empty, Success}; use crossbeam_deque::Worker; use crossbeam_utils::thread::scope; #[test] fn smoke() { let w = Worker::new_fifo(); let s = w.stealer(); asser...
rust
Apache-2.0
983d56b6007ca4c22b56a665a7785f40f55c2a53
2026-01-04T15:48:03.794677Z
false
crossbeam-rs/crossbeam
https://github.com/crossbeam-rs/crossbeam/blob/983d56b6007ca4c22b56a665a7785f40f55c2a53/crossbeam-deque/tests/lifo.rs
crossbeam-deque/tests/lifo.rs
use std::sync::atomic::Ordering::SeqCst; use std::sync::atomic::{AtomicBool, AtomicUsize}; use std::sync::{Arc, Mutex}; use crossbeam_deque::Steal::{Empty, Success}; use crossbeam_deque::Worker; use crossbeam_utils::thread::scope; #[test] fn smoke() { let w = Worker::new_lifo(); let s = w.stealer(); asser...
rust
Apache-2.0
983d56b6007ca4c22b56a665a7785f40f55c2a53
2026-01-04T15:48:03.794677Z
false
crossbeam-rs/crossbeam
https://github.com/crossbeam-rs/crossbeam/blob/983d56b6007ca4c22b56a665a7785f40f55c2a53/crossbeam-skiplist/src/base.rs
crossbeam-skiplist/src/base.rs
//! A lock-free skip list. See [`SkipList`]. use super::equivalent::Comparable; use alloc::alloc::{alloc, dealloc, handle_alloc_error, Layout}; use core::cmp; use core::fmt; use core::marker::PhantomData; use core::mem; use core::ops::{Bound, Deref, Index, RangeBounds}; use core::ptr; use core::sync::atomic::{fence, A...
rust
Apache-2.0
983d56b6007ca4c22b56a665a7785f40f55c2a53
2026-01-04T15:48:03.794677Z
true
crossbeam-rs/crossbeam
https://github.com/crossbeam-rs/crossbeam/blob/983d56b6007ca4c22b56a665a7785f40f55c2a53/crossbeam-skiplist/src/lib.rs
crossbeam-skiplist/src/lib.rs
//! Concurrent maps and sets based on [skip lists]. //! //! This crate provides the types [`SkipMap`] and [`SkipSet`]. //! These data structures provide an interface similar to [`BTreeMap`] and [`BTreeSet`], //! respectively, except they support safe concurrent access across //! multiple threads. //! //! # Concurrent a...
rust
Apache-2.0
983d56b6007ca4c22b56a665a7785f40f55c2a53
2026-01-04T15:48:03.794677Z
false
crossbeam-rs/crossbeam
https://github.com/crossbeam-rs/crossbeam/blob/983d56b6007ca4c22b56a665a7785f40f55c2a53/crossbeam-skiplist/src/map.rs
crossbeam-skiplist/src/map.rs
//! An ordered map based on a lock-free skip list. See [`SkipMap`]. use std::fmt; use std::mem::ManuallyDrop; use std::ops::{Bound, RangeBounds}; use std::ptr; use crate::{ base::{self, try_pin_loop}, equivalent::Comparable, }; use crossbeam_epoch as epoch; /// An ordered map based on a lock-free skip list. ...
rust
Apache-2.0
983d56b6007ca4c22b56a665a7785f40f55c2a53
2026-01-04T15:48:03.794677Z
false
crossbeam-rs/crossbeam
https://github.com/crossbeam-rs/crossbeam/blob/983d56b6007ca4c22b56a665a7785f40f55c2a53/crossbeam-skiplist/src/set.rs
crossbeam-skiplist/src/set.rs
//! A set based on a lock-free skip list. See [`SkipSet`]. use std::fmt; use std::ops::Deref; use std::ops::{Bound, RangeBounds}; use crate::{equivalent::Comparable, map}; /// A set based on a lock-free skip list. /// /// This is an alternative to [`BTreeSet`] which supports /// concurrent access across multiple thr...
rust
Apache-2.0
983d56b6007ca4c22b56a665a7785f40f55c2a53
2026-01-04T15:48:03.794677Z
false
crossbeam-rs/crossbeam
https://github.com/crossbeam-rs/crossbeam/blob/983d56b6007ca4c22b56a665a7785f40f55c2a53/crossbeam-skiplist/src/equivalent.rs
crossbeam-skiplist/src/equivalent.rs
// These traits are based on `equivalent` crate, but `K` and `Q` are flipped to avoid type inference issues: // https://github.com/indexmap-rs/equivalent/issues/5 //! Traits for key comparison in maps. use core::{borrow::Borrow, cmp::Ordering}; /// Key equivalence trait. /// /// This trait allows hash table lookup t...
rust
Apache-2.0
983d56b6007ca4c22b56a665a7785f40f55c2a53
2026-01-04T15:48:03.794677Z
false
crossbeam-rs/crossbeam
https://github.com/crossbeam-rs/crossbeam/blob/983d56b6007ca4c22b56a665a7785f40f55c2a53/crossbeam-skiplist/tests/base.rs
crossbeam-skiplist/tests/base.rs
#![allow(clippy::redundant_clone)] use std::ops::Bound; use std::sync::atomic::{AtomicUsize, Ordering}; use crossbeam_epoch as epoch; use crossbeam_skiplist::{base, SkipList}; fn ref_entry<'a, K, V>(e: impl Into<Option<base::RefEntry<'a, K, V>>>) -> Entry<'a, K, V> { Entry(e.into()) } struct Entry<'a, K, V>(Opti...
rust
Apache-2.0
983d56b6007ca4c22b56a665a7785f40f55c2a53
2026-01-04T15:48:03.794677Z
false
crossbeam-rs/crossbeam
https://github.com/crossbeam-rs/crossbeam/blob/983d56b6007ca4c22b56a665a7785f40f55c2a53/crossbeam-skiplist/tests/map.rs
crossbeam-skiplist/tests/map.rs
use std::iter; use std::ops::Bound; use std::sync::{Arc, Barrier}; use crossbeam_skiplist::SkipMap; use crossbeam_utils::thread; #[test] fn smoke() { let m = SkipMap::new(); m.insert(1, 10); m.insert(5, 50); m.insert(7, 70); } #[test] fn is_empty() { let s = SkipMap::new(); assert!(s.is_empty...
rust
Apache-2.0
983d56b6007ca4c22b56a665a7785f40f55c2a53
2026-01-04T15:48:03.794677Z
false
crossbeam-rs/crossbeam
https://github.com/crossbeam-rs/crossbeam/blob/983d56b6007ca4c22b56a665a7785f40f55c2a53/crossbeam-skiplist/tests/set.rs
crossbeam-skiplist/tests/set.rs
use crossbeam_skiplist::SkipSet; use crossbeam_utils::thread; use std::{ iter, ops::Bound, sync::{Arc, Barrier}, }; #[test] fn smoke() { let m = SkipSet::new(); m.insert(1); m.insert(5); m.insert(7); } #[test] fn is_empty() { let s = SkipSet::new(); assert!(s.is_empty()); s.in...
rust
Apache-2.0
983d56b6007ca4c22b56a665a7785f40f55c2a53
2026-01-04T15:48:03.794677Z
false
crossbeam-rs/crossbeam
https://github.com/crossbeam-rs/crossbeam/blob/983d56b6007ca4c22b56a665a7785f40f55c2a53/crossbeam-skiplist/benches/btree.rs
crossbeam-skiplist/benches/btree.rs
#![feature(test)] extern crate test; use test::{black_box, Bencher}; use std::collections::BTreeMap as Map; #[bench] fn insert(b: &mut Bencher) { b.iter(|| { let mut map = Map::new(); let mut num = 0u64; for _ in 0..1_000 { num = num.wrapping_mul(17).wrapping_add(255); ...
rust
Apache-2.0
983d56b6007ca4c22b56a665a7785f40f55c2a53
2026-01-04T15:48:03.794677Z
false
crossbeam-rs/crossbeam
https://github.com/crossbeam-rs/crossbeam/blob/983d56b6007ca4c22b56a665a7785f40f55c2a53/crossbeam-skiplist/benches/skiplist.rs
crossbeam-skiplist/benches/skiplist.rs
#![feature(test)] #![allow(clippy::unit_arg)] extern crate test; use test::{black_box, Bencher}; use crossbeam_epoch as epoch; use crossbeam_skiplist::SkipList; #[bench] fn insert(b: &mut Bencher) { let guard = &epoch::pin(); b.iter(|| { let map = SkipList::new(epoch::default_collector().clone()); ...
rust
Apache-2.0
983d56b6007ca4c22b56a665a7785f40f55c2a53
2026-01-04T15:48:03.794677Z
false
crossbeam-rs/crossbeam
https://github.com/crossbeam-rs/crossbeam/blob/983d56b6007ca4c22b56a665a7785f40f55c2a53/crossbeam-skiplist/benches/hash.rs
crossbeam-skiplist/benches/hash.rs
#![feature(test)] extern crate test; use test::{black_box, Bencher}; use std::collections::HashMap as Map; #[bench] fn insert(b: &mut Bencher) { b.iter(|| { let mut map = Map::new(); let mut num = 0u64; for _ in 0..1_000 { num = num.wrapping_mul(17).wrapping_add(255); ...
rust
Apache-2.0
983d56b6007ca4c22b56a665a7785f40f55c2a53
2026-01-04T15:48:03.794677Z
false
crossbeam-rs/crossbeam
https://github.com/crossbeam-rs/crossbeam/blob/983d56b6007ca4c22b56a665a7785f40f55c2a53/crossbeam-skiplist/benches/skipmap.rs
crossbeam-skiplist/benches/skipmap.rs
#![feature(test)] extern crate test; use test::{black_box, Bencher}; use crossbeam_skiplist::SkipMap as Map; #[bench] fn insert(b: &mut Bencher) { b.iter(|| { let map = Map::new(); let mut num = 0u64; for _ in 0..1_000 { num = num.wrapping_mul(17).wrapping_add(255); ...
rust
Apache-2.0
983d56b6007ca4c22b56a665a7785f40f55c2a53
2026-01-04T15:48:03.794677Z
false
crossbeam-rs/crossbeam
https://github.com/crossbeam-rs/crossbeam/blob/983d56b6007ca4c22b56a665a7785f40f55c2a53/crossbeam-skiplist/examples/simple.rs
crossbeam-skiplist/examples/simple.rs
// use std::time::Instant; fn main() { // let map = crossbeam_skiplist::SkipMap::new(); // // let mut map = std::collections::BTreeMap::new(); // // let mut map = std::collections::HashMap::new(); // // let now = Instant::now(); // // let mut num = 0u64; // for _ in 0..1_000_000 { /...
rust
Apache-2.0
983d56b6007ca4c22b56a665a7785f40f55c2a53
2026-01-04T15:48:03.794677Z
false
crossbeam-rs/crossbeam
https://github.com/crossbeam-rs/crossbeam/blob/983d56b6007ca4c22b56a665a7785f40f55c2a53/crossbeam-utils/build-common.rs
crossbeam-utils/build-common.rs
// The target triplets have the form of 'arch-vendor-system'. // // When building for Linux (e.g. the 'system' part is // 'linux-something'), replace the vendor with 'unknown' // so that mapping to rust standard targets happens correctly. fn convert_custom_linux_target(target: String) -> String { let mut parts: Vec...
rust
Apache-2.0
983d56b6007ca4c22b56a665a7785f40f55c2a53
2026-01-04T15:48:03.794677Z
false