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 |
|---|---|---|---|---|---|---|---|---|
ReSpeak/tsclientlib | https://github.com/ReSpeak/tsclientlib/blob/3fbfa26ead0d3e5b38288b55abe3e2d636a97115/utils/ts-bookkeeping/build/message_parser.rs | utils/ts-bookkeeping/build/message_parser.rs | use std::default::Default;
use itertools::Itertools;
use t4rust_derive::Template;
use tsproto_structs::messages::*;
use tsproto_structs::{indent, messages, InnerRustType, RustType};
#[derive(Template)]
#[TemplatePath = "build/MessageDeclarations.tt"]
#[derive(Debug, Clone)]
pub struct MessageDeclarations<'a>(pub &'a ... | rust | Apache-2.0 | 3fbfa26ead0d3e5b38288b55abe3e2d636a97115 | 2026-01-04T20:19:54.636515Z | false |
ReSpeak/tsclientlib | https://github.com/ReSpeak/tsclientlib/blob/3fbfa26ead0d3e5b38288b55abe3e2d636a97115/utils/ts-bookkeeping/build/build.rs | utils/ts-bookkeeping/build/build.rs | use std::env;
use std::fs::File;
use std::io::prelude::*;
use std::path::Path;
mod book_parser;
mod book_to_messages_parser;
mod events;
mod message_parser;
mod messages_to_book_parser;
mod properties;
use crate::book_parser::BookDeclarations;
use crate::book_to_messages_parser::BookToMessagesDeclarations;
use crate:... | rust | Apache-2.0 | 3fbfa26ead0d3e5b38288b55abe3e2d636a97115 | 2026-01-04T20:19:54.636515Z | false |
ReSpeak/tsclientlib | https://github.com/ReSpeak/tsclientlib/blob/3fbfa26ead0d3e5b38288b55abe3e2d636a97115/utils/ts-bookkeeping/build/events.rs | utils/ts-bookkeeping/build/events.rs | use std::collections::HashSet;
use std::default::Default;
use std::ops::Deref;
use t4rust_derive::Template;
use tsproto_structs::book::*;
#[derive(Template)]
#[TemplatePath = "build/Events.tt"]
#[derive(Debug)]
pub struct EventDeclarations<'a>(&'a BookDeclarations);
impl<'a> Deref for EventDeclarations<'a> {
type T... | rust | Apache-2.0 | 3fbfa26ead0d3e5b38288b55abe3e2d636a97115 | 2026-01-04T20:19:54.636515Z | false |
ReSpeak/tsclientlib | https://github.com/ReSpeak/tsclientlib/blob/3fbfa26ead0d3e5b38288b55abe3e2d636a97115/utils/ts-bookkeeping/build/book_parser.rs | utils/ts-bookkeeping/build/book_parser.rs | use std::default::Default;
use t4rust_derive::Template;
use tsproto_structs::*;
#[derive(Template)]
#[TemplatePath = "build/BookDeclarations.tt"]
#[derive(Debug)]
pub struct BookDeclarations<'a>(pub &'a book::BookDeclarations);
impl Default for BookDeclarations<'static> {
fn default() -> Self { BookDeclarations(&ts... | rust | Apache-2.0 | 3fbfa26ead0d3e5b38288b55abe3e2d636a97115 | 2026-01-04T20:19:54.636515Z | false |
ReSpeak/tsclientlib | https://github.com/ReSpeak/tsclientlib/blob/3fbfa26ead0d3e5b38288b55abe3e2d636a97115/utils/ts-bookkeeping/build/book_to_messages_parser.rs | utils/ts-bookkeeping/build/book_to_messages_parser.rs | use std::default::Default;
use std::ops::Deref;
use heck::*;
use t4rust_derive::Template;
use tsproto_structs::book_to_messages::*;
use tsproto_structs::messages::Field;
use tsproto_structs::*;
#[derive(Template)]
#[TemplatePath = "build/BookToMessages.tt"]
#[derive(Debug)]
pub struct BookToMessagesDeclarations<'a>(&... | rust | Apache-2.0 | 3fbfa26ead0d3e5b38288b55abe3e2d636a97115 | 2026-01-04T20:19:54.636515Z | false |
ReSpeak/tsclientlib | https://github.com/ReSpeak/tsclientlib/blob/3fbfa26ead0d3e5b38288b55abe3e2d636a97115/utils/tsproto-structs/src/errors.rs | utils/tsproto-structs/src/errors.rs | use std::result::Result;
use crate::*;
use once_cell::sync::Lazy;
pub const DATA_STR: &str =
include_str!(concat!(env!("CARGO_MANIFEST_DIR"), "/declarations/Errors.csv"));
pub static DATA: Lazy<Errors> = Lazy::new(|| {
Errors(
csv::Reader::from_reader(DATA_STR.as_bytes())
.deserialize()
.collect::<Result<... | rust | Apache-2.0 | 3fbfa26ead0d3e5b38288b55abe3e2d636a97115 | 2026-01-04T20:19:54.636515Z | false |
ReSpeak/tsclientlib | https://github.com/ReSpeak/tsclientlib/blob/3fbfa26ead0d3e5b38288b55abe3e2d636a97115/utils/tsproto-structs/src/messages.rs | utils/tsproto-structs/src/messages.rs | use heck::*;
use once_cell::sync::Lazy;
use serde::Deserialize;
use crate::*;
pub const DATA_STR: &str =
include_str!(concat!(env!("CARGO_MANIFEST_DIR"), "/declarations/Messages.toml"));
pub static DATA: Lazy<MessageDeclarations> = Lazy::new(|| toml::from_str(DATA_STR).unwrap());
#[derive(Deserialize, Debug, Clone... | rust | Apache-2.0 | 3fbfa26ead0d3e5b38288b55abe3e2d636a97115 | 2026-01-04T20:19:54.636515Z | false |
ReSpeak/tsclientlib | https://github.com/ReSpeak/tsclientlib/blob/3fbfa26ead0d3e5b38288b55abe3e2d636a97115/utils/tsproto-structs/src/messages_to_book.rs | utils/tsproto-structs/src/messages_to_book.rs | use std::collections::HashSet;
use std::fmt::Write;
use std::str::FromStr;
use once_cell::sync::Lazy;
use serde::Deserialize;
use crate::book::{BookDeclarations, Property, Struct};
use crate::messages::{Field, Message, MessageDeclarations};
use crate::*;
pub const DATA_STR: &str =
include_str!(concat!(env!("CARGO_M... | rust | Apache-2.0 | 3fbfa26ead0d3e5b38288b55abe3e2d636a97115 | 2026-01-04T20:19:54.636515Z | false |
ReSpeak/tsclientlib | https://github.com/ReSpeak/tsclientlib/blob/3fbfa26ead0d3e5b38288b55abe3e2d636a97115/utils/tsproto-structs/src/lib.rs | utils/tsproto-structs/src/lib.rs | //! `tsproto-structs` contains machine readable data for several TeamSpeak related topics.
//!
//! The underlying data files can be found in the
//! [tsdeclarations](https://github.com/ReSpeak/tsdeclarations) repository.
use std::fmt;
use std::str::FromStr;
use heck::*;
use serde::Deserialize;
type Result<T> = std::... | rust | Apache-2.0 | 3fbfa26ead0d3e5b38288b55abe3e2d636a97115 | 2026-01-04T20:19:54.636515Z | false |
ReSpeak/tsclientlib | https://github.com/ReSpeak/tsclientlib/blob/3fbfa26ead0d3e5b38288b55abe3e2d636a97115/utils/tsproto-structs/src/permissions.rs | utils/tsproto-structs/src/permissions.rs | use std::result::Result;
use crate::*;
use once_cell::sync::Lazy;
pub const DATA_STR: &str =
include_str!(concat!(env!("CARGO_MANIFEST_DIR"), "/declarations/Permissions.csv"));
pub static DATA: Lazy<Permissions> = Lazy::new(|| {
Permissions(
csv::Reader::from_reader(DATA_STR.as_bytes())
.deserialize()
.co... | rust | Apache-2.0 | 3fbfa26ead0d3e5b38288b55abe3e2d636a97115 | 2026-01-04T20:19:54.636515Z | false |
ReSpeak/tsclientlib | https://github.com/ReSpeak/tsclientlib/blob/3fbfa26ead0d3e5b38288b55abe3e2d636a97115/utils/tsproto-structs/src/enums.rs | utils/tsproto-structs/src/enums.rs | use once_cell::sync::Lazy;
use serde::Deserialize;
pub const DATA_STR: &str =
include_str!(concat!(env!("CARGO_MANIFEST_DIR"), "/declarations/Enums.toml"));
pub static DATA: Lazy<Enums> = Lazy::new(|| toml::from_str(DATA_STR).unwrap());
#[derive(Deserialize, Debug)]
#[serde(deny_unknown_fields)]
pub struct Enums {
... | rust | Apache-2.0 | 3fbfa26ead0d3e5b38288b55abe3e2d636a97115 | 2026-01-04T20:19:54.636515Z | false |
ReSpeak/tsclientlib | https://github.com/ReSpeak/tsclientlib/blob/3fbfa26ead0d3e5b38288b55abe3e2d636a97115/utils/tsproto-structs/src/versions.rs | utils/tsproto-structs/src/versions.rs | use std::collections::HashMap;
use std::fmt::Write;
use std::result::Result;
use crate::*;
use base64::prelude::*;
use once_cell::sync::Lazy;
pub const DATA_STR: &str =
include_str!(concat!(env!("CARGO_MANIFEST_DIR"), "/declarations/Versions.csv"));
pub static DATA: Lazy<Versions> = Lazy::new(|| {
let mut table =... | rust | Apache-2.0 | 3fbfa26ead0d3e5b38288b55abe3e2d636a97115 | 2026-01-04T20:19:54.636515Z | false |
ReSpeak/tsclientlib | https://github.com/ReSpeak/tsclientlib/blob/3fbfa26ead0d3e5b38288b55abe3e2d636a97115/utils/tsproto-structs/src/book.rs | utils/tsproto-structs/src/book.rs | use heck::*;
use once_cell::sync::Lazy;
use serde::Deserialize;
use crate::*;
pub const DATA_STR: &str =
include_str!(concat!(env!("CARGO_MANIFEST_DIR"), "/declarations/Book.toml"));
pub static DATA: Lazy<BookDeclarations> = Lazy::new(|| toml::from_str(DATA_STR).unwrap());
#[derive(Deserialize, Debug)]
#[serde(den... | rust | Apache-2.0 | 3fbfa26ead0d3e5b38288b55abe3e2d636a97115 | 2026-01-04T20:19:54.636515Z | false |
ReSpeak/tsclientlib | https://github.com/ReSpeak/tsclientlib/blob/3fbfa26ead0d3e5b38288b55abe3e2d636a97115/utils/tsproto-structs/src/book_to_messages.rs | utils/tsproto-structs/src/book_to_messages.rs | use std::str::FromStr;
use heck::*;
use once_cell::sync::Lazy;
use serde::Deserialize;
use crate::book::{BookDeclarations, Property, Struct};
use crate::messages::{Field, Message, MessageDeclarations};
use crate::*;
pub const DATA_STR: &str =
include_str!(concat!(env!("CARGO_MANIFEST_DIR"), "/declarations/BookToMes... | rust | Apache-2.0 | 3fbfa26ead0d3e5b38288b55abe3e2d636a97115 | 2026-01-04T20:19:54.636515Z | false |
ReSpeak/tsclientlib | https://github.com/ReSpeak/tsclientlib/blob/3fbfa26ead0d3e5b38288b55abe3e2d636a97115/tsclientlib/src/prelude.rs | tsclientlib/src/prelude.rs | pub use ts_bookkeeping::data::exts::*;
pub use ts_bookkeeping::messages::OutMessageTrait;
pub use crate::OutCommandExt as _;
| rust | Apache-2.0 | 3fbfa26ead0d3e5b38288b55abe3e2d636a97115 | 2026-01-04T20:19:54.636515Z | false |
ReSpeak/tsclientlib | https://github.com/ReSpeak/tsclientlib/blob/3fbfa26ead0d3e5b38288b55abe3e2d636a97115/tsclientlib/src/lib.rs | tsclientlib/src/lib.rs | //! tsclientlib is a library which makes it simple to create TeamSpeak clients
//! and bots.
//!
//! For a full client application, you might want to have a look at [Qint].
//!
//! If more power over the internals of a connection is needed, the `unstable` feature can be
//! enabled. Beware that functionality behind thi... | rust | Apache-2.0 | 3fbfa26ead0d3e5b38288b55abe3e2d636a97115 | 2026-01-04T20:19:54.636515Z | true |
ReSpeak/tsclientlib | https://github.com/ReSpeak/tsclientlib/blob/3fbfa26ead0d3e5b38288b55abe3e2d636a97115/tsclientlib/src/tests.rs | tsclientlib/src/tests.rs | use once_cell::sync::Lazy;
use ts_bookkeeping::messages::s2c::InMessage;
use tsproto_packets::packets::{Direction, Flags, OutPacket, PacketType};
static TRACING: Lazy<()> = Lazy::new(|| tracing_subscriber::fmt().with_test_writer().init());
pub(crate) fn create_logger() { Lazy::force(&TRACING); }
fn parse_msg(msg: &s... | rust | Apache-2.0 | 3fbfa26ead0d3e5b38288b55abe3e2d636a97115 | 2026-01-04T20:19:54.636515Z | false |
ReSpeak/tsclientlib | https://github.com/ReSpeak/tsclientlib/blob/3fbfa26ead0d3e5b38288b55abe3e2d636a97115/tsclientlib/src/sync.rs | tsclientlib/src/sync.rs | //! The `sync` module contains an easier to use interface for a connection.
//!
//! It makes it easier to use a connection from multiple threads and use
//! `async`/`await` syntax for the cost of a little bit performance.
use std::collections::HashMap;
use std::ops::{Deref, DerefMut};
use std::pin::Pin;
use std::task::... | rust | Apache-2.0 | 3fbfa26ead0d3e5b38288b55abe3e2d636a97115 | 2026-01-04T20:19:54.636515Z | false |
ReSpeak/tsclientlib | https://github.com/ReSpeak/tsclientlib/blob/3fbfa26ead0d3e5b38288b55abe3e2d636a97115/tsclientlib/src/resolver.rs | tsclientlib/src/resolver.rs | //! Resolve TeamSpeak server addresses of any kind.
// Changes with TeamSpeak client 3.1:
// https://support.teamspeakusa.com/index.php?/Knowledgebase/Article/View/332
use std::net::{IpAddr, Ipv6Addr, SocketAddr};
use std::str::{self, FromStr};
use futures::prelude::*;
use hickory_resolver::config::{ResolverConfig, R... | rust | Apache-2.0 | 3fbfa26ead0d3e5b38288b55abe3e2d636a97115 | 2026-01-04T20:19:54.636515Z | false |
ReSpeak/tsclientlib | https://github.com/ReSpeak/tsclientlib/blob/3fbfa26ead0d3e5b38288b55abe3e2d636a97115/tsclientlib/src/audio.rs | tsclientlib/src/audio.rs | //! Handle receiving audio.
//!
//! The [`AudioHandler`] collects all incoming audio packets and queues them per
//! client. It decodes the audio, handles out-of-order packets and missing
//! packets. It automatically adjusts the queue length based on the jitter of
//! incoming packets.
use std::cmp::Reverse;
use std:... | rust | Apache-2.0 | 3fbfa26ead0d3e5b38288b55abe3e2d636a97115 | 2026-01-04T20:19:54.636515Z | false |
ReSpeak/tsclientlib | https://github.com/ReSpeak/tsclientlib/blob/3fbfa26ead0d3e5b38288b55abe3e2d636a97115/tsclientlib/examples/simple-sync.rs | tsclientlib/examples/simple-sync.rs | use anyhow::Result;
use clap::Parser;
use futures::prelude::*;
use tokio::time::{self, Duration};
use tsclientlib::sync::SyncConnection;
use tsclientlib::{Connection, DisconnectOptions, Identity};
#[derive(Parser, Debug)]
#[command(author, about)]
struct Args {
/// The address of the server to connect to
#[arg(shor... | rust | Apache-2.0 | 3fbfa26ead0d3e5b38288b55abe3e2d636a97115 | 2026-01-04T20:19:54.636515Z | false |
ReSpeak/tsclientlib | https://github.com/ReSpeak/tsclientlib/blob/3fbfa26ead0d3e5b38288b55abe3e2d636a97115/tsclientlib/examples/sync.rs | tsclientlib/examples/sync.rs | use anyhow::Result;
use clap::Parser;
use futures::prelude::*;
use tokio::time::{self, Duration};
use tsclientlib::prelude::*;
use tsclientlib::sync::SyncConnection;
use tsclientlib::{Connection, DisconnectOptions, Identity, StreamItem};
#[derive(Parser, Debug)]
#[command(author, about)]
struct Args {
/// The addres... | rust | Apache-2.0 | 3fbfa26ead0d3e5b38288b55abe3e2d636a97115 | 2026-01-04T20:19:54.636515Z | false |
ReSpeak/tsclientlib | https://github.com/ReSpeak/tsclientlib/blob/3fbfa26ead0d3e5b38288b55abe3e2d636a97115/tsclientlib/examples/audio-latency.rs | tsclientlib/examples/audio-latency.rs | use anyhow::Result;
use clap::Parser;
use tokio::sync::mpsc;
use tokio::task::LocalSet;
use tracing::{debug, info};
use tsclientlib::ClientId;
use tsproto_packets::packets::{Direction, InAudioBuf};
mod audio_utils;
#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
struct ConnectionId(u64);
#[derive(Parser, Debug)]... | rust | Apache-2.0 | 3fbfa26ead0d3e5b38288b55abe3e2d636a97115 | 2026-01-04T20:19:54.636515Z | false |
ReSpeak/tsclientlib | https://github.com/ReSpeak/tsclientlib/blob/3fbfa26ead0d3e5b38288b55abe3e2d636a97115/tsclientlib/examples/simple.rs | tsclientlib/examples/simple.rs | use anyhow::{bail, Result};
use clap::Parser;
use futures::prelude::*;
use tokio::time::{self, Duration};
use tsclientlib::{Connection, DisconnectOptions, Identity, StreamItem};
#[derive(Parser, Debug)]
#[command(author, about)]
struct Args {
/// The address of the server to connect to
#[arg(short, long, default_va... | rust | Apache-2.0 | 3fbfa26ead0d3e5b38288b55abe3e2d636a97115 | 2026-01-04T20:19:54.636515Z | false |
ReSpeak/tsclientlib | https://github.com/ReSpeak/tsclientlib/blob/3fbfa26ead0d3e5b38288b55abe3e2d636a97115/tsclientlib/examples/channeltree.rs | tsclientlib/examples/channeltree.rs | use anyhow::{bail, Result};
use clap::Parser;
use futures::prelude::*;
use tokio::time::{self, Duration};
use tsclientlib::data::{self, Channel, Client};
use tsclientlib::prelude::*;
use tsclientlib::{ChannelId, Connection, DisconnectOptions, Identity, StreamItem};
#[derive(Parser, Debug)]
#[command(author, about)]
s... | rust | Apache-2.0 | 3fbfa26ead0d3e5b38288b55abe3e2d636a97115 | 2026-01-04T20:19:54.636515Z | false |
ReSpeak/tsclientlib | https://github.com/ReSpeak/tsclientlib/blob/3fbfa26ead0d3e5b38288b55abe3e2d636a97115/tsclientlib/examples/many.rs | tsclientlib/examples/many.rs | use anyhow::Result;
use clap::Parser;
use futures::prelude::*;
use tokio::time::{self, Duration};
use tracing::error;
use tsclientlib::{Connection, DisconnectOptions, Identity, StreamItem};
#[derive(Parser, Debug)]
#[command(author, about)]
struct Args {
/// The address of the server to connect to
#[arg(short, long... | rust | Apache-2.0 | 3fbfa26ead0d3e5b38288b55abe3e2d636a97115 | 2026-01-04T20:19:54.636515Z | false |
ReSpeak/tsclientlib | https://github.com/ReSpeak/tsclientlib/blob/3fbfa26ead0d3e5b38288b55abe3e2d636a97115/tsclientlib/examples/audio.rs | tsclientlib/examples/audio.rs | //! This example connects to a teamspeak instance and joins a channel.
//! The connected bot-identity will listen on your microphone and send everything to the current
//! channel. In parallel, the program will play back all other clients in the channel via its own
//! audio output.
//! Microphone -> Channel
//! Channe... | rust | Apache-2.0 | 3fbfa26ead0d3e5b38288b55abe3e2d636a97115 | 2026-01-04T20:19:54.636515Z | false |
ReSpeak/tsclientlib | https://github.com/ReSpeak/tsclientlib/blob/3fbfa26ead0d3e5b38288b55abe3e2d636a97115/tsclientlib/examples/audio_utils/mod.rs | tsclientlib/examples/audio_utils/mod.rs | use std::sync::{Arc, Mutex};
use anyhow::Result;
use tokio::task::LocalSet;
use audio_to_ts::AudioToTs;
use ts_to_audio::TsToAudio;
pub mod audio_to_ts;
pub mod ts_to_audio;
/// The usual frame size.
///
/// Use 48 kHz, 20 ms frames (50 per second) and mono data (1 channel).
/// This means 1920 samples and 7.5 kiB.... | rust | Apache-2.0 | 3fbfa26ead0d3e5b38288b55abe3e2d636a97115 | 2026-01-04T20:19:54.636515Z | false |
ReSpeak/tsclientlib | https://github.com/ReSpeak/tsclientlib/blob/3fbfa26ead0d3e5b38288b55abe3e2d636a97115/tsclientlib/examples/audio_utils/audio_to_ts.rs | tsclientlib/examples/audio_utils/audio_to_ts.rs | use std::sync::{Arc, Mutex};
use anyhow::{format_err, Result};
use audiopus::coder::Encoder;
use futures::prelude::*;
use sdl2::audio::{AudioCallback, AudioDevice, AudioSpec, AudioSpecDesired, AudioStatus};
use sdl2::AudioSubsystem;
use tokio::sync::mpsc;
use tokio::task::LocalSet;
use tokio::time::{self, Duration};
u... | rust | Apache-2.0 | 3fbfa26ead0d3e5b38288b55abe3e2d636a97115 | 2026-01-04T20:19:54.636515Z | false |
ReSpeak/tsclientlib | https://github.com/ReSpeak/tsclientlib/blob/3fbfa26ead0d3e5b38288b55abe3e2d636a97115/tsclientlib/examples/audio_utils/ts_to_audio.rs | tsclientlib/examples/audio_utils/ts_to_audio.rs | use std::sync::{Arc, Mutex};
use anyhow::{format_err, Result};
use futures::prelude::*;
use sdl2::audio::{AudioCallback, AudioDevice, AudioSpecDesired, AudioStatus};
use sdl2::AudioSubsystem;
use tokio::task::LocalSet;
use tokio::time::{self, Duration};
use tokio_stream::wrappers::IntervalStream;
use tracing::{debug, ... | rust | Apache-2.0 | 3fbfa26ead0d3e5b38288b55abe3e2d636a97115 | 2026-01-04T20:19:54.636515Z | false |
sd2k/grafana-tokio-console-datasource | https://github.com/sd2k/grafana-tokio-console-datasource/blob/ceb221d09a1cbb1e8104fe6fcb5fcf8a904f1cc9/backend/src/lib.rs | backend/src/lib.rs | mod connection;
mod metadata;
mod plugin;
mod task;
mod util;
pub use plugin::ConsolePlugin;
#[track_caller]
fn spawn_named<T>(
_name: &str,
task: impl std::future::Future<Output = T> + Send + 'static,
) -> tokio::task::JoinHandle<T>
where
T: Send + 'static,
{
tokio::task::Builder::new().name(_name).s... | rust | Apache-2.0 | ceb221d09a1cbb1e8104fe6fcb5fcf8a904f1cc9 | 2026-01-04T20:20:24.329730Z | false |
sd2k/grafana-tokio-console-datasource | https://github.com/sd2k/grafana-tokio-console-datasource/blob/ceb221d09a1cbb1e8104fe6fcb5fcf8a904f1cc9/backend/src/connection.rs | backend/src/connection.rs | use console_api::instrument::{
instrument_client::InstrumentClient, InstrumentRequest, PauseRequest, ResumeRequest,
TaskDetailsRequest, Update,
};
use console_api::tasks::TaskDetails;
use futures::stream::StreamExt;
use std::{error::Error, pin::Pin, time::Duration};
use tonic::{transport::Channel, transport::Ur... | rust | Apache-2.0 | ceb221d09a1cbb1e8104fe6fcb5fcf8a904f1cc9 | 2026-01-04T20:20:24.329730Z | false |
sd2k/grafana-tokio-console-datasource | https://github.com/sd2k/grafana-tokio-console-datasource/blob/ceb221d09a1cbb1e8104fe6fcb5fcf8a904f1cc9/backend/src/util.rs | backend/src/util.rs | pub trait Percentage {
// Using an extension trait for this is maybe a bit excessive, but making it
// a method has the nice advantage of making it *really* obvious which is
// the total and which is the amount.
fn percent_of(self, total: Self) -> Self;
}
impl Percentage for usize {
fn percent_of(s... | rust | Apache-2.0 | ceb221d09a1cbb1e8104fe6fcb5fcf8a904f1cc9 | 2026-01-04T20:20:24.329730Z | false |
sd2k/grafana-tokio-console-datasource | https://github.com/sd2k/grafana-tokio-console-datasource/blob/ceb221d09a1cbb1e8104fe6fcb5fcf8a904f1cc9/backend/src/task.rs | backend/src/task.rs | use std::{
collections::HashMap,
fmt,
time::{Duration, SystemTime},
};
use console_api::{tasks::Stats, Location};
use hdrhistogram::Histogram;
use serde::{Deserialize, Serialize};
use crate::{
metadata::{MetaId, Metadata},
util::Percentage,
};
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, Ord... | rust | Apache-2.0 | ceb221d09a1cbb1e8104fe6fcb5fcf8a904f1cc9 | 2026-01-04T20:20:24.329730Z | false |
sd2k/grafana-tokio-console-datasource | https://github.com/sd2k/grafana-tokio-console-datasource/blob/ceb221d09a1cbb1e8104fe6fcb5fcf8a904f1cc9/backend/src/main.rs | backend/src/main.rs | use std::net::SocketAddrV4;
use tracing_subscriber::{
filter::{LevelFilter, Targets},
prelude::*,
};
use grafana_tokio_console_datasource::ConsolePlugin;
#[grafana_plugin_sdk::main(
services(data, diagnostics, resource, stream),
init_subscriber = false,
shutdown_handler = "0.0.0.0:10001"
)]
async... | rust | Apache-2.0 | ceb221d09a1cbb1e8104fe6fcb5fcf8a904f1cc9 | 2026-01-04T20:20:24.329730Z | false |
sd2k/grafana-tokio-console-datasource | https://github.com/sd2k/grafana-tokio-console-datasource/blob/ceb221d09a1cbb1e8104fe6fcb5fcf8a904f1cc9/backend/src/metadata.rs | backend/src/metadata.rs | #[derive(Clone, Copy, Debug, Hash, Eq, PartialEq)]
pub struct MetaId(pub u64);
#[derive(Debug)]
pub struct Metadata {
pub id: MetaId,
pub field_names: Vec<String>,
pub target: String,
//TODO: add more metadata as needed
}
impl Metadata {
pub fn from_proto(pb: console_api::Metadata, id: u64) -> Sel... | rust | Apache-2.0 | ceb221d09a1cbb1e8104fe6fcb5fcf8a904f1cc9 | 2026-01-04T20:20:24.329730Z | false |
sd2k/grafana-tokio-console-datasource | https://github.com/sd2k/grafana-tokio-console-datasource/blob/ceb221d09a1cbb1e8104fe6fcb5fcf8a904f1cc9/backend/src/plugin/stream.rs | backend/src/plugin/stream.rs | /// The `grafana_plugin_sdk::backend::StreamService` implementation for the Console plugin.
use std::{
pin::Pin,
task::{Context, Poll},
time::Duration,
};
use futures::Stream;
use grafana_plugin_sdk::{backend, data};
use tokio::sync::{mpsc, oneshot};
use tracing::{debug, error, info, warn};
use crate::spa... | rust | Apache-2.0 | ceb221d09a1cbb1e8104fe6fcb5fcf8a904f1cc9 | 2026-01-04T20:20:24.329730Z | false |
sd2k/grafana-tokio-console-datasource | https://github.com/sd2k/grafana-tokio-console-datasource/blob/ceb221d09a1cbb1e8104fe6fcb5fcf8a904f1cc9/backend/src/plugin/resource.rs | backend/src/plugin/resource.rs | use bytes::Bytes;
use futures::stream;
use grafana_plugin_sdk::backend;
use http::{Response, StatusCode};
use serde::Serialize;
use thiserror::Error;
use crate::ConsolePlugin;
use super::DatasourceUid;
#[derive(Debug, Error)]
pub enum ResourceError {
#[error("Path not found")]
NotFound,
#[error("Plugin ... | rust | Apache-2.0 | ceb221d09a1cbb1e8104fe6fcb5fcf8a904f1cc9 | 2026-01-04T20:20:24.329730Z | false |
sd2k/grafana-tokio-console-datasource | https://github.com/sd2k/grafana-tokio-console-datasource/blob/ceb221d09a1cbb1e8104fe6fcb5fcf8a904f1cc9/backend/src/plugin/diagnostics.rs | backend/src/plugin/diagnostics.rs | use grafana_plugin_sdk::backend;
use crate::connection::Connection;
use super::{ConsolePlugin, Error};
#[backend::async_trait]
impl backend::DiagnosticsService for ConsolePlugin {
type CheckHealthError = Error;
async fn check_health(
&self,
request: backend::CheckHealthRequest,
) -> Resu... | rust | Apache-2.0 | ceb221d09a1cbb1e8104fe6fcb5fcf8a904f1cc9 | 2026-01-04T20:20:24.329730Z | false |
sd2k/grafana-tokio-console-datasource | https://github.com/sd2k/grafana-tokio-console-datasource/blob/ceb221d09a1cbb1e8104fe6fcb5fcf8a904f1cc9/backend/src/plugin/mod.rs | backend/src/plugin/mod.rs | use std::{
collections::{HashMap, HashSet},
fmt,
io::Cursor,
str::FromStr,
sync::Arc,
time::{Duration, SystemTime},
};
use chrono::prelude::*;
use console_api::{
instrument::Update,
tasks::{task_details::PollTimesHistogram, TaskDetails},
};
use dashmap::DashMap;
use futures::{StreamExt,... | rust | Apache-2.0 | ceb221d09a1cbb1e8104fe6fcb5fcf8a904f1cc9 | 2026-01-04T20:20:24.329730Z | false |
sd2k/grafana-tokio-console-datasource | https://github.com/sd2k/grafana-tokio-console-datasource/blob/ceb221d09a1cbb1e8104fe6fcb5fcf8a904f1cc9/backend/src/plugin/data.rs | backend/src/plugin/data.rs | use futures::stream::FuturesOrdered;
use serde::Deserialize;
use grafana_plugin_sdk::{backend, data};
use super::{ConsolePlugin, Path};
#[derive(Debug, thiserror::Error)]
#[error("Error querying backend for {}", .ref_id)]
pub struct QueryError {
ref_id: String,
}
impl backend::DataQueryError for QueryError {
... | rust | Apache-2.0 | ceb221d09a1cbb1e8104fe6fcb5fcf8a904f1cc9 | 2026-01-04T20:20:24.329730Z | false |
sd2k/grafana-tokio-console-datasource | https://github.com/sd2k/grafana-tokio-console-datasource/blob/ceb221d09a1cbb1e8104fe6fcb5fcf8a904f1cc9/xtask/src/main.rs | xtask/src/main.rs | use std::{env, error::Error, process::Command};
fn main() -> Result<(), Box<dyn Error>> {
let mut args = env::args().skip(1);
let cmd = args.next();
match cmd.as_deref() {
Some("watch") => watch(args)?,
_ => print_help(),
};
Ok(())
}
fn print_help() {
eprintln!(
"Tasks:... | rust | Apache-2.0 | ceb221d09a1cbb1e8104fe6fcb5fcf8a904f1cc9 | 2026-01-04T20:20:24.329730Z | false |
davidpdrsn/extend | https://github.com/davidpdrsn/extend/blob/954456f54d5e9e89233d58d0b630ca0361a3fc5a/src/lib.rs | src/lib.rs | //! Create extensions for types you don't own with [extension traits] but without the boilerplate.
//!
//! Example:
//!
//! ```rust
//! use extend::ext;
//!
//! #[ext]
//! impl<T: Ord> Vec<T> {
//! fn sorted(mut self) -> Self {
//! self.sort();
//! self
//! }
//! }
//!
//! assert_eq!(
//! ve... | rust | MIT | 954456f54d5e9e89233d58d0b630ca0361a3fc5a | 2026-01-04T20:20:27.405623Z | false |
davidpdrsn/extend | https://github.com/davidpdrsn/extend/blob/954456f54d5e9e89233d58d0b630ca0361a3fc5a/tests/compile_fail/double_vis.rs | tests/compile_fail/double_vis.rs | mod a {
use extend::ext;
#[ext(pub(super))]
pub impl i32 {
fn foo() -> Foo {
Foo
}
}
pub struct Foo;
}
fn main() {}
| rust | MIT | 954456f54d5e9e89233d58d0b630ca0361a3fc5a | 2026-01-04T20:20:27.405623Z | false |
davidpdrsn/extend | https://github.com/davidpdrsn/extend/blob/954456f54d5e9e89233d58d0b630ca0361a3fc5a/tests/compile_fail/supertraits_are_actually_included.rs | tests/compile_fail/supertraits_are_actually_included.rs | use extend::ext;
trait MyTrait {}
#[ext(supertraits = MyTrait)]
impl String {
fn my_len(&self) -> usize {
self.len()
}
}
fn main() {
assert_eq!(String::new().my_len(), 0);
}
| rust | MIT | 954456f54d5e9e89233d58d0b630ca0361a3fc5a | 2026-01-04T20:20:27.405623Z | false |
davidpdrsn/extend | https://github.com/davidpdrsn/extend/blob/954456f54d5e9e89233d58d0b630ca0361a3fc5a/tests/compile_pass/pub_impl.rs | tests/compile_pass/pub_impl.rs | mod a {
use extend::ext;
#[ext]
pub impl i32 {
fn foo() -> Foo { Foo }
}
pub struct Foo;
}
fn main() {
use a::i32Ext;
i32::foo();
}
| rust | MIT | 954456f54d5e9e89233d58d0b630ca0361a3fc5a | 2026-01-04T20:20:27.405623Z | false |
davidpdrsn/extend | https://github.com/davidpdrsn/extend/blob/954456f54d5e9e89233d58d0b630ca0361a3fc5a/tests/compile_pass/complex_trait_name.rs | tests/compile_pass/complex_trait_name.rs | mod foo {
use extend::ext;
#[ext(pub)]
impl<T1, T2, T3> (T1, T2, T3) {
fn size(&self) -> usize {
3
}
}
}
fn main() {
use foo::TupleOfT1T2T3Ext;
assert_eq!(3, (0, 0, 0).size());
}
| rust | MIT | 954456f54d5e9e89233d58d0b630ca0361a3fc5a | 2026-01-04T20:20:27.405623Z | false |
davidpdrsn/extend | https://github.com/davidpdrsn/extend/blob/954456f54d5e9e89233d58d0b630ca0361a3fc5a/tests/compile_pass/destructure.rs | tests/compile_pass/destructure.rs | #![allow(warnings)]
use extend::ext;
#[ext]
impl i32 {
fn foo(self, (a, b): (i32, i32)) {}
fn bar(self, [a, b]: [i32; 2]) {}
}
fn main() {}
| rust | MIT | 954456f54d5e9e89233d58d0b630ca0361a3fc5a | 2026-01-04T20:20:27.405623Z | false |
davidpdrsn/extend | https://github.com/davidpdrsn/extend/blob/954456f54d5e9e89233d58d0b630ca0361a3fc5a/tests/compile_pass/ref_and_ref_mut.rs | tests/compile_pass/ref_and_ref_mut.rs | use extend::ext;
#[ext]
impl &i32 {
fn foo() {}
}
#[ext]
impl &mut i32 {
fn bar() {}
}
fn main() {}
| rust | MIT | 954456f54d5e9e89233d58d0b630ca0361a3fc5a | 2026-01-04T20:20:27.405623Z | false |
davidpdrsn/extend | https://github.com/davidpdrsn/extend/blob/954456f54d5e9e89233d58d0b630ca0361a3fc5a/tests/compile_pass/double_ext_on_same_type.rs | tests/compile_pass/double_ext_on_same_type.rs | use extend::ext;
#[ext]
impl Option<usize> {
fn foo() -> usize {
1
}
}
#[ext]
impl Option<i32> {
fn bar() -> i32 {
1
}
}
fn main() {}
| rust | MIT | 954456f54d5e9e89233d58d0b630ca0361a3fc5a | 2026-01-04T20:20:27.405623Z | false |
davidpdrsn/extend | https://github.com/davidpdrsn/extend/blob/954456f54d5e9e89233d58d0b630ca0361a3fc5a/tests/compile_pass/issue_2.rs | tests/compile_pass/issue_2.rs | #![allow(unused_variables)]
use extend::ext;
use std::iter::FromIterator;
#[ext]
impl<T, K, F, C> C
where
C: IntoIterator<Item = T>,
K: Eq,
F: Fn(&T) -> K,
{
fn group_by<Out>(self, f: F) -> Out
where
Out: FromIterator<(K, Vec<T>)>,
{
todo!()
}
fn group_by_and_map_value... | rust | MIT | 954456f54d5e9e89233d58d0b630ca0361a3fc5a | 2026-01-04T20:20:27.405623Z | false |
davidpdrsn/extend | https://github.com/davidpdrsn/extend/blob/954456f54d5e9e89233d58d0b630ca0361a3fc5a/tests/compile_pass/super_trait.rs | tests/compile_pass/super_trait.rs | use extend::ext;
trait MyTrait {}
impl MyTrait for String {}
#[ext(supertraits = Default + Clone + MyTrait)]
impl String {
fn my_len(&self) -> usize {
self.len()
}
}
fn main() {
assert_eq!(String::new().my_len(), 0);
}
| rust | MIT | 954456f54d5e9e89233d58d0b630ca0361a3fc5a | 2026-01-04T20:20:27.405623Z | false |
davidpdrsn/extend | https://github.com/davidpdrsn/extend/blob/954456f54d5e9e89233d58d0b630ca0361a3fc5a/tests/compile_pass/changing_extension_trait_name.rs | tests/compile_pass/changing_extension_trait_name.rs | use extend::ext;
#[ext(name = Foo)]
impl i32 {
fn foo() {}
}
fn main() {
<i32 as Foo>::foo();
}
| rust | MIT | 954456f54d5e9e89233d58d0b630ca0361a3fc5a | 2026-01-04T20:20:27.405623Z | false |
davidpdrsn/extend | https://github.com/davidpdrsn/extend/blob/954456f54d5e9e89233d58d0b630ca0361a3fc5a/tests/compile_pass/hello_world.rs | tests/compile_pass/hello_world.rs | use extend::ext;
#[ext]
impl i32 {
fn add_one(&self) -> Self {
self + 1
}
fn foo() -> MyType {
MyType
}
}
#[derive(Debug, Eq, PartialEq)]
struct MyType;
fn main() {
assert_eq!(i32::foo(), MyType);
assert_eq!(1.add_one(), 2);
}
| rust | MIT | 954456f54d5e9e89233d58d0b630ca0361a3fc5a | 2026-01-04T20:20:27.405623Z | false |
davidpdrsn/extend | https://github.com/davidpdrsn/extend/blob/954456f54d5e9e89233d58d0b630ca0361a3fc5a/tests/compile_pass/multiple_config.rs | tests/compile_pass/multiple_config.rs | use extend::ext;
#[ext(pub(crate), name = Foo)]
impl i32 {
fn foo() {}
}
#[ext(pub, name = Bar)]
impl i64 {
fn foo() {}
}
fn main() {}
| rust | MIT | 954456f54d5e9e89233d58d0b630ca0361a3fc5a | 2026-01-04T20:20:27.405623Z | false |
davidpdrsn/extend | https://github.com/davidpdrsn/extend/blob/954456f54d5e9e89233d58d0b630ca0361a3fc5a/tests/compile_pass/more_than_one_extension.rs | tests/compile_pass/more_than_one_extension.rs | use extend::ext;
#[ext]
impl i32 {
fn foo() {}
}
#[ext]
impl i64 {
fn bar() {}
}
fn main() {}
| rust | MIT | 954456f54d5e9e89233d58d0b630ca0361a3fc5a | 2026-01-04T20:20:27.405623Z | false |
davidpdrsn/extend | https://github.com/davidpdrsn/extend/blob/954456f54d5e9e89233d58d0b630ca0361a3fc5a/tests/compile_pass/multiple_generic_params.rs | tests/compile_pass/multiple_generic_params.rs | use extend::ext;
use std::marker::PhantomData;
struct Foo<T>(PhantomData<T>);
#[ext]
impl<T, K> T {
fn some_method(&self, _: Foo<K>) {}
}
fn main() {}
| rust | MIT | 954456f54d5e9e89233d58d0b630ca0361a3fc5a | 2026-01-04T20:20:27.405623Z | false |
davidpdrsn/extend | https://github.com/davidpdrsn/extend/blob/954456f54d5e9e89233d58d0b630ca0361a3fc5a/tests/compile_pass/associated_constants.rs | tests/compile_pass/associated_constants.rs | use extend::ext;
#[ext]
impl Option<String> {
const FOO: usize = 1;
}
fn main() {
assert_eq!(Option::<String>::FOO, 1);
}
| rust | MIT | 954456f54d5e9e89233d58d0b630ca0361a3fc5a | 2026-01-04T20:20:27.405623Z | false |
davidpdrsn/extend | https://github.com/davidpdrsn/extend/blob/954456f54d5e9e89233d58d0b630ca0361a3fc5a/tests/compile_pass/generics.rs | tests/compile_pass/generics.rs | use extend::ext;
#[ext]
impl<'a, T: Clone> Vec<&'a T>
where
T: 'a + Copy,
{
fn size(&self) -> usize {
self.len()
}
}
fn main() {
assert_eq!(3, vec![&1, &2, &3].size());
}
| rust | MIT | 954456f54d5e9e89233d58d0b630ca0361a3fc5a | 2026-01-04T20:20:27.405623Z | false |
davidpdrsn/extend | https://github.com/davidpdrsn/extend/blob/954456f54d5e9e89233d58d0b630ca0361a3fc5a/tests/compile_pass/async_trait.rs | tests/compile_pass/async_trait.rs | use extend::ext;
use async_trait::async_trait;
#[ext]
#[async_trait]
impl String {
async fn foo() -> usize {
1
}
}
#[ext]
#[async_trait]
pub impl i32 {
async fn bar() -> usize {
1
}
}
async fn foo() {
let _: usize = String::foo().await;
let _: usize = i32::bar().await;
}
fn m... | rust | MIT | 954456f54d5e9e89233d58d0b630ca0361a3fc5a | 2026-01-04T20:20:27.405623Z | false |
davidpdrsn/extend | https://github.com/davidpdrsn/extend/blob/954456f54d5e9e89233d58d0b630ca0361a3fc5a/tests/compile_pass/extension_on_complex_types.rs | tests/compile_pass/extension_on_complex_types.rs | #![allow(warnings)]
use extend::ext;
#[ext]
impl<'a> &'a str {
fn foo(self) {}
}
#[ext]
impl<T> [T; 3] {
fn foo(self) {}
}
#[ext]
impl *const i32 {
fn foo(self) {}
}
#[ext]
impl<T> [T] {
fn foo(&self) {}
}
#[ext]
impl<'a, T> &'a [T] {
fn foo(self) {}
}
#[ext]
impl (i32, i64) {
fn foo(self... | rust | MIT | 954456f54d5e9e89233d58d0b630ca0361a3fc5a | 2026-01-04T20:20:27.405623Z | false |
davidpdrsn/extend | https://github.com/davidpdrsn/extend/blob/954456f54d5e9e89233d58d0b630ca0361a3fc5a/tests/compile_pass/visibility_config.rs | tests/compile_pass/visibility_config.rs | mod a {
use extend::ext;
#[ext(pub)]
impl i32 {
fn foo() -> Foo { Foo }
}
pub struct Foo;
}
fn main() {
use a::i32Ext;
i32::foo();
}
| rust | MIT | 954456f54d5e9e89233d58d0b630ca0361a3fc5a | 2026-01-04T20:20:27.405623Z | false |
davidpdrsn/extend | https://github.com/davidpdrsn/extend/blob/954456f54d5e9e89233d58d0b630ca0361a3fc5a/tests/compile_pass/sized.rs | tests/compile_pass/sized.rs | use extend::ext_sized;
#[ext_sized(name = One)]
impl i32 {
fn requires_sized(self) -> Option<Self> {
Some(self)
}
}
#[ext_sized(name = Two, supertraits = Default)]
impl i32 {
fn with_another_supertrait(self) -> Option<Self> {
Some(self)
}
}
#[ext_sized(name = Three, supertraits = Defa... | rust | MIT | 954456f54d5e9e89233d58d0b630ca0361a3fc5a | 2026-01-04T20:20:27.405623Z | false |
sdleffler/collapse | https://github.com/sdleffler/collapse/blob/075f5449bc20ff4ecff9740c90e542f691a8c7f5/src/lib.rs | src/lib.rs | #[macro_use]
extern crate bitflags;
extern crate bit_set;
extern crate bit_vec;
extern crate image;
#[macro_use]
extern crate log;
#[macro_use]
extern crate ndarray;
extern crate pbr;
extern crate vosealias;
extern crate rand;
mod source;
mod wave;
pub use source::*;
pub use wave::Wave;
| rust | MIT | 075f5449bc20ff4ecff9740c90e542f691a8c7f5 | 2026-01-04T20:20:25.435457Z | false |
sdleffler/collapse | https://github.com/sdleffler/collapse/blob/075f5449bc20ff4ecff9740c90e542f691a8c7f5/src/wave.rs | src/wave.rs | use std::cell::RefCell;
use std::collections::HashSet;
use std::fmt;
use std::hash::Hash;
use std::io;
use bit_set::BitSet;
use ndarray::prelude::*;
use ndarray::NdIndex;
use rand::Rng;
use rand::StdRng;
use source::{Source, OverlappingSource2};
#[derive(Clone)]
pub struct State<P> {
pub pos: P,
pub entro... | rust | MIT | 075f5449bc20ff4ecff9740c90e542f691a8c7f5 | 2026-01-04T20:20:25.435457Z | false |
sdleffler/collapse | https://github.com/sdleffler/collapse/blob/075f5449bc20ff4ecff9740c90e542f691a8c7f5/src/main.rs | src/main.rs | #[macro_use]
extern crate clap;
extern crate collapse;
extern crate image;
#[macro_use]
extern crate lazy_static;
extern crate pbr;
extern crate regex;
use std::str::FromStr;
use image::{GenericImageView, ImageBuffer};
use clap::{App, AppSettings, Arg, ArgGroup, SubCommand};
use collapse::*;
use pbr::ProgressBar;
u... | rust | MIT | 075f5449bc20ff4ecff9740c90e542f691a8c7f5 | 2026-01-04T20:20:25.435457Z | false |
sdleffler/collapse | https://github.com/sdleffler/collapse/blob/075f5449bc20ff4ecff9740c90e542f691a8c7f5/src/source/source3d.rs | src/source/source3d.rs | use std::cell::RefCell;
use std::collections::{HashMap, HashSet, VecDeque};
use std::hash::Hash;
use std::ops::{Neg, Sub};
use std::vec::Vec;
use bit_set::BitSet;
use bit_vec::BitVec;
use image::{GenericImage, Pixel};
use ndarray::prelude::*;
use ndarray::{Array3, ArrayView3, Ix3};
use vosealias::AliasTable;
use ... | rust | MIT | 075f5449bc20ff4ecff9740c90e542f691a8c7f5 | 2026-01-04T20:20:25.435457Z | false |
sdleffler/collapse | https://github.com/sdleffler/collapse/blob/075f5449bc20ff4ecff9740c90e542f691a8c7f5/src/source/mod.rs | src/source/mod.rs | use std::cell::RefCell;
use bit_set::BitSet;
use ndarray::prelude::*;
use rand::Rng;
use wave::State;
mod source2d;
mod source3d;
pub use self::source2d::OverlappingSource2;
pub use self::source2d::symmetry::*;
pub trait Source {
type Dims;
type Periodicity;
type Pixel;
fn wave_dims(&self, Se... | rust | MIT | 075f5449bc20ff4ecff9740c90e542f691a8c7f5 | 2026-01-04T20:20:25.435457Z | false |
sdleffler/collapse | https://github.com/sdleffler/collapse/blob/075f5449bc20ff4ecff9740c90e542f691a8c7f5/src/source/source2d.rs | src/source/source2d.rs | use std::cell::RefCell;
use std::collections::{HashMap, HashSet, VecDeque};
use std::hash::Hash;
use std::ops::{Neg, Sub};
use std::vec::Vec;
use bit_set::BitSet;
use bit_vec::BitVec;
use image::{GenericImage, ImageBuffer, Pixel};
use image::imageops::{flip_horizontal, flip_vertical, rotate90, rotate180, rotate270};... | rust | MIT | 075f5449bc20ff4ecff9740c90e542f691a8c7f5 | 2026-01-04T20:20:25.435457Z | false |
Blockdaemon/solana-accountsdb-plugin-kafka | https://github.com/Blockdaemon/solana-accountsdb-plugin-kafka/blob/c96300ace4d1c5c2b1e2feb3f5583cca16906984/build.rs | build.rs | use cargo_lock::Lockfile;
use vergen::{BuildBuilder, Emitter, RustcBuilder};
fn main() -> anyhow::Result<()> {
// Proto
let mut config = prost_build::Config::new();
let proto_file = "proto/event.proto";
println!("cargo:rerun-if-changed={}", proto_file);
config.boxed(".blockdaemon.solana.accountsd... | rust | Apache-2.0 | c96300ace4d1c5c2b1e2feb3f5583cca16906984 | 2026-01-04T20:20:13.613825Z | false |
Blockdaemon/solana-accountsdb-plugin-kafka | https://github.com/Blockdaemon/solana-accountsdb-plugin-kafka/blob/c96300ace4d1c5c2b1e2feb3f5583cca16906984/src/prom.rs | src/prom.rs | use {
crate::version::VERSION as VERSION_INFO,
bytes::Bytes,
http::StatusCode,
http_body_util::Full,
hyper::{Request, Response, body::Incoming, service::service_fn},
hyper_util::rt::TokioIo,
log::*,
prometheus::{GaugeVec, IntCounterVec, Opts, Registry, TextEncoder},
rdkafka::{
... | rust | Apache-2.0 | c96300ace4d1c5c2b1e2feb3f5583cca16906984 | 2026-01-04T20:20:13.613825Z | false |
Blockdaemon/solana-accountsdb-plugin-kafka | https://github.com/Blockdaemon/solana-accountsdb-plugin-kafka/blob/c96300ace4d1c5c2b1e2feb3f5583cca16906984/src/config.rs | src/config.rs | // Copyright 2022 Blockdaemon Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed t... | rust | Apache-2.0 | c96300ace4d1c5c2b1e2feb3f5583cca16906984 | 2026-01-04T20:20:13.613825Z | false |
Blockdaemon/solana-accountsdb-plugin-kafka | https://github.com/Blockdaemon/solana-accountsdb-plugin-kafka/blob/c96300ace4d1c5c2b1e2feb3f5583cca16906984/src/event.rs | src/event.rs | // Copyright 2022 Blockdaemon Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed t... | rust | Apache-2.0 | c96300ace4d1c5c2b1e2feb3f5583cca16906984 | 2026-01-04T20:20:13.613825Z | false |
Blockdaemon/solana-accountsdb-plugin-kafka | https://github.com/Blockdaemon/solana-accountsdb-plugin-kafka/blob/c96300ace4d1c5c2b1e2feb3f5583cca16906984/src/lib.rs | src/lib.rs | // Copyright 2022 Blockdaemon Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed t... | rust | Apache-2.0 | c96300ace4d1c5c2b1e2feb3f5583cca16906984 | 2026-01-04T20:20:13.613825Z | false |
Blockdaemon/solana-accountsdb-plugin-kafka | https://github.com/Blockdaemon/solana-accountsdb-plugin-kafka/blob/c96300ace4d1c5c2b1e2feb3f5583cca16906984/src/version.rs | src/version.rs | use {serde::Serialize, std::env};
#[derive(Debug, Serialize)]
pub struct Version {
pub version: &'static str,
pub solana: &'static str,
pub git: &'static str,
pub rustc: &'static str,
pub buildts: &'static str,
}
pub const VERSION: Version = Version {
version: env!("CARGO_PKG_VERSION"),
so... | rust | Apache-2.0 | c96300ace4d1c5c2b1e2feb3f5583cca16906984 | 2026-01-04T20:20:13.613825Z | false |
Blockdaemon/solana-accountsdb-plugin-kafka | https://github.com/Blockdaemon/solana-accountsdb-plugin-kafka/blob/c96300ace4d1c5c2b1e2feb3f5583cca16906984/src/filter.rs | src/filter.rs | // Copyright 2022 Blockdaemon Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed t... | rust | Apache-2.0 | c96300ace4d1c5c2b1e2feb3f5583cca16906984 | 2026-01-04T20:20:13.613825Z | false |
Blockdaemon/solana-accountsdb-plugin-kafka | https://github.com/Blockdaemon/solana-accountsdb-plugin-kafka/blob/c96300ace4d1c5c2b1e2feb3f5583cca16906984/src/publisher.rs | src/publisher.rs | // Copyright 2022 Blockdaemon Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed t... | rust | Apache-2.0 | c96300ace4d1c5c2b1e2feb3f5583cca16906984 | 2026-01-04T20:20:13.613825Z | false |
Blockdaemon/solana-accountsdb-plugin-kafka | https://github.com/Blockdaemon/solana-accountsdb-plugin-kafka/blob/c96300ace4d1c5c2b1e2feb3f5583cca16906984/src/plugin.rs | src/plugin.rs | // Copyright 2022 Blockdaemon Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed t... | rust | Apache-2.0 | c96300ace4d1c5c2b1e2feb3f5583cca16906984 | 2026-01-04T20:20:13.613825Z | true |
as-com/varint-simd | https://github.com/as-com/varint-simd/blob/0952d92bd547da51d189b9b34ee88ff4474db8b6/build.rs | build.rs | #[cfg(target_arch = "x86")]
use std::arch::x86::__cpuid;
use rustc_version::Channel;
#[cfg(target_arch = "x86_64")]
use std::arch::x86_64::__cpuid;
/// Performance of PDEP/PEXT relative to arithmetic/bit operations
#[derive(PartialOrd, PartialEq)]
enum PdepPerf {
VeryFast = 20,
Fast = 10,
Slow = 0,
}
#[c... | rust | Apache-2.0 | 0952d92bd547da51d189b9b34ee88ff4474db8b6 | 2026-01-04T20:20:30.197063Z | false |
as-com/varint-simd | https://github.com/as-com/varint-simd/blob/0952d92bd547da51d189b9b34ee88ff4474db8b6/src/lib.rs | src/lib.rs | /*!
`varint_simd` is a fast SIMD-accelerated [variable-length integer](https://developers.google.com/protocol-buffers/docs/encoding)
encoder and decoder written in Rust.
**For more information, please see the [README](https://github.com/as-com/varint-simd#readme).**
*/
#![cfg_attr(not(feature = "std"), no_std)]
#![cf... | rust | Apache-2.0 | 0952d92bd547da51d189b9b34ee88ff4474db8b6 | 2026-01-04T20:20:30.197063Z | false |
as-com/varint-simd | https://github.com/as-com/varint-simd/blob/0952d92bd547da51d189b9b34ee88ff4474db8b6/src/num.rs | src/num.rs | #[cfg(target_arch = "x86")]
use core::arch::x86::*;
#[cfg(target_arch = "x86_64")]
use core::arch::x86_64::*;
use core::fmt::Debug;
/// Represents an unsigned scalar value that can be encoded to and decoded from a varint.
pub trait VarIntTarget: Debug + Eq + PartialEq + PartialOrd + Sized + Copy {
/// The signed ... | rust | Apache-2.0 | 0952d92bd547da51d189b9b34ee88ff4474db8b6 | 2026-01-04T20:20:30.197063Z | false |
as-com/varint-simd | https://github.com/as-com/varint-simd/blob/0952d92bd547da51d189b9b34ee88ff4474db8b6/src/decode/lookup.rs | src/decode/lookup.rs | #[cfg(target_arch = "x86")]
use core::arch::x86::*;
#[cfg(target_arch = "x86_64")]
use core::arch::x86_64::*;
#[repr(align(16), C)]
struct Align128<T>(T);
pub static LOOKUP_DOUBLE_VEC: [__m128i; 90] = unsafe {
core::mem::transmute(Align128::<[u8; 1440]>([
0, 255, 255, 255, 255, 255, 255, 255, 1, 255, 255,... | rust | Apache-2.0 | 0952d92bd547da51d189b9b34ee88ff4474db8b6 | 2026-01-04T20:20:30.197063Z | true |
as-com/varint-simd | https://github.com/as-com/varint-simd/blob/0952d92bd547da51d189b9b34ee88ff4474db8b6/src/decode/mod.rs | src/decode/mod.rs | #[cfg(target_arch = "x86")]
use core::arch::x86::*;
#[cfg(target_arch = "x86_64")]
use core::arch::x86_64::*;
use core::cmp::min;
use crate::num::{SignedVarIntTarget, VarIntTarget};
use crate::VarIntDecodeError;
mod lookup;
/// Decodes a single varint from the input slice.
///
/// Produces a tuple containing the dec... | rust | Apache-2.0 | 0952d92bd547da51d189b9b34ee88ff4474db8b6 | 2026-01-04T20:20:30.197063Z | true |
as-com/varint-simd | https://github.com/as-com/varint-simd/blob/0952d92bd547da51d189b9b34ee88ff4474db8b6/src/encode/mod.rs | src/encode/mod.rs | #[cfg(target_arch = "x86")]
use core::arch::x86::*;
#[cfg(target_arch = "x86_64")]
use core::arch::x86_64::*;
use crate::num::{SignedVarIntTarget, VarIntTarget};
/// Encodes a single number to a varint. Requires SSE2 support.
///
/// Produces a tuple, with the encoded data followed by the number of bytes used to enco... | rust | Apache-2.0 | 0952d92bd547da51d189b9b34ee88ff4474db8b6 | 2026-01-04T20:20:30.197063Z | false |
as-com/varint-simd | https://github.com/as-com/varint-simd/blob/0952d92bd547da51d189b9b34ee88ff4474db8b6/fuzz/fuzz_targets/fuzz_target_1.rs | fuzz/fuzz_targets/fuzz_target_1.rs | #![no_main]
use libfuzzer_sys::fuzz_target;
use integer_encoding::VarInt;
fuzz_target!(|data: [u8; 16]| {
let reference = u64::decode_var(&data);
let simd = unsafe { varint_simd::decode_unsafe(data.as_ptr()) };
if let Some(reference) = reference {
assert_eq!(reference.0, simd.0);
assert_... | rust | Apache-2.0 | 0952d92bd547da51d189b9b34ee88ff4474db8b6 | 2026-01-04T20:20:30.197063Z | false |
as-com/varint-simd | https://github.com/as-com/varint-simd/blob/0952d92bd547da51d189b9b34ee88ff4474db8b6/fuzz/fuzz_targets/fuzz_target_2.rs | fuzz/fuzz_targets/fuzz_target_2.rs | #![no_main]
use libfuzzer_sys::fuzz_target;
use integer_encoding::VarInt;
fuzz_target!(|data: u64| {
let mut reference_out = [0u8; 16];
let reference_size = u64::encode_var(data, &mut reference_out);
let (simd_out, simd_size) = unsafe { varint_simd::encode_unsafe(data) };
assert_eq!(reference_size, ... | rust | Apache-2.0 | 0952d92bd547da51d189b9b34ee88ff4474db8b6 | 2026-01-04T20:20:30.197063Z | false |
as-com/varint-simd | https://github.com/as-com/varint-simd/blob/0952d92bd547da51d189b9b34ee88ff4474db8b6/fuzz/fuzz_targets/fuzz_target_3.rs | fuzz/fuzz_targets/fuzz_target_3.rs | #![no_main]
use libfuzzer_sys::fuzz_target;
use integer_encoding::VarInt;
fuzz_target!(|data: [u8; 16]| {
let reference = u64::decode_var(&data);
let len = unsafe { varint_simd::decode_len_unsafe::<u64>(data.as_ptr()) };
if let Some(reference) = reference {
assert_eq!(reference.1, len);
}
})... | rust | Apache-2.0 | 0952d92bd547da51d189b9b34ee88ff4474db8b6 | 2026-01-04T20:20:30.197063Z | false |
as-com/varint-simd | https://github.com/as-com/varint-simd/blob/0952d92bd547da51d189b9b34ee88ff4474db8b6/benches/varint_bench/prost_varint.rs | benches/varint_bench/prost_varint.rs | use bytes::{Buf, BufMut};
use std::cmp::min;
/// Encodes an integer value into LEB128 variable length format, and writes it to the buffer.
/// The buffer must have enough remaining space (maximum 10 bytes).
#[inline]
pub fn encode_varint<B>(mut value: u64, buf: &mut B)
where
B: BufMut,
{
loop {
if valu... | rust | Apache-2.0 | 0952d92bd547da51d189b9b34ee88ff4474db8b6 | 2026-01-04T20:20:30.197063Z | false |
as-com/varint-simd | https://github.com/as-com/varint-simd/blob/0952d92bd547da51d189b9b34ee88ff4474db8b6/benches/varint_bench/main.rs | benches/varint_bench/main.rs | use criterion::{criterion_group, criterion_main, BatchSize, Criterion, Throughput};
use integer_encoding::VarInt;
use rand::distributions::{Distribution, Standard};
use rand::{thread_rng, Rng};
use varint_simd::{
decode,
decode_eight_u8_unsafe,
decode_four_unsafe,
decode_len,
decode_len_unsafe,
... | rust | Apache-2.0 | 0952d92bd547da51d189b9b34ee88ff4474db8b6 | 2026-01-04T20:20:30.197063Z | false |
as-com/varint-simd | https://github.com/as-com/varint-simd/blob/0952d92bd547da51d189b9b34ee88ff4474db8b6/benches/varint_bench/leb128.rs | benches/varint_bench/leb128.rs | // leb128.rs from rustc
#![allow(dead_code)]
macro_rules! impl_write_unsigned_leb128 {
($fn_name:ident, $int_ty:ident) => {
#[inline]
pub fn $fn_name(out: &mut Vec<u8>, mut value: $int_ty) {
loop {
if value < 0x80 {
out.push(value as u8);
... | rust | Apache-2.0 | 0952d92bd547da51d189b9b34ee88ff4474db8b6 | 2026-01-04T20:20:30.197063Z | false |
tmtbe/netpurr | https://github.com/tmtbe/netpurr/blob/922e0e29e2a4685249fafe7eba87bb4fffe7d72e/crates/netpurr/src/app.rs | crates/netpurr/src/app.rs | use std::time::{SystemTime, UNIX_EPOCH};
use egui::{Context, Event, Frame, Margin, Visuals};
use log::info;
use poll_promise::Promise;
use netpurr_core::data::workspace_data::WorkspaceData;
use crate::data::config_data::ConfigData;
use crate::operation::operation::Operation;
use crate::panels::bottom_panel::BottomPa... | rust | Apache-2.0 | 922e0e29e2a4685249fafe7eba87bb4fffe7d72e | 2026-01-04T20:20:05.778379Z | false |
tmtbe/netpurr | https://github.com/tmtbe/netpurr/blob/922e0e29e2a4685249fafe7eba87bb4fffe7d72e/crates/netpurr/src/lib.rs | crates/netpurr/src/lib.rs | #![warn(clippy::all, rust_2018_idioms)]
use std::string::ToString;
pub use app::App;
pub const APP_NAME: &str = "Netpurr";
mod app;
mod data;
mod import;
mod operation;
mod panels;
mod utils;
mod widgets;
mod windows;
| rust | Apache-2.0 | 922e0e29e2a4685249fafe7eba87bb4fffe7d72e | 2026-01-04T20:20:05.778379Z | false |
tmtbe/netpurr | https://github.com/tmtbe/netpurr/blob/922e0e29e2a4685249fafe7eba87bb4fffe7d72e/crates/netpurr/src/main.rs | crates/netpurr/src/main.rs | #![warn(clippy::all, rust_2018_idioms)]
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] // hide console window on Windows in release
use std::sync::Arc;
use chrono::{Datelike, Local, Timelike};
use eframe::icon_data::from_png_bytes;
use log4rs::append::console::ConsoleAppender;
use log4rs::append::... | rust | Apache-2.0 | 922e0e29e2a4685249fafe7eba87bb4fffe7d72e | 2026-01-04T20:20:05.778379Z | false |
tmtbe/netpurr | https://github.com/tmtbe/netpurr/blob/922e0e29e2a4685249fafe7eba87bb4fffe7d72e/crates/netpurr/src/operation/git.rs | crates/netpurr/src/operation/git.rs | use std::fs::File;
use std::io::Write;
use std::path::PathBuf;
use std::str::FromStr;
use futures_util::AsyncWriteExt;
use log::error;
use poll_promise::Promise;
use rustygit::Repository;
use rustygit::types::BranchName;
#[derive(Default, Clone)]
pub struct Git {}
impl Git {
pub fn if_enable_git(&self, repo_path... | rust | Apache-2.0 | 922e0e29e2a4685249fafe7eba87bb4fffe7d72e | 2026-01-04T20:20:05.778379Z | false |
tmtbe/netpurr | https://github.com/tmtbe/netpurr/blob/922e0e29e2a4685249fafe7eba87bb4fffe7d72e/crates/netpurr/src/operation/windows.rs | crates/netpurr/src/operation/windows.rs | use std::cell::RefCell;
use std::rc::Rc;
use egui::{Context, Ui};
use netpurr_core::data::collections::{Collection, CollectionFolder};
use netpurr_core::data::http::HttpRecord;
use netpurr_core::data::workspace_data::WorkspaceData;
use crate::data::config_data::ConfigData;
use crate::operation::operation::Operation;... | rust | Apache-2.0 | 922e0e29e2a4685249fafe7eba87bb4fffe7d72e | 2026-01-04T20:20:05.778379Z | false |
tmtbe/netpurr | https://github.com/tmtbe/netpurr/blob/922e0e29e2a4685249fafe7eba87bb4fffe7d72e/crates/netpurr/src/operation/mod.rs | crates/netpurr/src/operation/mod.rs | use std::str::FromStr;
use crate::operation::windows::Window;
mod git;
pub mod operation;
pub mod windows;
| rust | Apache-2.0 | 922e0e29e2a4685249fafe7eba87bb4fffe7d72e | 2026-01-04T20:20:05.778379Z | false |
tmtbe/netpurr | https://github.com/tmtbe/netpurr/blob/922e0e29e2a4685249fafe7eba87bb4fffe7d72e/crates/netpurr/src/operation/operation.rs | crates/netpurr/src/operation/operation.rs | use std::cell::RefCell;
use std::collections::{BTreeMap, HashMap};
use std::rc::Rc;
use std::sync::{Arc, RwLock};
use egui::{emath, WidgetText};
use poll_promise::Promise;
use egui_toast::{Toast, ToastKind, ToastOptions, Toasts};
use netpurr_core::data::collections::{CollectionFolder, Testcase};
use netpurr_core::dat... | rust | Apache-2.0 | 922e0e29e2a4685249fafe7eba87bb4fffe7d72e | 2026-01-04T20:20:05.778379Z | false |
tmtbe/netpurr | https://github.com/tmtbe/netpurr/blob/922e0e29e2a4685249fafe7eba87bb4fffe7d72e/crates/netpurr/src/utils/openapi_help.rs | crates/netpurr/src/utils/openapi_help.rs | use openapiv3::{
Header, OpenAPI, Operation, Parameter, ReferenceOr, RequestBody, Response, Schema, SchemaKind,
Type,
};
use serde_json::{json, Value};
pub struct OpenApiHelp {
pub openapi: OpenAPI,
}
pub trait GetItem<R> {
fn get_item(&self, openapi: &OpenAPI) -> Option<R>;
}
impl GetItem<Schema> for ... | rust | Apache-2.0 | 922e0e29e2a4685249fafe7eba87bb4fffe7d72e | 2026-01-04T20:20:05.778379Z | false |
tmtbe/netpurr | https://github.com/tmtbe/netpurr/blob/922e0e29e2a4685249fafe7eba87bb4fffe7d72e/crates/netpurr/src/utils/mod.rs | crates/netpurr/src/utils/mod.rs | use std::cmp::min;
use std::collections::HashSet;
use chrono::format;
use eframe::emath::{Align, Pos2};
use eframe::epaint::text::LayoutJob;
use egui::{
Area, CollapsingHeader, CollapsingResponse, Color32, FontSelection, Frame, Id, InnerResponse,
Key, Layout, Order, Response, RichText, Style, TextBuffer, Ui, W... | rust | Apache-2.0 | 922e0e29e2a4685249fafe7eba87bb4fffe7d72e | 2026-01-04T20:20:05.778379Z | false |
tmtbe/netpurr | https://github.com/tmtbe/netpurr/blob/922e0e29e2a4685249fafe7eba87bb4fffe7d72e/crates/netpurr/src/widgets/matrix_label.rs | crates/netpurr/src/widgets/matrix_label.rs | use std::fs::File;
use std::io::Write;
use egui::{Direction, Label, Layout, RichText, Sense, Ui, Vec2, Widget};
use netpurr_core::data::workspace_data::WorkspaceData;
use crate::data::config_data::ConfigData;
use crate::data::export::{Export, ExportType};
use crate::operation::operation::Operation;
use crate::panels... | rust | Apache-2.0 | 922e0e29e2a4685249fafe7eba87bb4fffe7d72e | 2026-01-04T20:20:05.778379Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.