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 |
|---|---|---|---|---|---|---|---|---|
GothenburgBitFactory/taskchampion | https://github.com/GothenburgBitFactory/taskchampion/blob/45f5345daff60aba526db9e54dc03c8e0da37f14/src/task/task.rs | src/task/task.rs | use super::tag::{SyntheticTag, TagInner};
use super::{utc_timestamp, Annotation, Status, Tag, Timestamp};
use crate::depmap::DependencyMap;
use crate::errors::{Error, Result};
use crate::storage::TaskMap;
use crate::{Operations, TaskData};
use chrono::prelude::*;
use log::trace;
use std::convert::AsRef;
use std::conver... | rust | MIT | 45f5345daff60aba526db9e54dc03c8e0da37f14 | 2026-01-04T20:19:44.628446Z | true |
GothenburgBitFactory/taskchampion | https://github.com/GothenburgBitFactory/taskchampion/blob/45f5345daff60aba526db9e54dc03c8e0da37f14/src/task/data.rs | src/task/data.rs | use crate::{storage::TaskMap, Operation, Operations};
use chrono::Utc;
use uuid::Uuid;
/// A task.
///
/// This type presents a low-level interface consisting only of a key/value map. Interpretation of
/// fields is up to the user, and modifications both modify the [`TaskData`] and create one or
/// more [`Operation`]... | rust | MIT | 45f5345daff60aba526db9e54dc03c8e0da37f14 | 2026-01-04T20:19:44.628446Z | false |
GothenburgBitFactory/taskchampion | https://github.com/GothenburgBitFactory/taskchampion/blob/45f5345daff60aba526db9e54dc03c8e0da37f14/src/task/tag.rs | src/task/tag.rs | use std::convert::TryFrom;
use std::fmt;
use std::str::FromStr;
/// A Tag is a descriptor for a task, that is either present or absent, and can be used for
/// filtering. Tags composed of all uppercase letters are reserved for synthetic tags.
///
/// Valid tags must not contain whitespace.
/// The first characters ca... | rust | MIT | 45f5345daff60aba526db9e54dc03c8e0da37f14 | 2026-01-04T20:19:44.628446Z | false |
GothenburgBitFactory/taskchampion | https://github.com/GothenburgBitFactory/taskchampion/blob/45f5345daff60aba526db9e54dc03c8e0da37f14/src/taskdb/sync.rs | src/taskdb/sync.rs | use super::{apply, snapshot};
use crate::errors::Result;
use crate::server::{AddVersionResult, GetVersionResult, Server, SnapshotUrgency, SyncOp};
use crate::storage::StorageTxn;
use crate::Error;
use log::{info, trace, warn};
use serde::{Deserialize, Serialize};
use std::str;
#[derive(Serialize, Deserialize, Debug)]
... | rust | MIT | 45f5345daff60aba526db9e54dc03c8e0da37f14 | 2026-01-04T20:19:44.628446Z | false |
GothenburgBitFactory/taskchampion | https://github.com/GothenburgBitFactory/taskchampion/blob/45f5345daff60aba526db9e54dc03c8e0da37f14/src/taskdb/apply.rs | src/taskdb/apply.rs | use crate::errors::{Error, Result};
use crate::operation::Operation;
use crate::server::SyncOp;
use crate::storage::{StorageTxn, TaskMap};
use crate::Operations;
use std::collections::hash_map::Entry;
use std::collections::HashMap;
use uuid::Uuid;
/// Apply `operations` to the database in the given single transaction.... | rust | MIT | 45f5345daff60aba526db9e54dc03c8e0da37f14 | 2026-01-04T20:19:44.628446Z | false |
GothenburgBitFactory/taskchampion | https://github.com/GothenburgBitFactory/taskchampion/blob/45f5345daff60aba526db9e54dc03c8e0da37f14/src/taskdb/undo.rs | src/taskdb/undo.rs | use super::apply;
use crate::errors::Result;
use crate::operation::{Operation, Operations};
use crate::server::SyncOp;
use crate::storage::StorageTxn;
use chrono::Utc;
use log::{debug, info, trace};
/// Return the operations back to and including the last undo point, or since the last sync if no
/// undo point is foun... | rust | MIT | 45f5345daff60aba526db9e54dc03c8e0da37f14 | 2026-01-04T20:19:44.628446Z | false |
GothenburgBitFactory/taskchampion | https://github.com/GothenburgBitFactory/taskchampion/blob/45f5345daff60aba526db9e54dc03c8e0da37f14/src/taskdb/mod.rs | src/taskdb/mod.rs | use std::collections::HashSet;
use crate::errors::Result;
use crate::operation::Operation;
use crate::server::Server;
use crate::storage::{Storage, TaskMap};
use crate::Operations;
use uuid::Uuid;
mod apply;
mod snapshot;
mod sync;
pub(crate) mod undo;
mod working_set;
/// A TaskDb is the backend for a replica. It ... | rust | MIT | 45f5345daff60aba526db9e54dc03c8e0da37f14 | 2026-01-04T20:19:44.628446Z | false |
GothenburgBitFactory/taskchampion | https://github.com/GothenburgBitFactory/taskchampion/blob/45f5345daff60aba526db9e54dc03c8e0da37f14/src/taskdb/snapshot.rs | src/taskdb/snapshot.rs | use crate::errors::{Error, Result};
use crate::server::VersionId;
use crate::storage::{StorageTxn, TaskMap};
use flate2::{read::ZlibDecoder, write::ZlibEncoder, Compression};
use serde::de::{Deserialize, Deserializer, MapAccess, Visitor};
use serde::ser::{Serialize, SerializeMap, Serializer};
use std::fmt;
use uuid::Uu... | rust | MIT | 45f5345daff60aba526db9e54dc03c8e0da37f14 | 2026-01-04T20:19:44.628446Z | false |
GothenburgBitFactory/taskchampion | https://github.com/GothenburgBitFactory/taskchampion/blob/45f5345daff60aba526db9e54dc03c8e0da37f14/src/taskdb/working_set.rs | src/taskdb/working_set.rs | use crate::errors::Result;
use crate::storage::{StorageTxn, TaskMap};
use std::collections::HashSet;
/// Rebuild the working set using a function to identify tasks that should be in the set. This
/// renumbers the existing working-set tasks to eliminate gaps, and also adds any tasks that
/// are not already in the wo... | rust | MIT | 45f5345daff60aba526db9e54dc03c8e0da37f14 | 2026-01-04T20:19:44.628446Z | false |
GothenburgBitFactory/taskchampion | https://github.com/GothenburgBitFactory/taskchampion/blob/45f5345daff60aba526db9e54dc03c8e0da37f14/tests/update-and-delete-sync.rs | tests/update-and-delete-sync.rs | #![cfg(feature = "server-local")]
use taskchampion::chrono::{TimeZone, Utc};
use taskchampion::storage::inmemory::InMemoryStorage;
use taskchampion::{Operations, Replica, ServerConfig, Status, Uuid};
use tempfile::TempDir;
#[tokio::test]
async fn update_and_delete_sync_delete_first() -> anyhow::Result<()> {
updat... | rust | MIT | 45f5345daff60aba526db9e54dc03c8e0da37f14 | 2026-01-04T20:19:44.628446Z | false |
GothenburgBitFactory/taskchampion | https://github.com/GothenburgBitFactory/taskchampion/blob/45f5345daff60aba526db9e54dc03c8e0da37f14/tests/gcp-tls.rs | tests/gcp-tls.rs | #![cfg(all(feature = "server-gcp", target_os = "linux"))]
use std::{
fs::{metadata, set_permissions, File},
io::Write,
os::unix::fs::PermissionsExt,
};
use taskchampion::ServerConfig;
use tempfile::TempDir;
mod tls_utils;
#[tokio::test]
/// Check that the GCP server implementation correctly uses, or does... | rust | MIT | 45f5345daff60aba526db9e54dc03c8e0da37f14 | 2026-01-04T20:19:44.628446Z | false |
GothenburgBitFactory/taskchampion | https://github.com/GothenburgBitFactory/taskchampion/blob/45f5345daff60aba526db9e54dc03c8e0da37f14/tests/aws-tls.rs | tests/aws-tls.rs | #![cfg(all(feature = "server-aws", target_os = "linux"))]
use taskchampion::{server::AwsCredentials, ServerConfig};
mod tls_utils;
#[tokio::test]
/// Check that the AWS server implementation correctly uses, or does not use,
/// tls-native-roots.
async fn aws_tls() -> anyhow::Result<()> {
tls_utils::reset_seen_ssl... | rust | MIT | 45f5345daff60aba526db9e54dc03c8e0da37f14 | 2026-01-04T20:19:44.628446Z | false |
GothenburgBitFactory/taskchampion | https://github.com/GothenburgBitFactory/taskchampion/blob/45f5345daff60aba526db9e54dc03c8e0da37f14/tests/syncing-proptest.rs | tests/syncing-proptest.rs | #![cfg(all(feature = "server-local", not(target_arch = "wasm32")))]
use pretty_assertions::assert_eq;
use proptest::prelude::*;
use taskchampion::storage::inmemory::InMemoryStorage;
use taskchampion::{Operations, Replica, ServerConfig, TaskData, Uuid};
use tempfile::TempDir;
#[derive(Debug, Clone)]
enum Action {
... | rust | MIT | 45f5345daff60aba526db9e54dc03c8e0da37f14 | 2026-01-04T20:19:44.628446Z | false |
GothenburgBitFactory/taskchampion | https://github.com/GothenburgBitFactory/taskchampion/blob/45f5345daff60aba526db9e54dc03c8e0da37f14/tests/cross-sync.rs | tests/cross-sync.rs | #![cfg(feature = "server-local")]
use chrono::Utc;
use pretty_assertions::assert_eq;
use taskchampion::storage::inmemory::InMemoryStorage;
use taskchampion::{Operations, Replica, ServerConfig, Status, Uuid};
use tempfile::TempDir;
#[tokio::test]
async fn cross_sync() -> anyhow::Result<()> {
// set up two replicas... | rust | MIT | 45f5345daff60aba526db9e54dc03c8e0da37f14 | 2026-01-04T20:19:44.628446Z | false |
GothenburgBitFactory/taskchampion | https://github.com/GothenburgBitFactory/taskchampion/blob/45f5345daff60aba526db9e54dc03c8e0da37f14/tests/sync-server-tls.rs | tests/sync-server-tls.rs | #![cfg(all(feature = "server-sync", target_os = "linux"))]
use taskchampion::ServerConfig;
use uuid::Uuid;
mod tls_utils;
#[tokio::test]
/// Check that the sync server implementation correctly uses, or does not use,
/// tls-native-roots.
async fn sync_server_tls() -> anyhow::Result<()> {
tls_utils::reset_seen_ssl... | rust | MIT | 45f5345daff60aba526db9e54dc03c8e0da37f14 | 2026-01-04T20:19:44.628446Z | false |
GothenburgBitFactory/taskchampion | https://github.com/GothenburgBitFactory/taskchampion/blob/45f5345daff60aba526db9e54dc03c8e0da37f14/tests/tls_utils.rs | tests/tls_utils.rs | #![cfg(target_os = "linux")]
//! Utilities for testing TLS behaviors.
//!
//! This package intercepts calls to libc's `open64` method, and checks for paths containing
//! `/ssl/`. This is useful to determine whether some deeply nested library is using native TLS
//! certificates (which are typically at pathnames contai... | rust | MIT | 45f5345daff60aba526db9e54dc03c8e0da37f14 | 2026-01-04T20:19:44.628446Z | false |
GothenburgBitFactory/taskchampion | https://github.com/GothenburgBitFactory/taskchampion/blob/45f5345daff60aba526db9e54dc03c8e0da37f14/xtask/src/main.rs | xtask/src/main.rs | //! This executable defines the `cargo xtask` subcommands.
//!
//! At the moment it is very simple, but if this grows more subcommands then
//! it will be sensible to use `clap` or another similar library.
use regex::Regex;
use std::env;
use std::fs::File;
use std::io::{BufRead, BufReader, Seek, Write};
use std::path:... | rust | MIT | 45f5345daff60aba526db9e54dc03c8e0da37f14 | 2026-01-04T20:19:44.628446Z | false |
imbolc/tower-cookies | https://github.com/imbolc/tower-cookies/blob/2910227be9735902bfc82715c3d6e30db78dd001/src/lib.rs | src/lib.rs | #![cfg_attr(docsrs, feature(doc_auto_cfg))]
#![doc = include_str!("../README.md")]
#![warn(clippy::all, missing_docs, nonstandard_style, future_incompatible)]
#![forbid(unsafe_code)]
#![cfg_attr(docsrs, feature(doc_cfg))]
use cookie::CookieJar;
use http::HeaderValue;
use parking_lot::Mutex;
use std::sync::Arc;
#[doc(... | rust | MIT | 2910227be9735902bfc82715c3d6e30db78dd001 | 2026-01-04T20:20:12.890776Z | false |
imbolc/tower-cookies | https://github.com/imbolc/tower-cookies/blob/2910227be9735902bfc82715c3d6e30db78dd001/src/extract.rs | src/extract.rs | use crate::Cookies;
use axum_core::extract::FromRequestParts;
use http::{request::Parts, StatusCode};
impl<S> FromRequestParts<S> for Cookies
where
S: Sync + Send,
{
type Rejection = (http::StatusCode, &'static str);
async fn from_request_parts(parts: &mut Parts, _state: &S) -> Result<Self, Self::Rejectio... | rust | MIT | 2910227be9735902bfc82715c3d6e30db78dd001 | 2026-01-04T20:20:12.890776Z | false |
imbolc/tower-cookies | https://github.com/imbolc/tower-cookies/blob/2910227be9735902bfc82715c3d6e30db78dd001/src/signed.rs | src/signed.rs | use crate::Cookies;
use cookie::{Cookie, Key};
/// A child cookie jar that authenticates its cookies.
/// It signs all the cookies added to it and verifies cookies retrieved from it.
/// Any cookies stored in `SignedCookies` are provided integrity and authenticity. In other
/// words, clients cannot tamper with the co... | rust | MIT | 2910227be9735902bfc82715c3d6e30db78dd001 | 2026-01-04T20:20:12.890776Z | false |
imbolc/tower-cookies | https://github.com/imbolc/tower-cookies/blob/2910227be9735902bfc82715c3d6e30db78dd001/src/private.rs | src/private.rs | use crate::Cookies;
use cookie::{Cookie, Key};
/// A cookie jar that provides authenticated encryption for its cookies.
///
/// A _private_ child jar signs and encrypts all the cookies added to it and
/// verifies and decrypts cookies retrieved from it. Any cookies stored in
/// `PrivateCookies` are simultaneously ass... | rust | MIT | 2910227be9735902bfc82715c3d6e30db78dd001 | 2026-01-04T20:20:12.890776Z | false |
imbolc/tower-cookies | https://github.com/imbolc/tower-cookies/blob/2910227be9735902bfc82715c3d6e30db78dd001/src/service/future.rs | src/service/future.rs | //! [`Future`] types.
use crate::Cookies;
use futures_util::ready;
use http::{header, HeaderValue, Response};
use pin_project_lite::pin_project;
use std::{
future::Future,
pin::Pin,
task::{Context, Poll},
};
pin_project! {
/// Response future for [`CookieManager`].
#[derive(Debug)]
pub struct ... | rust | MIT | 2910227be9735902bfc82715c3d6e30db78dd001 | 2026-01-04T20:20:12.890776Z | false |
imbolc/tower-cookies | https://github.com/imbolc/tower-cookies/blob/2910227be9735902bfc82715c3d6e30db78dd001/src/service/mod.rs | src/service/mod.rs | //! Middleware to use [`Cookies`].
use self::future::ResponseFuture;
use crate::Cookies;
use http::{header, Request, Response};
use std::task::{Context, Poll};
use tower_layer::Layer;
use tower_service::Service;
pub mod future;
/// Middleware to use [`Cookies`].
#[derive(Clone, Debug)]
pub struct CookieManager<S> {
... | rust | MIT | 2910227be9735902bfc82715c3d6e30db78dd001 | 2026-01-04T20:20:12.890776Z | false |
imbolc/tower-cookies | https://github.com/imbolc/tower-cookies/blob/2910227be9735902bfc82715c3d6e30db78dd001/examples/hello_world.rs | examples/hello_world.rs | use axum::{routing::get, Router};
use std::net::SocketAddr;
use tower_cookies::{Cookie, CookieManagerLayer, Cookies};
#[tokio::main]
async fn main() {
let app = Router::new()
.route("/", get(handler))
.layer(CookieManagerLayer::new());
let addr = SocketAddr::from(([127, 0, 0, 1], 3000));
l... | rust | MIT | 2910227be9735902bfc82715c3d6e30db78dd001 | 2026-01-04T20:20:12.890776Z | false |
imbolc/tower-cookies | https://github.com/imbolc/tower-cookies/blob/2910227be9735902bfc82715c3d6e30db78dd001/examples/signed_private.rs | examples/signed_private.rs | //! The counter-example using private / signed cookies instead of raw ones
//! Can be run by: `cargo run --all-features --example signed_private`
use axum::{routing::get, Router};
use std::net::SocketAddr;
use std::sync::OnceLock;
use tower_cookies::{Cookie, CookieManagerLayer, Cookies, Key};
const COOKIE_NAME: &str =... | rust | MIT | 2910227be9735902bfc82715c3d6e30db78dd001 | 2026-01-04T20:20:12.890776Z | false |
imbolc/tower-cookies | https://github.com/imbolc/tower-cookies/blob/2910227be9735902bfc82715c3d6e30db78dd001/examples/counter.rs | examples/counter.rs | use axum::{routing::get, Router};
use std::net::SocketAddr;
use tower_cookies::{Cookie, CookieManagerLayer, Cookies};
const COOKIE_NAME: &str = "visited";
#[tokio::main]
async fn main() {
let app = Router::new()
.route("/", get(handler))
.layer(CookieManagerLayer::new());
let addr = SocketAdd... | rust | MIT | 2910227be9735902bfc82715c3d6e30db78dd001 | 2026-01-04T20:20:12.890776Z | false |
imbolc/tower-cookies | https://github.com/imbolc/tower-cookies/blob/2910227be9735902bfc82715c3d6e30db78dd001/examples/counter-extractor.rs | examples/counter-extractor.rs | //! The example illustrates accessing cookies from an
//! [`axum_core::extract::FromRequest::from_request`] implementation.
//! The behavior is the same as `examples/counter.rs` but cookies leveraging is moved into an
//! extractor.
use axum::{routing::get, Router};
use axum_core::extract::FromRequestParts;
use http::r... | rust | MIT | 2910227be9735902bfc82715c3d6e30db78dd001 | 2026-01-04T20:20:12.890776Z | false |
softprops/openapi | https://github.com/softprops/openapi/blob/0a7c95e34e90541e572d762878d4fe762c8d4048/src/lib.rs | src/lib.rs | //! Openapi provides structures and support for serializing and deserializing [openapi](https://github.com/OAI/OpenAPI-Specification) specifications
//!
//! # Examples
//!
//! Typical use deserialing an existing to a persisted spec to rust form or
//! visa versa
//!
//! The hyper client should be configured with tls.
/... | rust | MIT | 0a7c95e34e90541e572d762878d4fe762c8d4048 | 2026-01-04T20:20:15.952889Z | false |
softprops/openapi | https://github.com/softprops/openapi/blob/0a7c95e34e90541e572d762878d4fe762c8d4048/src/error.rs | src/error.rs | //! Error types
use semver::{SemVerError, Version};
use serde_json::Error as JsonError;
use serde_yaml::Error as YamlError;
use std::io::Error as IoError;
use thiserror::Error;
/// errors that openapi functions may return
#[derive(Error, Debug)]
pub enum Error {
#[error("I/O error")]
Io(#[from] IoError),
... | rust | MIT | 0a7c95e34e90541e572d762878d4fe762c8d4048 | 2026-01-04T20:20:15.952889Z | false |
softprops/openapi | https://github.com/softprops/openapi/blob/0a7c95e34e90541e572d762878d4fe762c8d4048/src/v3_0/extension.rs | src/v3_0/extension.rs | use std::collections::HashMap;
use std::fmt;
use serde::de::{MapAccess, Visitor};
use serde::ser::SerializeMap;
use serde::{Deserialize, Deserializer, Serialize, Serializer};
/// Contains openapi specification extensions
/// see https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.1.md#specificationE... | rust | MIT | 0a7c95e34e90541e572d762878d4fe762c8d4048 | 2026-01-04T20:20:15.952889Z | false |
softprops/openapi | https://github.com/softprops/openapi/blob/0a7c95e34e90541e572d762878d4fe762c8d4048/src/v3_0/schema.rs | src/v3_0/schema.rs | //! Schema specification for [OpenAPI 3.0.0](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md)
use crate::v3_0::extension::Extensions;
use serde::{Deserialize, Serialize};
use std::collections::{BTreeMap, HashMap};
use url::Url;
use crate::{
v3_0::components::{BooleanObjectOrReference, C... | rust | MIT | 0a7c95e34e90541e572d762878d4fe762c8d4048 | 2026-01-04T20:20:15.952889Z | true |
softprops/openapi | https://github.com/softprops/openapi/blob/0a7c95e34e90541e572d762878d4fe762c8d4048/src/v3_0/mod.rs | src/v3_0/mod.rs | //! Support for OpenApi version 3.0.1 specification.
//!
//! See the
//! [specification](https://github.com/OAI/OpenAPI-Specification/blob/0dd79f6/versions/3.0.1.md)
//! for more information.
mod components;
mod extension;
mod schema;
pub use crate::v3_0::{components::*, extension::*, schema::*};
// Yet OpenAPI dont... | rust | MIT | 0a7c95e34e90541e572d762878d4fe762c8d4048 | 2026-01-04T20:20:15.952889Z | false |
softprops/openapi | https://github.com/softprops/openapi/blob/0a7c95e34e90541e572d762878d4fe762c8d4048/src/v3_0/components.rs | src/v3_0/components.rs | use crate::v3_0::{
Callback, Example, Extensions, Header, Link, Parameter, RequestBody, Response, Schema,
SecurityScheme,
};
use serde::{Deserialize, Serialize};
use std::collections::BTreeMap;
#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)]
#[serde(untagged)]
pub enum ObjectOrReference<T> {
Obj... | rust | MIT | 0a7c95e34e90541e572d762878d4fe762c8d4048 | 2026-01-04T20:20:15.952889Z | false |
softprops/openapi | https://github.com/softprops/openapi/blob/0a7c95e34e90541e572d762878d4fe762c8d4048/src/v2/schema.rs | src/v2/schema.rs | use serde::{Deserialize, Serialize};
use std::collections::BTreeMap;
// http://json.schemastore.org/swagger-2.0
#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)]
#[serde(rename_all = "lowercase")]
pub enum Scheme {
Http,
Https,
Ws,
Wss,
}
impl Default for Scheme {
fn default() -> Self {
... | rust | MIT | 0a7c95e34e90541e572d762878d4fe762c8d4048 | 2026-01-04T20:20:15.952889Z | false |
softprops/openapi | https://github.com/softprops/openapi/blob/0a7c95e34e90541e572d762878d4fe762c8d4048/src/v2/mod.rs | src/v2/mod.rs | //! Support for OpenApi version 2.0 specification.
//!
//! See the
//! [specification](https://github.com/OAI/OpenAPI-Specification/blob/0dd79f6/versions/2.0.md)
//! for more information.
mod schema;
pub use crate::v2::schema::*;
| rust | MIT | 0a7c95e34e90541e572d762878d4fe762c8d4048 | 2026-01-04T20:20:15.952889Z | false |
softprops/openapi | https://github.com/softprops/openapi/blob/0a7c95e34e90541e572d762878d4fe762c8d4048/examples/printer.rs | examples/printer.rs | use anyhow::Result;
fn main() -> Result<()> {
if let Some(path) = std::env::args().nth(1) {
let spec = openapi::from_path(path)?;
/*for (path, op) in spec.paths {
println!("{}", path);
println!("{:#?}", op);
}
for (name, definition) in spec.definitions {
... | rust | MIT | 0a7c95e34e90541e572d762878d4fe762c8d4048 | 2026-01-04T20:20:15.952889Z | false |
a137x/plutus-rustus | https://github.com/a137x/plutus-rustus/blob/8684db39b1e1207013938edb7f692caef8351912/src/main.rs | src/main.rs | extern crate bitcoin;
extern crate num_cpus;
extern crate secp256k1;
use std::fs::{self, OpenOptions};
use std::sync::{Arc, RwLock};
use std::{
collections::HashSet,
fs::File,
io::{Read, Write},
time::Instant,
};
use bitcoin::Address;
use bitcoin::{network::constants::Network, PrivateKey, PublicKey};
... | rust | MIT | 8684db39b1e1207013938edb7f692caef8351912 | 2026-01-04T20:07:04.785180Z | false |
xfbs/diff.rs | https://github.com/xfbs/diff.rs/blob/1a21d67f3a6c0679927fe903df4ca6303c739e13/build.rs | build.rs | use vergen_gitcl::{Emitter, GitclBuilder};
/// This build script will query your `git` executable to fetch the current commit hash, and make
/// it available to the application using an environment variable. This is used to show the commit
/// hash that diff.rs was built with in the footer.
fn main() {
let gitcl =... | rust | MIT | 1a21d67f3a6c0679927fe903df4ca6303c739e13 | 2026-01-04T20:20:18.095653Z | false |
xfbs/diff.rs | https://github.com/xfbs/diff.rs/blob/1a21d67f3a6c0679927fe903df4ca6303c739e13/src/lib.rs | src/lib.rs | //! # diff.rs
//!
//! Web application to visualize code differences between different versions of Rust crates. Fully
//! backend-less, works by downloading crate sources in the browser, validating the hash, unpacking
//! it, running a diff algorithm over the files and rendering the diff. Support syntax highlighting
//... | rust | MIT | 1a21d67f3a6c0679927fe903df4ca6303c739e13 | 2026-01-04T20:20:18.095653Z | false |
xfbs/diff.rs | https://github.com/xfbs/diff.rs/blob/1a21d67f3a6c0679927fe903df4ca6303c739e13/src/version.rs | src/version.rs | use semver::{Error, Version, VersionReq};
use std::{
fmt::{Display, Formatter, Result as FmtResult},
str::FromStr,
};
use strum::EnumString;
#[derive(Debug, PartialEq, Eq, EnumString, Clone, strum::Display)]
#[strum(serialize_all = "kebab-case")]
pub enum VersionNamed {
Latest,
Previous,
}
#[derive(De... | rust | MIT | 1a21d67f3a6c0679927fe903df4ca6303c739e13 | 2026-01-04T20:20:18.095653Z | false |
xfbs/diff.rs | https://github.com/xfbs/diff.rs/blob/1a21d67f3a6c0679927fe903df4ca6303c739e13/src/tests.rs | src/tests.rs | use crate::data::*;
use anyhow::Result;
use serde_json::from_reader;
use std::fs::File;
fn parse_canned_response(name: &str) -> Result<CrateResponse> {
let response = File::open(format!("data/{name}.json"))?;
let response: CrateResponse = from_reader(response)?;
Ok(response)
}
fn parse_canned_source(versi... | rust | MIT | 1a21d67f3a6c0679927fe903df4ca6303c739e13 | 2026-01-04T20:20:18.095653Z | false |
xfbs/diff.rs | https://github.com/xfbs/diff.rs/blob/1a21d67f3a6c0679927fe903df4ca6303c739e13/src/views.rs | src/views.rs | //! # Application views
//!
//! This module contains all of the views of the application. Views are pages that
//! can be rendered (selected via the active route). Any components which are used
//! by more than one view (or are sufficiently complex) should go into the `components`
//! module, which contains components ... | rust | MIT | 1a21d67f3a6c0679927fe903df4ca6303c739e13 | 2026-01-04T20:20:18.095653Z | false |
xfbs/diff.rs | https://github.com/xfbs/diff.rs/blob/1a21d67f3a6c0679927fe903df4ca6303c739e13/src/syntax.rs | src/syntax.rs | use similar::ChangeTag;
use subslice_offset::SubsliceOffset;
use syntect::{
easy::HighlightLines,
highlighting::{Color, FontStyle, Style, Theme, ThemeSet},
parsing::{SyntaxReference, SyntaxSet},
};
lazy_static::lazy_static! {
/// The default syntect syntax set, used for parsing language definitions.
... | rust | MIT | 1a21d67f3a6c0679927fe903df4ca6303c739e13 | 2026-01-04T20:20:18.095653Z | false |
xfbs/diff.rs | https://github.com/xfbs/diff.rs/blob/1a21d67f3a6c0679927fe903df4ca6303c739e13/src/main.rs | src/main.rs | /// Initialize logging.
fn init_logging() {
use log::Level;
use wasm_logger::Config;
// use debug level for debug builds, warn level for production builds.
#[cfg(debug_assertions)]
let level = Level::Debug;
#[cfg(not(debug_assertions))]
let level = Level::Warn;
wasm_logger::init(Config... | rust | MIT | 1a21d67f3a6c0679927fe903df4ca6303c739e13 | 2026-01-04T20:20:18.095653Z | false |
xfbs/diff.rs | https://github.com/xfbs/diff.rs/blob/1a21d67f3a6c0679927fe903df4ca6303c739e13/src/components.rs | src/components.rs | //! # Shared components
//!
//! This module contains shared components. These are components which are shared between multiple
//! views. Components which are only used by a single view can be kept inside the view's definition
//! itself, unless they are generic to too complex.
mod diff_view;
mod file_tree;
mod footer... | rust | MIT | 1a21d67f3a6c0679927fe903df4ca6303c739e13 | 2026-01-04T20:20:18.095653Z | false |
xfbs/diff.rs | https://github.com/xfbs/diff.rs/blob/1a21d67f3a6c0679927fe903df4ca6303c739e13/src/data.rs | src/data.rs | use crate::version::{VersionId, VersionNamed};
use anyhow::{anyhow, Result};
use bytes::Bytes;
use camino::{Utf8Component, Utf8Path, Utf8PathBuf};
use flate2::bufread::GzDecoder;
use gloo_net::http::Request;
use log::*;
use semver::Version;
use serde::{Deserialize, Serialize};
use sha2::{Digest, Sha256};
use similar::{... | rust | MIT | 1a21d67f3a6c0679927fe903df4ca6303c739e13 | 2026-01-04T20:20:18.095653Z | false |
xfbs/diff.rs | https://github.com/xfbs/diff.rs/blob/1a21d67f3a6c0679927fe903df4ca6303c739e13/src/cache.rs | src/cache.rs | use crate::data::*;
use anyhow::Result;
use log::*;
use semver::Version;
use std::{
collections::BTreeMap,
sync::{Arc, Mutex},
};
/// Crate response cache
pub struct CrateResponseCache(Mutex<BTreeMap<String, Arc<CrateResponse>>>);
/// Global crate response cache instance
pub static CRATE_RESPONSE_CACHE: Crate... | rust | MIT | 1a21d67f3a6c0679927fe903df4ca6303c739e13 | 2026-01-04T20:20:18.095653Z | false |
xfbs/diff.rs | https://github.com/xfbs/diff.rs/blob/1a21d67f3a6c0679927fe903df4ca6303c739e13/src/components/diff_view.rs | src/components/diff_view.rs | use crate::{
data::{ChunkInfo, FileDiff, VersionDiff},
syntax::{highlight_changes, infer_syntax_for_file, syntect_style_to_css},
};
use bytes::Bytes;
use camino::Utf8PathBuf;
use log::*;
use similar::ChangeTag;
use std::rc::Rc;
use syntect::highlighting::Style;
use yew::prelude::*;
/// Contains information abo... | rust | MIT | 1a21d67f3a6c0679927fe903df4ca6303c739e13 | 2026-01-04T20:20:18.095653Z | false |
xfbs/diff.rs | https://github.com/xfbs/diff.rs/blob/1a21d67f3a6c0679927fe903df4ca6303c739e13/src/components/footer.rs | src/components/footer.rs | use yew::prelude::*;
#[function_component]
pub fn Footer() -> Html {
html! {
<div class="text-center py-4 text-gray-700 dark:text-gray-300">
<a href="https://github.com/xfbs/diff.rs">{"diff.rs"}</a>
{" build "}
<a class="font-mono" href={concat!("https://github.com/xfbs/... | rust | MIT | 1a21d67f3a6c0679927fe903df4ca6303c739e13 | 2026-01-04T20:20:18.095653Z | false |
xfbs/diff.rs | https://github.com/xfbs/diff.rs/blob/1a21d67f3a6c0679927fe903df4ca6303c739e13/src/components/search.rs | src/components/search.rs | use crate::{
data::{CrateDetail, SearchResponse, SummaryCategory, SummaryResponse},
Link, Route,
};
use gloo_net::http::Request;
use implicit_clone::unsync::IString;
use web_sys::HtmlInputElement;
use yew::{
prelude::*,
suspense::{use_future, use_future_with},
};
use yew_hooks::prelude::*;
use yew_route... | rust | MIT | 1a21d67f3a6c0679927fe903df4ca6303c739e13 | 2026-01-04T20:20:18.095653Z | false |
xfbs/diff.rs | https://github.com/xfbs/diff.rs/blob/1a21d67f3a6c0679927fe903df4ca6303c739e13/src/components/navigation.rs | src/components/navigation.rs | use crate::{components::Search, data::CrateResponse, *};
use implicit_clone::unsync::IString;
use indexmap::IndexMap;
use semver::Version;
use std::sync::Arc;
use web_sys::HtmlSelectElement;
use yew::prelude::*;
use yew_icons::{Icon as YewIcon, IconId};
#[derive(Properties, PartialEq)]
pub struct NavbarProps {
pub... | rust | MIT | 1a21d67f3a6c0679927fe903df4ca6303c739e13 | 2026-01-04T20:20:18.095653Z | false |
xfbs/diff.rs | https://github.com/xfbs/diff.rs/blob/1a21d67f3a6c0679927fe903df4ca6303c739e13/src/components/layout.rs | src/components/layout.rs | use yew::prelude::*;
#[derive(Properties, PartialEq)]
pub struct CenterProps {
pub children: Children,
}
#[function_component]
pub fn Center(props: &CenterProps) -> Html {
html! {
<div style="position: absolute; top: 50%; width: 100%; text-align: center;">
{ for props.children.iter() }
... | rust | MIT | 1a21d67f3a6c0679927fe903df4ca6303c739e13 | 2026-01-04T20:20:18.095653Z | false |
xfbs/diff.rs | https://github.com/xfbs/diff.rs/blob/1a21d67f3a6c0679927fe903df4ca6303c739e13/src/components/file_tree.rs | src/components/file_tree.rs | use crate::{
components::SearchGlass,
data::{Changes, Entry, Item, VersionDiff},
Link, Route, VersionId,
};
use camino::Utf8PathBuf;
use implicit_clone::unsync::IString;
use std::rc::Rc;
use web_sys::HtmlInputElement;
use yew::prelude::*;
#[derive(PartialEq, Clone, Debug)]
struct Context {
old_krate: S... | rust | MIT | 1a21d67f3a6c0679927fe903df4ca6303c739e13 | 2026-01-04T20:20:18.095653Z | false |
xfbs/diff.rs | https://github.com/xfbs/diff.rs/blob/1a21d67f3a6c0679927fe903df4ca6303c739e13/src/components/non_ideal.rs | src/components/non_ideal.rs | use yew::prelude::*;
use yewprint::*;
#[derive(Properties, PartialEq, Clone)]
pub struct ErrorProps {
pub title: String,
pub status: String,
}
#[function_component]
pub fn Error(props: &ErrorProps) -> Html {
html! {
<div class="m-auto text-center dark:text-gray-100">
<div class="p-2" s... | rust | MIT | 1a21d67f3a6c0679927fe903df4ca6303c739e13 | 2026-01-04T20:20:18.095653Z | false |
xfbs/diff.rs | https://github.com/xfbs/diff.rs/blob/1a21d67f3a6c0679927fe903df4ca6303c739e13/src/views/diff.rs | src/views/diff.rs | use crate::{cache::*, components::*, data::*, version::VersionId, Route};
use camino::Utf8PathBuf;
use semver::Version;
use std::sync::Arc;
use yew::{prelude::*, suspense::*};
use yew_router::prelude::*;
/// Props for which file to show.
#[derive(Properties, PartialEq, Clone)]
pub struct DiffProps {
pub src_name: ... | rust | MIT | 1a21d67f3a6c0679927fe903df4ca6303c739e13 | 2026-01-04T20:20:18.095653Z | false |
xfbs/diff.rs | https://github.com/xfbs/diff.rs/blob/1a21d67f3a6c0679927fe903df4ca6303c739e13/src/views/repo.rs | src/views/repo.rs | use crate::{
cache::*,
components::*,
data::{CrateResponse, CrateSource, RepositoryInfo, VersionDiff, VersionInfo},
version::VersionId,
};
use camino::Utf8PathBuf;
use std::{rc::Rc, sync::Arc};
use yew::{prelude::*, suspense::*};
#[derive(Properties, PartialEq)]
pub struct RepoFileViewProps {
pub k... | rust | MIT | 1a21d67f3a6c0679927fe903df4ca6303c739e13 | 2026-01-04T20:20:18.095653Z | false |
xfbs/diff.rs | https://github.com/xfbs/diff.rs/blob/1a21d67f3a6c0679927fe903df4ca6303c739e13/src/views/search.rs | src/views/search.rs | use crate::{components::*, Route};
use yew::prelude::*;
use yew_hooks::prelude::*;
use yew_router::prelude::*;
#[derive(Properties, PartialEq)]
pub struct SearchProps {
pub search: String,
}
#[function_component]
fn Logo() -> Html {
html! {
<h1 class="text-center text-3xl font-bold my-12 dark:text-whi... | rust | MIT | 1a21d67f3a6c0679927fe903df4ca6303c739e13 | 2026-01-04T20:20:18.095653Z | false |
xfbs/diff.rs | https://github.com/xfbs/diff.rs/blob/1a21d67f3a6c0679927fe903df4ca6303c739e13/src/views/home.rs | src/views/home.rs | use crate::{components::*, Route};
use yew::prelude::*;
use yew_router::prelude::*;
#[function_component]
fn Logo() -> Html {
html! {
<h1 class="text-center text-3xl font-bold my-12 dark:text-white">{ "diff.rs" }</h1>
}
}
/// Home page, shows search bar.
#[function_component]
pub fn Home() -> Html {
... | rust | MIT | 1a21d67f3a6c0679927fe903df4ca6303c739e13 | 2026-01-04T20:20:18.095653Z | false |
xfbs/diff.rs | https://github.com/xfbs/diff.rs/blob/1a21d67f3a6c0679927fe903df4ca6303c739e13/src/views/not_found.rs | src/views/not_found.rs | use crate::components::{Center, Content, Error, Footer, SimpleNavbar};
use yew::prelude::*;
/// Not found view, shows generic error.
#[function_component]
pub fn NotFound() -> Html {
html! {
<div class="flex flex-col min-h-screen">
<div class="flex-1">
<SimpleNavbar />
... | rust | MIT | 1a21d67f3a6c0679927fe903df4ca6303c739e13 | 2026-01-04T20:20:18.095653Z | false |
xfbs/diff.rs | https://github.com/xfbs/diff.rs/blob/1a21d67f3a6c0679927fe903df4ca6303c739e13/src/views/about.rs | src/views/about.rs | use crate::components::{Content, Footer, SimpleNavbar};
use yew::prelude::*;
const TEXT: &str = include_str!("about.md");
#[function_component]
fn AboutText() -> Html {
let html = comrak::markdown_to_html(TEXT, &Default::default());
let parsed = Html::from_html_unchecked(AttrValue::from(html));
html! {
... | rust | MIT | 1a21d67f3a6c0679927fe903df4ca6303c739e13 | 2026-01-04T20:20:18.095653Z | false |
ReSpeak/tsclientlib | https://github.com/ReSpeak/tsclientlib/blob/3fbfa26ead0d3e5b38288b55abe3e2d636a97115/tsproto/src/lib.rs | tsproto/src/lib.rs | //! This library implements the TeamSpeak3 protocol.
//!
//! For a usable library to build clients and bots, you should take a look at
//! [`tsclientlib`](https://github.com/ReSpeak/tsclientlib), which provides a
//! convenient interface to this library.
//!
//! If you are searching for a usable client, [Qint](https://... | rust | Apache-2.0 | 3fbfa26ead0d3e5b38288b55abe3e2d636a97115 | 2026-01-04T20:19:54.636515Z | false |
ReSpeak/tsclientlib | https://github.com/ReSpeak/tsclientlib/blob/3fbfa26ead0d3e5b38288b55abe3e2d636a97115/tsproto/src/log.rs | tsproto/src/log.rs | use std::fmt::Debug;
use std::str;
use tracing::{debug, debug_span, Span};
use tsproto_packets::packets::{InUdpPacket, OutUdpPacket, PacketType};
use tsproto_packets::HexSlice;
use crate::connection::{Connection, Event};
fn prepare_span(is_client: bool, incoming: bool) -> Span {
let dir = if incoming {
if !cfg!(w... | rust | Apache-2.0 | 3fbfa26ead0d3e5b38288b55abe3e2d636a97115 | 2026-01-04T20:19:54.636515Z | false |
ReSpeak/tsclientlib | https://github.com/ReSpeak/tsclientlib/blob/3fbfa26ead0d3e5b38288b55abe3e2d636a97115/tsproto/src/connection.rs | tsproto/src/connection.rs | use std::collections::VecDeque;
use std::io;
use std::mem;
use std::net::SocketAddr;
use std::pin::Pin;
use std::task::{Context, Poll};
use futures::prelude::*;
use generic_array::typenum::consts::U16;
use generic_array::GenericArray;
use num_traits::ToPrimitive;
use tokio::io::ReadBuf;
use tokio::net::UdpSocket;
use ... | rust | Apache-2.0 | 3fbfa26ead0d3e5b38288b55abe3e2d636a97115 | 2026-01-04T20:19:54.636515Z | false |
ReSpeak/tsclientlib | https://github.com/ReSpeak/tsclientlib/blob/3fbfa26ead0d3e5b38288b55abe3e2d636a97115/tsproto/src/client.rs | tsproto/src/client.rs | use std::net::SocketAddr;
use std::ops::{Deref, DerefMut};
use std::pin::Pin;
use std::str;
use std::task::{Context, Poll};
use base64::prelude::*;
use futures::prelude::*;
#[cfg(not(feature = "rug"))]
use num_bigint::BigUint;
#[cfg(not(feature = "rug"))]
use num_traits::One;
use rand::Rng;
#[cfg(feature = "rug")]
use... | rust | Apache-2.0 | 3fbfa26ead0d3e5b38288b55abe3e2d636a97115 | 2026-01-04T20:19:54.636515Z | true |
ReSpeak/tsclientlib | https://github.com/ReSpeak/tsclientlib/blob/3fbfa26ead0d3e5b38288b55abe3e2d636a97115/tsproto/src/algorithms.rs | tsproto/src/algorithms.rs | //! Handle packet splitting and cryptography
use curve25519_dalek_ng::edwards::EdwardsPoint;
use eax::aead::consts::{U16, U8};
use eax::{AeadInPlace, Eax, KeyInit};
use generic_array::GenericArray;
use num_bigint::BigUint;
use num_traits::ToPrimitive;
use omnom::WriteExt;
use quicklz::CompressionLevel;
use sha1::Sha1;
... | rust | Apache-2.0 | 3fbfa26ead0d3e5b38288b55abe3e2d636a97115 | 2026-01-04T20:19:54.636515Z | false |
ReSpeak/tsclientlib | https://github.com/ReSpeak/tsclientlib/blob/3fbfa26ead0d3e5b38288b55abe3e2d636a97115/tsproto/src/license.rs | tsproto/src/license.rs | use std::convert::{TryFrom, TryInto};
use std::fmt;
use std::io::Cursor;
use std::str;
use curve25519_dalek_ng::edwards::EdwardsPoint;
use curve25519_dalek_ng::scalar::Scalar;
use num_derive::{FromPrimitive, ToPrimitive};
use num_traits::{FromPrimitive as _, ToPrimitive as _};
use omnom::{ReadExt, WriteExt};
use sha2:... | rust | Apache-2.0 | 3fbfa26ead0d3e5b38288b55abe3e2d636a97115 | 2026-01-04T20:19:54.636515Z | false |
ReSpeak/tsclientlib | https://github.com/ReSpeak/tsclientlib/blob/3fbfa26ead0d3e5b38288b55abe3e2d636a97115/tsproto/src/utils.rs | tsproto/src/utils.rs | use std::net::IpAddr;
use crate::{Error, Result};
/// Try to approximate the not stabilized ip.is_global().
pub fn is_global_ip(ip: &IpAddr) -> bool {
if !ip.is_unspecified() && !ip.is_loopback() && !ip.is_multicast() {
match *ip {
IpAddr::V4(ref ip) => !ip.is_broadcast() && !ip.is_link_local() && !ip.is_privat... | rust | Apache-2.0 | 3fbfa26ead0d3e5b38288b55abe3e2d636a97115 | 2026-01-04T20:19:54.636515Z | false |
ReSpeak/tsclientlib | https://github.com/ReSpeak/tsclientlib/blob/3fbfa26ead0d3e5b38288b55abe3e2d636a97115/tsproto/src/resend.rs | tsproto/src/resend.rs | use std::cmp::{min, Ord, Ordering};
use std::collections::{BTreeMap, BinaryHeap};
use std::convert::From;
use std::fmt;
use std::hash::{Hash, Hasher};
use std::ops::{Add, Sub};
use std::pin::Pin;
use std::task::{Context, Poll};
use futures::prelude::*;
use num_traits::ToPrimitive;
use pin_project_lite::pin_project;
us... | rust | Apache-2.0 | 3fbfa26ead0d3e5b38288b55abe3e2d636a97115 | 2026-01-04T20:19:54.636515Z | true |
ReSpeak/tsclientlib | https://github.com/ReSpeak/tsclientlib/blob/3fbfa26ead0d3e5b38288b55abe3e2d636a97115/tsproto/src/packet_codec.rs | tsproto/src/packet_codec.rs | use std::io::Cursor;
use std::task::Context;
use num_traits::ToPrimitive;
use omnom::WriteExt;
use tracing::warn;
use tsproto_packets::packets::*;
use crate::algorithms as algs;
use crate::connection::{Connection, Event, StreamItem};
use crate::resend::{PartialPacketId, Resender};
use crate::{Error, Result, MAX_FRAGM... | rust | Apache-2.0 | 3fbfa26ead0d3e5b38288b55abe3e2d636a97115 | 2026-01-04T20:19:54.636515Z | false |
ReSpeak/tsclientlib | https://github.com/ReSpeak/tsclientlib/blob/3fbfa26ead0d3e5b38288b55abe3e2d636a97115/tsproto/benches/connect.rs | tsproto/benches/connect.rs | use anyhow::{Error, Result};
use criterion::{criterion_group, criterion_main, Bencher, Criterion};
use once_cell::sync::Lazy;
use tracing::{info, warn};
use tsproto::client::Client;
use tsproto::connection::StreamItem;
use tsproto_packets::commands::CommandParser;
mod utils;
use crate::utils::*;
static TRACING: Lazy<... | rust | Apache-2.0 | 3fbfa26ead0d3e5b38288b55abe3e2d636a97115 | 2026-01-04T20:19:54.636515Z | false |
ReSpeak/tsclientlib | https://github.com/ReSpeak/tsclientlib/blob/3fbfa26ead0d3e5b38288b55abe3e2d636a97115/tsproto/benches/license.rs | tsproto/benches/license.rs | use base64::prelude::*;
use criterion::{criterion_group, criterion_main, Bencher, Criterion};
use tsproto::license::Licenses;
use tsproto_types::crypto::EccKeyPubEd25519;
fn license_parse(b: &mut Bencher, license: Vec<u8>) {
b.iter(|| {
Licenses::parse_ignore_expired(license.clone()).unwrap();
});
}
fn license_de... | rust | Apache-2.0 | 3fbfa26ead0d3e5b38288b55abe3e2d636a97115 | 2026-01-04T20:19:54.636515Z | false |
ReSpeak/tsclientlib | https://github.com/ReSpeak/tsclientlib/blob/3fbfa26ead0d3e5b38288b55abe3e2d636a97115/tsproto/benches/modpow.rs | tsproto/benches/modpow.rs | use criterion::{criterion_group, criterion_main, Bencher, Criterion};
use num_bigint::BigUint;
use num_traits::One;
#[cfg(feature = "rug")]
use rug::Integer;
fn num_modpow(b: &mut Bencher) {
let n = "9387019355706217197639129234358945126657617361248696932841794255538327365072557602175160199263073329488914880215590036... | rust | Apache-2.0 | 3fbfa26ead0d3e5b38288b55abe3e2d636a97115 | 2026-01-04T20:19:54.636515Z | false |
ReSpeak/tsclientlib | https://github.com/ReSpeak/tsclientlib/blob/3fbfa26ead0d3e5b38288b55abe3e2d636a97115/tsproto/benches/message.rs | tsproto/benches/message.rs | use anyhow::Error;
use criterion::{criterion_group, criterion_main, Bencher, Criterion};
use tracing::info;
use tsproto_packets::packets::*;
mod utils;
use crate::utils::*;
fn send_messages(b: &mut Bencher) {
create_logger(false);
let local_address = "127.0.0.1:0".parse().unwrap();
let address = "127.0.0.1:9987".... | rust | Apache-2.0 | 3fbfa26ead0d3e5b38288b55abe3e2d636a97115 | 2026-01-04T20:19:54.636515Z | false |
ReSpeak/tsclientlib | https://github.com/ReSpeak/tsclientlib/blob/3fbfa26ead0d3e5b38288b55abe3e2d636a97115/tsproto/benches/utils/mod.rs | tsproto/benches/utils/mod.rs | use std::net::SocketAddr;
use anyhow::Result;
use tokio::net::UdpSocket;
use tsproto::algorithms as algs;
use tsproto::client::Client;
use tsproto_packets::packets::*;
use tsproto_types::crypto::EccKeyPrivP256;
#[allow(dead_code)]
pub fn create_logger(to_file: bool) {
if to_file {
tracing_subscriber::fmt()
.wit... | rust | Apache-2.0 | 3fbfa26ead0d3e5b38288b55abe3e2d636a97115 | 2026-01-04T20:19:54.636515Z | false |
ReSpeak/tsclientlib | https://github.com/ReSpeak/tsclientlib/blob/3fbfa26ead0d3e5b38288b55abe3e2d636a97115/tsproto/examples/test-ed25519.rs | tsproto/examples/test-ed25519.rs | use base64::prelude::*;
use clap::Parser;
use curve25519_dalek_ng::edwards::CompressedEdwardsY;
use curve25519_dalek_ng::scalar::Scalar;
#[derive(Parser, Debug)]
#[command(author, about)]
struct Args {
/// Public key
#[arg(short, long = "pub")]
pub_key: String,
/// Private key
#[arg(short, long = "priv")]
priv_k... | rust | Apache-2.0 | 3fbfa26ead0d3e5b38288b55abe3e2d636a97115 | 2026-01-04T20:19:54.636515Z | false |
ReSpeak/tsclientlib | https://github.com/ReSpeak/tsclientlib/blob/3fbfa26ead0d3e5b38288b55abe3e2d636a97115/tsproto/examples/client.rs | tsproto/examples/client.rs | use std::net::SocketAddr;
use anyhow::{bail, Result};
use clap::Parser;
use tokio::time::{self, Duration};
use tracing::info;
use tsproto_packets::packets::*;
mod utils;
use crate::utils::*;
#[derive(Parser, Debug)]
#[command(author, about)]
struct Args {
/// The address of the server to connect to
#[arg(short, lo... | rust | Apache-2.0 | 3fbfa26ead0d3e5b38288b55abe3e2d636a97115 | 2026-01-04T20:19:54.636515Z | false |
ReSpeak/tsclientlib | https://github.com/ReSpeak/tsclientlib/blob/3fbfa26ead0d3e5b38288b55abe3e2d636a97115/tsproto/examples/test-decrypt.rs | tsproto/examples/test-decrypt.rs | use std::io::Write;
use clap::Parser;
use tsproto::algorithms as algs;
use tsproto::utils;
use tsproto_packets::packets::*;
#[derive(Parser, Debug)]
#[command(author, about)]
struct Args {
/// Print backtrace
#[arg(short, long = "debug")]
debug: bool,
/// Server to client
#[arg(short, long = "client")]
c2s: boo... | rust | Apache-2.0 | 3fbfa26ead0d3e5b38288b55abe3e2d636a97115 | 2026-01-04T20:19:54.636515Z | false |
ReSpeak/tsclientlib | https://github.com/ReSpeak/tsclientlib/blob/3fbfa26ead0d3e5b38288b55abe3e2d636a97115/tsproto/examples/decompress.rs | tsproto/examples/decompress.rs | use std::io::{Cursor, Write};
use clap::Parser;
use tsproto::utils;
#[derive(Parser, Debug)]
#[command(author, about)]
struct Args {
/// Data (hex)
#[arg()]
data: String,
}
fn main() {
// Parse command line options
let args = Args::parse();
let data = utils::read_hex(&args.data).unwrap();
let data = quicklz:... | rust | Apache-2.0 | 3fbfa26ead0d3e5b38288b55abe3e2d636a97115 | 2026-01-04T20:19:54.636515Z | false |
ReSpeak/tsclientlib | https://github.com/ReSpeak/tsclientlib/blob/3fbfa26ead0d3e5b38288b55abe3e2d636a97115/tsproto/examples/test-proofs.rs | tsproto/examples/test-proofs.rs | use base64::prelude::*;
use clap::Parser;
use tsproto_types::crypto::EccKeyPubP256;
#[derive(Parser, Debug)]
#[command(author, about)]
struct Args {
/// Public key
#[arg(short, long)]
key: String,
/// Data (base64)
#[arg(short, long)]
data: String,
/// Signature (base64)
#[arg(short, long)]
signature: String,... | rust | Apache-2.0 | 3fbfa26ead0d3e5b38288b55abe3e2d636a97115 | 2026-01-04T20:19:54.636515Z | false |
ReSpeak/tsclientlib | https://github.com/ReSpeak/tsclientlib/blob/3fbfa26ead0d3e5b38288b55abe3e2d636a97115/tsproto/examples/parse-license.rs | tsproto/examples/parse-license.rs | use base64::prelude::*;
use clap::Parser;
use tsproto::license::*;
#[derive(Parser, Debug)]
#[command(author, about)]
struct Args {
/// The license data (base64)
#[arg()]
license: String,
}
fn main() {
// Parse command line options
let args = Args::parse();
let l = Licenses::parse(BASE64_STANDARD.decode(&args.... | rust | Apache-2.0 | 3fbfa26ead0d3e5b38288b55abe3e2d636a97115 | 2026-01-04T20:19:54.636515Z | false |
ReSpeak/tsclientlib | https://github.com/ReSpeak/tsclientlib/blob/3fbfa26ead0d3e5b38288b55abe3e2d636a97115/tsproto/examples/many-tsproto.rs | tsproto/examples/many-tsproto.rs | use std::net::SocketAddr;
use anyhow::Result;
use clap::Parser;
use futures::prelude::*;
use tokio::time::{self, Duration};
use tracing::info;
mod utils;
use crate::utils::*;
#[derive(Parser, Clone, Debug)]
#[command(author, about)]
struct Args {
/// The address of the server to connect to
#[arg(short, long, defau... | rust | Apache-2.0 | 3fbfa26ead0d3e5b38288b55abe3e2d636a97115 | 2026-01-04T20:19:54.636515Z | false |
ReSpeak/tsclientlib | https://github.com/ReSpeak/tsclientlib/blob/3fbfa26ead0d3e5b38288b55abe3e2d636a97115/tsproto/examples/utils/mod.rs | tsproto/examples/utils/mod.rs | use std::net::SocketAddr;
use anyhow::Result;
use tokio::net::UdpSocket;
use tracing::{info, info_span};
use tsproto::algorithms as algs;
use tsproto::client::Client;
use tsproto_packets::packets::*;
use tsproto_types::crypto::EccKeyPrivP256;
pub fn create_logger() { tracing_subscriber::fmt::init(); }
pub async fn c... | rust | Apache-2.0 | 3fbfa26ead0d3e5b38288b55abe3e2d636a97115 | 2026-01-04T20:19:54.636515Z | false |
ReSpeak/tsclientlib | https://github.com/ReSpeak/tsclientlib/blob/3fbfa26ead0d3e5b38288b55abe3e2d636a97115/utils/tsproto-packets/src/lib.rs | utils/tsproto-packets/src/lib.rs | //! `tsproto-packets` parses and serializes TeamSpeak packets and commands.
use std::fmt;
use thiserror::Error;
pub mod commands;
pub mod packets;
type Result<T, E = Error> = std::result::Result<T, E>;
pub const S2C_HEADER_LEN: usize = 11;
pub const C2S_HEADER_LEN: usize = 13;
#[derive(Error, Debug)]
#[non_exhaus... | rust | Apache-2.0 | 3fbfa26ead0d3e5b38288b55abe3e2d636a97115 | 2026-01-04T20:19:54.636515Z | false |
ReSpeak/tsclientlib | https://github.com/ReSpeak/tsclientlib/blob/3fbfa26ead0d3e5b38288b55abe3e2d636a97115/utils/tsproto-packets/src/packets.rs | utils/tsproto-packets/src/packets.rs | #![allow(clippy::new_ret_no_self)]
use std::convert::TryInto;
use std::io::prelude::*;
use std::{fmt, io, str};
use base64::prelude::*;
use bitflags::bitflags;
use num_derive::{FromPrimitive, ToPrimitive};
use num_traits::{FromPrimitive as _, ToPrimitive as _};
use omnom::{ReadExt, WriteExt};
use serde::{Deserialize, ... | rust | Apache-2.0 | 3fbfa26ead0d3e5b38288b55abe3e2d636a97115 | 2026-01-04T20:19:54.636515Z | true |
ReSpeak/tsclientlib | https://github.com/ReSpeak/tsclientlib/blob/3fbfa26ead0d3e5b38288b55abe3e2d636a97115/utils/tsproto-packets/src/commands.rs | utils/tsproto-packets/src/commands.rs | use std::borrow::Cow;
use std::str::{self, FromStr};
use crate::{Error, Result};
/// Parses arguments of a command.
#[derive(Clone, Debug)]
pub struct CommandParser<'a> {
data: &'a [u8],
index: usize,
}
#[derive(Clone, Debug)]
pub enum CommandItem<'a> {
Argument(CommandArgument<'a>),
/// Pipe symbol marking the ... | rust | Apache-2.0 | 3fbfa26ead0d3e5b38288b55abe3e2d636a97115 | 2026-01-04T20:19:54.636515Z | false |
ReSpeak/tsclientlib | https://github.com/ReSpeak/tsclientlib/blob/3fbfa26ead0d3e5b38288b55abe3e2d636a97115/utils/tsproto-types/src/errors.rs | utils/tsproto-types/src/errors.rs | use std::fmt;
use num_derive::{FromPrimitive, ToPrimitive};
include!(concat!(env!("OUT_DIR"), "/errors.rs"));
impl fmt::Display for Error {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { fmt::Debug::fmt(self, f) }
}
impl std::error::Error for Error {
fn description(&self) -> &str { "TeamSpeak error" }
}
| rust | Apache-2.0 | 3fbfa26ead0d3e5b38288b55abe3e2d636a97115 | 2026-01-04T20:19:54.636515Z | false |
ReSpeak/tsclientlib | https://github.com/ReSpeak/tsclientlib/blob/3fbfa26ead0d3e5b38288b55abe3e2d636a97115/utils/tsproto-types/src/lib.rs | utils/tsproto-types/src/lib.rs | //! `tsproto-types` contains basic types and enums that are used within the TeamSpeak protocol.
use std::borrow::{Borrow, Cow};
use std::fmt;
use base64::prelude::*;
use bitflags::bitflags;
use num_derive::{FromPrimitive, ToPrimitive};
use ref_cast::RefCast;
use serde::{Deserialize, Deserializer, Serialize};
use time... | rust | Apache-2.0 | 3fbfa26ead0d3e5b38288b55abe3e2d636a97115 | 2026-01-04T20:19:54.636515Z | false |
ReSpeak/tsclientlib | https://github.com/ReSpeak/tsclientlib/blob/3fbfa26ead0d3e5b38288b55abe3e2d636a97115/utils/tsproto-types/src/crypto.rs | utils/tsproto-types/src/crypto.rs | //! This module contains cryptography related code.
use std::convert::TryInto;
use std::{cmp, fmt, str};
use base64::prelude::*;
use curve25519_dalek_ng::constants;
use curve25519_dalek_ng::edwards::{CompressedEdwardsY, EdwardsPoint};
use curve25519_dalek_ng::scalar::Scalar;
use elliptic_curve::sec1::{FromEncodedPoint... | rust | Apache-2.0 | 3fbfa26ead0d3e5b38288b55abe3e2d636a97115 | 2026-01-04T20:19:54.636515Z | false |
ReSpeak/tsclientlib | https://github.com/ReSpeak/tsclientlib/blob/3fbfa26ead0d3e5b38288b55abe3e2d636a97115/utils/tsproto-types/src/versions.rs | utils/tsproto-types/src/versions.rs | use std::fmt;
include!(concat!(env!("OUT_DIR"), "/versions.rs"));
impl fmt::Display for Version {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{} {}", self.get_platform(), self.get_version_string())
}
}
| rust | Apache-2.0 | 3fbfa26ead0d3e5b38288b55abe3e2d636a97115 | 2026-01-04T20:19:54.636515Z | false |
ReSpeak/tsclientlib | https://github.com/ReSpeak/tsclientlib/blob/3fbfa26ead0d3e5b38288b55abe3e2d636a97115/utils/tsproto-types/build/errors.rs | utils/tsproto-types/build/errors.rs | use std::ops::Deref;
use heck::*;
use t4rust_derive::Template;
use tsproto_structs::errors::*;
use tsproto_structs::EnumValue;
use tsproto_structs::{doc_comment, indent};
#[derive(Template)]
#[TemplatePath = "build/Errors.tt"]
#[derive(Default, Debug)]
pub struct Errors;
impl Deref for Errors {
type Target = Vec<En... | rust | Apache-2.0 | 3fbfa26ead0d3e5b38288b55abe3e2d636a97115 | 2026-01-04T20:19:54.636515Z | false |
ReSpeak/tsclientlib | https://github.com/ReSpeak/tsclientlib/blob/3fbfa26ead0d3e5b38288b55abe3e2d636a97115/utils/tsproto-types/build/enums.rs | utils/tsproto-types/build/enums.rs | use std::ops::Deref;
use heck::*;
use t4rust_derive::Template;
use tsproto_structs::enums;
use tsproto_structs::enums::*;
use tsproto_structs::{doc_comment, indent};
#[derive(Template)]
#[TemplatePath = "build/Enums.tt"]
#[derive(Default, Debug)]
pub struct Enums;
impl Deref for Enums {
type Target = enums::Enums;
... | rust | Apache-2.0 | 3fbfa26ead0d3e5b38288b55abe3e2d636a97115 | 2026-01-04T20:19:54.636515Z | false |
ReSpeak/tsclientlib | https://github.com/ReSpeak/tsclientlib/blob/3fbfa26ead0d3e5b38288b55abe3e2d636a97115/utils/tsproto-types/build/build.rs | utils/tsproto-types/build/build.rs | use std::env;
use std::fs::File;
use std::io::prelude::*;
use std::path::Path;
mod enums;
mod errors;
mod versions;
use crate::enums::Enums;
use crate::errors::Errors;
use crate::versions::Versions;
fn main() {
let out_dir = env::var("OUT_DIR").unwrap();
// Enums
let path = Path::new(&out_dir);
let mut structs ... | rust | Apache-2.0 | 3fbfa26ead0d3e5b38288b55abe3e2d636a97115 | 2026-01-04T20:19:54.636515Z | false |
ReSpeak/tsclientlib | https://github.com/ReSpeak/tsclientlib/blob/3fbfa26ead0d3e5b38288b55abe3e2d636a97115/utils/tsproto-types/build/versions.rs | utils/tsproto-types/build/versions.rs | use std::ops::Deref;
use t4rust_derive::Template;
use tsproto_structs::versions::*;
#[derive(Template)]
#[TemplatePath = "build/Versions.tt"]
#[derive(Default, Debug)]
pub struct Versions;
impl Deref for Versions {
type Target = Vec<Version>;
fn deref(&self) -> &Self::Target { &DATA.0 }
}
| rust | Apache-2.0 | 3fbfa26ead0d3e5b38288b55abe3e2d636a97115 | 2026-01-04T20:19:54.636515Z | false |
ReSpeak/tsclientlib | https://github.com/ReSpeak/tsclientlib/blob/3fbfa26ead0d3e5b38288b55abe3e2d636a97115/utils/ts-bookkeeping/src/messages.rs | utils/ts-bookkeeping/src/messages.rs | use std::net::IpAddr;
use thiserror::Error;
use time::{Duration, OffsetDateTime};
use tsproto_packets::commands::CommandParser;
use tsproto_packets::packets::{Direction, InHeader, OutCommand, PacketType};
use tsproto_types::errors::Error;
use crate::*;
type Result<T> = std::result::Result<T, ParseError>;
#[derive(E... | rust | Apache-2.0 | 3fbfa26ead0d3e5b38288b55abe3e2d636a97115 | 2026-01-04T20:19:54.636515Z | false |
ReSpeak/tsclientlib | https://github.com/ReSpeak/tsclientlib/blob/3fbfa26ead0d3e5b38288b55abe3e2d636a97115/utils/ts-bookkeeping/src/lib.rs | utils/ts-bookkeeping/src/lib.rs | //! `ts-bookkeeping` contains structs to store the state of a TeamSpeak server, with its clients and
//! channels.
//!
//! The crate can be used to keep track of the state on a server by processing all incoming
//! commands, which is why it is called “bookkeeping”. It also contains generated structs for all
//! TeamSpe... | rust | Apache-2.0 | 3fbfa26ead0d3e5b38288b55abe3e2d636a97115 | 2026-01-04T20:19:54.636515Z | false |
ReSpeak/tsclientlib | https://github.com/ReSpeak/tsclientlib/blob/3fbfa26ead0d3e5b38288b55abe3e2d636a97115/utils/ts-bookkeeping/src/events.rs | utils/ts-bookkeeping/src/events.rs | use serde::{Deserialize, Serialize};
use time::{Duration, OffsetDateTime};
use tsproto_types::crypto::EccKeyPubP256;
use crate::data::{
Channel, ChannelGroup, Client, Connection, ConnectionClientData, ConnectionServerData,
OptionalChannelData, OptionalClientData, OptionalServerData, Server, ServerGroup,
};
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/src/data.rs | utils/ts-bookkeeping/src/data.rs | use std::borrow::Cow;
use std::collections::{HashMap, HashSet};
use std::net::{IpAddr, SocketAddr};
use std::{iter, mem};
use serde::{Deserialize, Serialize};
use time::{Duration, OffsetDateTime};
use tsproto_packets::packets::OutCommand;
use tsproto_types::crypto::EccKeyPubP256;
use tsproto_types::*;
use crate::even... | rust | Apache-2.0 | 3fbfa26ead0d3e5b38288b55abe3e2d636a97115 | 2026-01-04T20:19:54.636515Z | false |
ReSpeak/tsclientlib | https://github.com/ReSpeak/tsclientlib/blob/3fbfa26ead0d3e5b38288b55abe3e2d636a97115/utils/ts-bookkeeping/benches/command.rs | utils/ts-bookkeeping/benches/command.rs | use std::iter;
use criterion::{criterion_group, criterion_main, Bencher, Criterion};
use once_cell::sync::Lazy;
use ts_bookkeeping::messages::s2c::{self, InMessage};
use tsproto_packets::packets::{Direction, Flags, OutPacket, PacketType};
const SHORT_CMD: &[u8] = b"notifyclientleftview cfid=1 ctid=0 clid=61";
const L... | 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/properties.rs | utils/ts-bookkeeping/build/properties.rs | //! Access properties of a connection with the property structs from events.
use std::default::Default;
use std::fmt::Write;
use heck::*;
use t4rust_derive::Template;
use tsproto_structs::book::*;
use tsproto_structs::embrace;
#[derive(Template)]
#[TemplatePath = "build/Properties.tt"]
#[derive(Debug)]
pub struct Pro... | 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/messages_to_book_parser.rs | utils/ts-bookkeeping/build/messages_to_book_parser.rs | use std::collections::HashMap;
use std::default::Default;
use std::ops::Deref;
use heck::*;
use t4rust_derive::Template;
use tsproto_structs::book::{PropId, Property};
use tsproto_structs::messages::Field;
use tsproto_structs::messages_to_book::*;
use tsproto_structs::*;
#[derive(Template)]
#[TemplatePath = "build/Me... | rust | Apache-2.0 | 3fbfa26ead0d3e5b38288b55abe3e2d636a97115 | 2026-01-04T20:19:54.636515Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.