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 |
|---|---|---|---|---|---|---|---|---|
cachebag/nmrs | https://github.com/cachebag/nmrs/blob/411987cb7691206b7135594ef65d3f37bc1e7958/nmrs-gui/src/ui/network_page.rs | nmrs-gui/src/ui/network_page.rs | use glib::clone;
use gtk::prelude::*;
use gtk::{Align, Box, Button, Image, Label, Orientation};
use nmrs::models::NetworkInfo;
use nmrs::NetworkManager;
use std::cell::RefCell;
use std::rc::Rc;
type OnSuccessCallback = Rc<RefCell<Option<Rc<dyn Fn()>>>>;
pub struct NetworkPage {
root: gtk::Box,
title: gtk::La... | rust | MIT | 411987cb7691206b7135594ef65d3f37bc1e7958 | 2026-01-04T20:24:43.919455Z | false |
cachebag/nmrs | https://github.com/cachebag/nmrs/blob/411987cb7691206b7135594ef65d3f37bc1e7958/nmrs-gui/src/objects/theme.rs | nmrs-gui/src/objects/theme.rs | use gtk::glib;
use gtk::subclass::prelude::ObjectSubclassIsExt;
mod imp {
use super::*;
use crate::objects::theme::glib::subclass::prelude::ObjectImpl;
use crate::objects::theme::glib::subclass::prelude::ObjectSubclass;
use std::cell::RefCell;
#[derive(Default)]
pub struct Theme {
pub ... | rust | MIT | 411987cb7691206b7135594ef65d3f37bc1e7958 | 2026-01-04T20:24:43.919455Z | false |
cachebag/nmrs | https://github.com/cachebag/nmrs/blob/411987cb7691206b7135594ef65d3f37bc1e7958/nmrs-gui/src/objects/mod.rs | nmrs-gui/src/objects/mod.rs | pub mod theme;
| rust | MIT | 411987cb7691206b7135594ef65d3f37bc1e7958 | 2026-01-04T20:24:43.919455Z | false |
cachebag/nmrs | https://github.com/cachebag/nmrs/blob/411987cb7691206b7135594ef65d3f37bc1e7958/nmrs-gui/tests/style_test.rs | nmrs-gui/tests/style_test.rs | #[test]
fn style_css_loads() {
if std::env::var("CI").is_ok() {
return;
}
gtk::init().unwrap();
nmrs_gui::style::load_css();
}
| rust | MIT | 411987cb7691206b7135594ef65d3f37bc1e7958 | 2026-01-04T20:24:43.919455Z | false |
cachebag/nmrs | https://github.com/cachebag/nmrs/blob/411987cb7691206b7135594ef65d3f37bc1e7958/nmrs-gui/tests/smoke_test.rs | nmrs-gui/tests/smoke_test.rs | #[test]
fn app_initializes_without_panic() {
// Skip when no display (e.g. in CI)
if std::env::var("CI").is_ok() {
return;
}
gtk::init().unwrap();
let result = std::panic::catch_unwind(|| {
nmrs_gui::run().ok();
});
assert!(result.is_ok(), "UI startup panicked");
}
| rust | MIT | 411987cb7691206b7135594ef65d3f37bc1e7958 | 2026-01-04T20:24:43.919455Z | false |
Harry-027/DocuMind | https://github.com/Harry-027/DocuMind/blob/581cb154e57dbc439bcbd3c7f13b5bcff00be228/server/src/handlers.rs | server/src/handlers.rs | use axum::{
extract::{Multipart, Path, State},
http::StatusCode,
response::IntoResponse,
Json,
};
use serde::{Deserialize, Serialize};
use tracing::debug;
use crate::{
utils::{extract_file_content, read_file},
AppState,
};
#[derive(Deserialize)]
pub struct InputPrompt {
user_query: String,... | rust | MIT | 581cb154e57dbc439bcbd3c7f13b5bcff00be228 | 2026-01-04T20:23:43.479737Z | false |
Harry-027/DocuMind | https://github.com/Harry-027/DocuMind/blob/581cb154e57dbc439bcbd3c7f13b5bcff00be228/server/src/processor.rs | server/src/processor.rs | use tokio::task;
use tracing::debug;
use uuid::Uuid;
use crate::{
utils::{
chunk_text, extract_file_content, get_content_embeddings, send_request, ConfigVar,
ModelKind,
},
vector_db::VectorStore,
};
use anyhow::{anyhow, Context, Ok, Result};
pub struct Processor {
pub settings: Config... | rust | MIT | 581cb154e57dbc439bcbd3c7f13b5bcff00be228 | 2026-01-04T20:23:43.479737Z | false |
Harry-027/DocuMind | https://github.com/Harry-027/DocuMind/blob/581cb154e57dbc439bcbd3c7f13b5bcff00be228/server/src/utils.rs | server/src/utils.rs | use std::{fs, io::Write};
use axum::{
extract::{Multipart, Request},
middleware,
response::Response,
};
use reqwest::Client;
use serde_json::json;
use config::{Config, FileFormat};
use tracing::{debug, info};
use anyhow::{anyhow, Context, Ok, Result};
pub enum ModelKind {
Generate,
Embedding,
}
... | rust | MIT | 581cb154e57dbc439bcbd3c7f13b5bcff00be228 | 2026-01-04T20:23:43.479737Z | false |
Harry-027/DocuMind | https://github.com/Harry-027/DocuMind/blob/581cb154e57dbc439bcbd3c7f13b5bcff00be228/server/src/vector_db.rs | server/src/vector_db.rs | use std::collections::HashMap;
use anyhow::{anyhow, Context, Ok, Result};
use qdrant_client::{
qdrant::{
CreateCollectionBuilder, Distance, PointId, PointStruct, SearchPoints, UpsertPointsBuilder,
Value, VectorParamsBuilder, Vectors,
},
Qdrant,
};
use tracing::info;
pub struct VectorStore ... | rust | MIT | 581cb154e57dbc439bcbd3c7f13b5bcff00be228 | 2026-01-04T20:23:43.479737Z | false |
Harry-027/DocuMind | https://github.com/Harry-027/DocuMind/blob/581cb154e57dbc439bcbd3c7f13b5bcff00be228/server/src/main.rs | server/src/main.rs | mod handlers;
mod processor;
mod utils;
mod vector_db;
use std::sync::Arc;
use axum::{
middleware,
routing::{get, post},
Router,
};
use handlers::{doc_names, file_handler, prompt_handler, upload_file};
use processor::Processor;
use tracing::info;
use tracing_subscriber;
use utils::{get_settings, log_reque... | rust | MIT | 581cb154e57dbc439bcbd3c7f13b5bcff00be228 | 2026-01-04T20:23:43.479737Z | false |
Harry-027/DocuMind | https://github.com/Harry-027/DocuMind/blob/581cb154e57dbc439bcbd3c7f13b5bcff00be228/client/src-tauri/build.rs | client/src-tauri/build.rs | fn main() {
tauri_build::build()
}
| rust | MIT | 581cb154e57dbc439bcbd3c7f13b5bcff00be228 | 2026-01-04T20:23:43.479737Z | false |
Harry-027/DocuMind | https://github.com/Harry-027/DocuMind/blob/581cb154e57dbc439bcbd3c7f13b5bcff00be228/client/src-tauri/src/lib.rs | client/src-tauri/src/lib.rs | use base64::decode;
use regex::Regex;
use reqwest::multipart::{Form, Part};
use serde::{Deserialize, Serialize};
use reqwest;
use serde_json::json;
// Structs for API responses and requests
#[derive(Clone, Debug, Deserialize, Serialize)]
struct ListItem {
name: String,
}
fn get_backend_url() -> String {
let b... | rust | MIT | 581cb154e57dbc439bcbd3c7f13b5bcff00be228 | 2026-01-04T20:23:43.479737Z | false |
Harry-027/DocuMind | https://github.com/Harry-027/DocuMind/blob/581cb154e57dbc439bcbd3c7f13b5bcff00be228/client/src-tauri/src/main.rs | client/src-tauri/src/main.rs | // Prevents additional console window on Windows in release, DO NOT REMOVE!!
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
use std::env;
use dotenv::dotenv;
fn main() {
dotenv().ok();
env::var("BACKEND_URL").expect("BACKEND_URL not found");
documind_lib::run()
}
| rust | MIT | 581cb154e57dbc439bcbd3c7f13b5bcff00be228 | 2026-01-04T20:23:43.479737Z | false |
Kudaes/Bin-Finder | https://github.com/Kudaes/Bin-Finder/blob/31a0ce7f22fd2ea5e32f5fa9a56a446127fcf66f/build.rs | build.rs | fn main()
{
static_vcruntime::metabuild();
} | rust | Apache-2.0 | 31a0ce7f22fd2ea5e32f5fa9a56a446127fcf66f | 2026-01-04T20:24:46.785945Z | false |
Kudaes/Bin-Finder | https://github.com/Kudaes/Bin-Finder/blob/31a0ce7f22fd2ea5e32f5fa9a56a446127fcf66f/dinvoke/src/lib.rs | dinvoke/src/lib.rs | #[macro_use]
extern crate litcrypt;
use_litcrypt!();
use std::cell::UnsafeCell;
use std::mem::size_of;
use std::panic;
use std::{collections::HashMap, ptr};
use std::ffi::CString;
use bindings::Windows::Win32::System::Diagnostics::Debug::{GetThreadContext,SetThreadContext};
use bindings::Windows::Win32::System::Kernel... | rust | Apache-2.0 | 31a0ce7f22fd2ea5e32f5fa9a56a446127fcf66f | 2026-01-04T20:24:46.785945Z | true |
Kudaes/Bin-Finder | https://github.com/Kudaes/Bin-Finder/blob/31a0ce7f22fd2ea5e32f5fa9a56a446127fcf66f/src/main.rs | src/main.rs | #[macro_use]
extern crate litcrypt;
use_litcrypt!();
use std::mem::size_of;
use std::{ptr, env};
use std::{collections::BTreeSet, iter::FromIterator};
use winproc::Process;
use bindings::Windows::Win32::System::WindowsProgramming::IO_STATUS_BLOCK;
use bindings::Windows::Win32::Foundation::HANDLE;
use data::{PVOID, FI... | rust | Apache-2.0 | 31a0ce7f22fd2ea5e32f5fa9a56a446127fcf66f | 2026-01-04T20:24:46.785945Z | false |
Kudaes/Bin-Finder | https://github.com/Kudaes/Bin-Finder/blob/31a0ce7f22fd2ea5e32f5fa9a56a446127fcf66f/bindings/build.rs | bindings/build.rs | fn main() {
windows::build!(
Windows::Win32::System::Diagnostics::Debug::{GetThreadContext,SetThreadContext,IMAGE_FILE_HEADER,IMAGE_OPTIONAL_HEADER32,IMAGE_SECTION_HEADER,
IMAGE_DATA_DIRECTORY,IMAGE_OPTIONAL_HEADER_MAGIC,IMAGE_SUBSYSTEM,EXCEPTION_RECORD},
Windows::Win32::System::Memory::... | rust | Apache-2.0 | 31a0ce7f22fd2ea5e32f5fa9a56a446127fcf66f | 2026-01-04T20:24:46.785945Z | false |
Kudaes/Bin-Finder | https://github.com/Kudaes/Bin-Finder/blob/31a0ce7f22fd2ea5e32f5fa9a56a446127fcf66f/bindings/src/lib.rs | bindings/src/lib.rs | windows::include_bindings!(); | rust | Apache-2.0 | 31a0ce7f22fd2ea5e32f5fa9a56a446127fcf66f | 2026-01-04T20:24:46.785945Z | false |
Kudaes/Bin-Finder | https://github.com/Kudaes/Bin-Finder/blob/31a0ce7f22fd2ea5e32f5fa9a56a446127fcf66f/data/src/lib.rs | data/src/lib.rs | use std::{collections::BTreeMap, ffi::c_void};
use bindings::Windows::Win32::{Foundation::{BOOL, HANDLE, HINSTANCE, PSTR}, System::{Diagnostics::Debug::{IMAGE_DATA_DIRECTORY, IMAGE_OPTIONAL_HEADER32, IMAGE_SECTION_HEADER, EXCEPTION_RECORD}, Kernel::UNICODE_STRING, WindowsProgramming::{OBJECT_ATTRIBUTES, IO_STATUS_BLOCK... | rust | Apache-2.0 | 31a0ce7f22fd2ea5e32f5fa9a56a446127fcf66f | 2026-01-04T20:24:46.785945Z | false |
EightB1ts/uni-sync | https://github.com/EightB1ts/uni-sync/blob/05f39462178b60f590bfd9daa3b4863038c0f6ad/src/main.rs | src/main.rs | use std::env;
use std::path::PathBuf;
mod devices;
fn main() -> Result<(), std::io::Error> {
let mut configs = devices::Configs {
configs: vec![]
};
let args: Vec<String> = env::args().collect();
let mut config_path: PathBuf = env::current_exe()?;
if args.len() == 2 {
config_path... | rust | MIT | 05f39462178b60f590bfd9daa3b4863038c0f6ad | 2026-01-04T20:24:49.606579Z | false |
EightB1ts/uni-sync | https://github.com/EightB1ts/uni-sync/blob/05f39462178b60f590bfd9daa3b4863038c0f6ad/src/devices/mod.rs | src/devices/mod.rs | use serde_derive::{Deserialize, Serialize};
use hidapi::{self, HidDevice};
use std::{thread, time};
#[derive(Serialize, Deserialize, Clone)]
pub struct Configs {
pub configs: Vec<Config>
}
#[derive(Serialize, Deserialize, Clone)]
pub struct Config {
pub device_id: String,
pub sync_rgb: bool,
pub chann... | rust | MIT | 05f39462178b60f590bfd9daa3b4863038c0f6ad | 2026-01-04T20:24:49.606579Z | false |
oxidecomputer/usdt | https://github.com/oxidecomputer/usdt/blob/709b613326d26ace9168c923b03c752aeef505f2/dusty/src/main.rs | dusty/src/main.rs | //! Tool to inspect the representation of USDT probes in object files.
// Copyright 2021 Oxide Computer Company
//
// 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.apach... | rust | Apache-2.0 | 709b613326d26ace9168c923b03c752aeef505f2 | 2026-01-04T20:24:42.431196Z | false |
oxidecomputer/usdt | https://github.com/oxidecomputer/usdt/blob/709b613326d26ace9168c923b03c752aeef505f2/probe-test-build/build.rs | probe-test-build/build.rs | // Copyright 2022 Oxide Computer Company
//
// 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 ag... | rust | Apache-2.0 | 709b613326d26ace9168c923b03c752aeef505f2 | 2026-01-04T20:24:42.431196Z | false |
oxidecomputer/usdt | https://github.com/oxidecomputer/usdt/blob/709b613326d26ace9168c923b03c752aeef505f2/probe-test-build/src/main.rs | probe-test-build/src/main.rs | //! An example using the `usdt` crate, generating the probes via a build script.
// Copyright 2022 Oxide Computer Company
//
// 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:/... | rust | Apache-2.0 | 709b613326d26ace9168c923b03c752aeef505f2 | 2026-01-04T20:24:42.431196Z | false |
oxidecomputer/usdt | https://github.com/oxidecomputer/usdt/blob/709b613326d26ace9168c923b03c752aeef505f2/usdt-tests-common/src/lib.rs | usdt-tests-common/src/lib.rs | // Copyright 2024 Oxide Computer Company
//
// 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 ag... | rust | Apache-2.0 | 709b613326d26ace9168c923b03c752aeef505f2 | 2026-01-04T20:24:42.431196Z | false |
oxidecomputer/usdt | https://github.com/oxidecomputer/usdt/blob/709b613326d26ace9168c923b03c752aeef505f2/dtrace-parser/src/lib.rs | dtrace-parser/src/lib.rs | //! A small library for parsing DTrace provider files.
// Copyright 2021 Oxide Computer Company
//
// 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/L... | rust | Apache-2.0 | 709b613326d26ace9168c923b03c752aeef505f2 | 2026-01-04T20:24:42.431196Z | false |
oxidecomputer/usdt | https://github.com/oxidecomputer/usdt/blob/709b613326d26ace9168c923b03c752aeef505f2/tests/empty/build.rs | tests/empty/build.rs | // Copyright 2022 Oxide Computer Company
//
// 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 ag... | rust | Apache-2.0 | 709b613326d26ace9168c923b03c752aeef505f2 | 2026-01-04T20:24:42.431196Z | false |
oxidecomputer/usdt | https://github.com/oxidecomputer/usdt/blob/709b613326d26ace9168c923b03c752aeef505f2/tests/empty/src/main.rs | tests/empty/src/main.rs | // Copyright 2022 Oxide Computer Company
//
// 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 ag... | rust | Apache-2.0 | 709b613326d26ace9168c923b03c752aeef505f2 | 2026-01-04T20:24:42.431196Z | false |
oxidecomputer/usdt | https://github.com/oxidecomputer/usdt/blob/709b613326d26ace9168c923b03c752aeef505f2/tests/test-json/src/main.rs | tests/test-json/src/main.rs | //! Integration test verifying JSON output, including when serialization fails.
// Copyright 2024 Oxide Computer Company
//
// 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://... | rust | Apache-2.0 | 709b613326d26ace9168c923b03c752aeef505f2 | 2026-01-04T20:24:42.431196Z | false |
oxidecomputer/usdt | https://github.com/oxidecomputer/usdt/blob/709b613326d26ace9168c923b03c752aeef505f2/tests/does-it-work/build.rs | tests/does-it-work/build.rs | // Copyright 2022 Oxide Computer Company
//
// 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 ag... | rust | Apache-2.0 | 709b613326d26ace9168c923b03c752aeef505f2 | 2026-01-04T20:24:42.431196Z | false |
oxidecomputer/usdt | https://github.com/oxidecomputer/usdt/blob/709b613326d26ace9168c923b03c752aeef505f2/tests/does-it-work/src/main.rs | tests/does-it-work/src/main.rs | //! Small example which tests that this whole thing works. Specifically, this constructs and
//! registers a single probe with arguments, and then verifies that this probe is visible to the
//! `dtrace(1)` command-line tool.
// Copyright 2024 Oxide Computer Company
//
// Licensed under the Apache License, Version 2.0 ... | rust | Apache-2.0 | 709b613326d26ace9168c923b03c752aeef505f2 | 2026-01-04T20:24:42.431196Z | false |
oxidecomputer/usdt | https://github.com/oxidecomputer/usdt/blob/709b613326d26ace9168c923b03c752aeef505f2/tests/rename/src/main.rs | tests/rename/src/main.rs | //! Integration test verifying that provider modules are renamed correctly.
// Copyright 2022 Oxide Computer Company
//
// 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.... | rust | Apache-2.0 | 709b613326d26ace9168c923b03c752aeef505f2 | 2026-01-04T20:24:42.431196Z | false |
oxidecomputer/usdt | https://github.com/oxidecomputer/usdt/blob/709b613326d26ace9168c923b03c752aeef505f2/tests/usize/src/main.rs | tests/usize/src/main.rs | //! Integration test verifying that we correctly compile usize/isize probes.
// Copyright 2023 Oxide Computer Company
//
// 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... | rust | Apache-2.0 | 709b613326d26ace9168c923b03c752aeef505f2 | 2026-01-04T20:24:42.431196Z | false |
oxidecomputer/usdt | https://github.com/oxidecomputer/usdt/blob/709b613326d26ace9168c923b03c752aeef505f2/tests/fake-lib/build.rs | tests/fake-lib/build.rs | // Copyright 2022 Oxide Computer Company
//
// 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 ag... | rust | Apache-2.0 | 709b613326d26ace9168c923b03c752aeef505f2 | 2026-01-04T20:24:42.431196Z | false |
oxidecomputer/usdt | https://github.com/oxidecomputer/usdt/blob/709b613326d26ace9168c923b03c752aeef505f2/tests/fake-lib/src/lib.rs | tests/fake-lib/src/lib.rs | // Copyright 2022 Oxide Computer Company
//
// 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 ag... | rust | Apache-2.0 | 709b613326d26ace9168c923b03c752aeef505f2 | 2026-01-04T20:24:42.431196Z | false |
oxidecomputer/usdt | https://github.com/oxidecomputer/usdt/blob/709b613326d26ace9168c923b03c752aeef505f2/tests/compile-errors/src/lib.rs | tests/compile-errors/src/lib.rs | // Copyright 2022 Oxide Computer Company
//
// 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 ag... | rust | Apache-2.0 | 709b613326d26ace9168c923b03c752aeef505f2 | 2026-01-04T20:24:42.431196Z | false |
oxidecomputer/usdt | https://github.com/oxidecomputer/usdt/blob/709b613326d26ace9168c923b03c752aeef505f2/tests/compile-errors/src/no-closure.rs | tests/compile-errors/src/no-closure.rs | // Copyright 2022 Oxide Computer Company
//
// 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 ag... | rust | Apache-2.0 | 709b613326d26ace9168c923b03c752aeef505f2 | 2026-01-04T20:24:42.431196Z | false |
oxidecomputer/usdt | https://github.com/oxidecomputer/usdt/blob/709b613326d26ace9168c923b03c752aeef505f2/tests/compile-errors/src/zero-arg-probe-type-check.rs | tests/compile-errors/src/zero-arg-probe-type-check.rs | //! Test that a zero-argument probe is correctly type-checked
// Copyright 2022 Oxide Computer Company
//
// 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/lic... | rust | Apache-2.0 | 709b613326d26ace9168c923b03c752aeef505f2 | 2026-01-04T20:24:42.431196Z | false |
oxidecomputer/usdt | https://github.com/oxidecomputer/usdt/blob/709b613326d26ace9168c923b03c752aeef505f2/tests/compile-errors/src/different-serializable-type.rs | tests/compile-errors/src/different-serializable-type.rs | //! Test that passing a type that is serializable, but not the same concrete type as the probe
//! signature, fails compilation.
// Copyright 2022 Oxide Computer Company
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may ... | rust | Apache-2.0 | 709b613326d26ace9168c923b03c752aeef505f2 | 2026-01-04T20:24:42.431196Z | false |
oxidecomputer/usdt | https://github.com/oxidecomputer/usdt/blob/709b613326d26ace9168c923b03c752aeef505f2/tests/compile-errors/src/relative-import.rs | tests/compile-errors/src/relative-import.rs | //! Test that we can't name types into the provider module using a relative import
// Copyright 2021 Oxide Computer Company
//
// 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... | rust | Apache-2.0 | 709b613326d26ace9168c923b03c752aeef505f2 | 2026-01-04T20:24:42.431196Z | false |
oxidecomputer/usdt | https://github.com/oxidecomputer/usdt/blob/709b613326d26ace9168c923b03c752aeef505f2/tests/compile-errors/src/type-mismatch.rs | tests/compile-errors/src/type-mismatch.rs | // Copyright 2022 Oxide Computer Company
//
// 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 ag... | rust | Apache-2.0 | 709b613326d26ace9168c923b03c752aeef505f2 | 2026-01-04T20:24:42.431196Z | false |
oxidecomputer/usdt | https://github.com/oxidecomputer/usdt/blob/709b613326d26ace9168c923b03c752aeef505f2/tests/compile-errors/src/no-provider-file.rs | tests/compile-errors/src/no-provider-file.rs | // Copyright 2022 Oxide Computer Company
//
// 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 ag... | rust | Apache-2.0 | 709b613326d26ace9168c923b03c752aeef505f2 | 2026-01-04T20:24:42.431196Z | false |
oxidecomputer/usdt | https://github.com/oxidecomputer/usdt/blob/709b613326d26ace9168c923b03c752aeef505f2/tests/compile-errors/src/unsupported-type.rs | tests/compile-errors/src/unsupported-type.rs | // Copyright 2022 Oxide Computer Company
//
// 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 ag... | rust | Apache-2.0 | 709b613326d26ace9168c923b03c752aeef505f2 | 2026-01-04T20:24:42.431196Z | false |
oxidecomputer/usdt | https://github.com/oxidecomputer/usdt/blob/709b613326d26ace9168c923b03c752aeef505f2/tests/test-unique-id/src/main.rs | tests/test-unique-id/src/main.rs | //! Integration test for `usdt::UniqueId`
// Copyright 2022 Oxide Computer Company
//
// 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
//... | rust | Apache-2.0 | 709b613326d26ace9168c923b03c752aeef505f2 | 2026-01-04T20:24:42.431196Z | false |
oxidecomputer/usdt | https://github.com/oxidecomputer/usdt/blob/709b613326d26ace9168c923b03c752aeef505f2/tests/argument-types/src/main.rs | tests/argument-types/src/main.rs | //! An example and compile-test showing the various ways in which probe arguments may be specified,
//! both in the parameter list and when passing values in the probe argument closure.
// Copyright 2022 Oxide Computer Company
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use thi... | rust | Apache-2.0 | 709b613326d26ace9168c923b03c752aeef505f2 | 2026-01-04T20:24:42.431196Z | false |
oxidecomputer/usdt | https://github.com/oxidecomputer/usdt/blob/709b613326d26ace9168c923b03c752aeef505f2/tests/modules/src/inner.rs | tests/modules/src/inner.rs | // Copyright 2021 Oxide Computer Company
//
// 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 ag... | rust | Apache-2.0 | 709b613326d26ace9168c923b03c752aeef505f2 | 2026-01-04T20:24:42.431196Z | false |
oxidecomputer/usdt | https://github.com/oxidecomputer/usdt/blob/709b613326d26ace9168c923b03c752aeef505f2/tests/modules/src/main.rs | tests/modules/src/main.rs | // Copyright 2022 Oxide Computer Company
//
// 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 ag... | rust | Apache-2.0 | 709b613326d26ace9168c923b03c752aeef505f2 | 2026-01-04T20:24:42.431196Z | false |
oxidecomputer/usdt | https://github.com/oxidecomputer/usdt/blob/709b613326d26ace9168c923b03c752aeef505f2/tests/zero-arg-probe/build.rs | tests/zero-arg-probe/build.rs | // Copyright 2022 Oxide Computer Company
//
// 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 ag... | rust | Apache-2.0 | 709b613326d26ace9168c923b03c752aeef505f2 | 2026-01-04T20:24:42.431196Z | false |
oxidecomputer/usdt | https://github.com/oxidecomputer/usdt/blob/709b613326d26ace9168c923b03c752aeef505f2/tests/zero-arg-probe/src/main.rs | tests/zero-arg-probe/src/main.rs | // Copyright 2022 Oxide Computer Company
//
// 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 ag... | rust | Apache-2.0 | 709b613326d26ace9168c923b03c752aeef505f2 | 2026-01-04T20:24:42.431196Z | false |
oxidecomputer/usdt | https://github.com/oxidecomputer/usdt/blob/709b613326d26ace9168c923b03c752aeef505f2/tests/fake-cmd/src/main.rs | tests/fake-cmd/src/main.rs | // Copyright 2022 Oxide Computer Company
//
// 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 ag... | rust | Apache-2.0 | 709b613326d26ace9168c923b03c752aeef505f2 | 2026-01-04T20:24:42.431196Z | false |
oxidecomputer/usdt | https://github.com/oxidecomputer/usdt/blob/709b613326d26ace9168c923b03c752aeef505f2/tests/rename-builder/build.rs | tests/rename-builder/build.rs | // Copyright 2022 Oxide Computer Company
//
// 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 ag... | rust | Apache-2.0 | 709b613326d26ace9168c923b03c752aeef505f2 | 2026-01-04T20:24:42.431196Z | false |
oxidecomputer/usdt | https://github.com/oxidecomputer/usdt/blob/709b613326d26ace9168c923b03c752aeef505f2/tests/rename-builder/src/main.rs | tests/rename-builder/src/main.rs | //! Test verifying that renaming the provider/probes in various ways works when using a build
//! script.
// Copyright 2022 Oxide Computer Company
//
// 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 Li... | rust | Apache-2.0 | 709b613326d26ace9168c923b03c752aeef505f2 | 2026-01-04T20:24:42.431196Z | false |
oxidecomputer/usdt | https://github.com/oxidecomputer/usdt/blob/709b613326d26ace9168c923b03c752aeef505f2/usdt-impl/build.rs | usdt-impl/build.rs | // Copyright 2022 Oxide Computer Company
//
// 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 ag... | rust | Apache-2.0 | 709b613326d26ace9168c923b03c752aeef505f2 | 2026-01-04T20:24:42.431196Z | false |
oxidecomputer/usdt | https://github.com/oxidecomputer/usdt/blob/709b613326d26ace9168c923b03c752aeef505f2/usdt-impl/src/lib.rs | usdt-impl/src/lib.rs | //! Main implementation crate for the USDT package.
// Copyright 2022 Oxide Computer Company
//
// 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/LICE... | rust | Apache-2.0 | 709b613326d26ace9168c923b03c752aeef505f2 | 2026-01-04T20:24:42.431196Z | false |
oxidecomputer/usdt | https://github.com/oxidecomputer/usdt/blob/709b613326d26ace9168c923b03c752aeef505f2/usdt-impl/src/empty.rs | usdt-impl/src/empty.rs | //! The empty implementation of the USDT crate.
//!
//! Used on platforms without DTrace.
// Copyright 2024 Oxide Computer Company
//
// 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
//
// ... | rust | Apache-2.0 | 709b613326d26ace9168c923b03c752aeef505f2 | 2026-01-04T20:24:42.431196Z | false |
oxidecomputer/usdt | https://github.com/oxidecomputer/usdt/blob/709b613326d26ace9168c923b03c752aeef505f2/usdt-impl/src/record.rs | usdt-impl/src/record.rs | //! Implementation of construction and extraction of custom linker section records used to store
//! probe information in an object file.
// Copyright 2024 Oxide Computer Company
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
//... | rust | Apache-2.0 | 709b613326d26ace9168c923b03c752aeef505f2 | 2026-01-04T20:24:42.431196Z | false |
oxidecomputer/usdt | https://github.com/oxidecomputer/usdt/blob/709b613326d26ace9168c923b03c752aeef505f2/usdt-impl/src/common.rs | usdt-impl/src/common.rs | //! Shared code used in both the linker and no-linker implementations of this crate.
// Copyright 2024 Oxide Computer Company
//
// 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
//
// ht... | rust | Apache-2.0 | 709b613326d26ace9168c923b03c752aeef505f2 | 2026-01-04T20:24:42.431196Z | false |
oxidecomputer/usdt | https://github.com/oxidecomputer/usdt/blob/709b613326d26ace9168c923b03c752aeef505f2/usdt-impl/src/linker.rs | usdt-impl/src/linker.rs | //! USDT implementation on platforms with linker support (macOS).
//!
//! On systems with linker support for the compile-time construction of DTrace
//! USDT probes we can lean heavily on those mechanisms. Rather than interpreting
//! the provider file ourselves, we invoke the system's `dtrace -h` to generate a C
//! h... | rust | Apache-2.0 | 709b613326d26ace9168c923b03c752aeef505f2 | 2026-01-04T20:24:42.431196Z | false |
oxidecomputer/usdt | https://github.com/oxidecomputer/usdt/blob/709b613326d26ace9168c923b03c752aeef505f2/usdt-impl/src/stapsdt.rs | usdt-impl/src/stapsdt.rs | // Copyright 2024 Oxide Computer Company
//
// 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 ag... | rust | Apache-2.0 | 709b613326d26ace9168c923b03c752aeef505f2 | 2026-01-04T20:24:42.431196Z | false |
oxidecomputer/usdt | https://github.com/oxidecomputer/usdt/blob/709b613326d26ace9168c923b03c752aeef505f2/usdt-impl/src/no-linker.rs | usdt-impl/src/no-linker.rs | //! Implementation of USDT functionality on platforms without runtime linker support.
// Copyright 2022 Oxide Computer Company
//
// 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
//
// h... | rust | Apache-2.0 | 709b613326d26ace9168c923b03c752aeef505f2 | 2026-01-04T20:24:42.431196Z | false |
oxidecomputer/usdt | https://github.com/oxidecomputer/usdt/blob/709b613326d26ace9168c923b03c752aeef505f2/usdt-impl/src/stapsdt/args.rs | usdt-impl/src/stapsdt/args.rs | // Copyright 2024 Aapo Alasuutari
//
// 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 to... | rust | Apache-2.0 | 709b613326d26ace9168c923b03c752aeef505f2 | 2026-01-04T20:24:42.431196Z | false |
oxidecomputer/usdt | https://github.com/oxidecomputer/usdt/blob/709b613326d26ace9168c923b03c752aeef505f2/usdt-macro/src/lib.rs | usdt-macro/src/lib.rs | //! Prototype proc-macro crate for parsing a DTrace provider definition into Rust code.
// Copyright 2021 Oxide Computer Company
//
// 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
//
// ... | rust | Apache-2.0 | 709b613326d26ace9168c923b03c752aeef505f2 | 2026-01-04T20:24:42.431196Z | false |
oxidecomputer/usdt | https://github.com/oxidecomputer/usdt/blob/709b613326d26ace9168c923b03c752aeef505f2/probe-test-macro/src/main.rs | probe-test-macro/src/main.rs | //! An example using the `usdt` crate, generating the probes via a procedural macro
// Copyright 2022 Oxide Computer Company
//
// 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
//
// htt... | rust | Apache-2.0 | 709b613326d26ace9168c923b03c752aeef505f2 | 2026-01-04T20:24:42.431196Z | false |
oxidecomputer/usdt | https://github.com/oxidecomputer/usdt/blob/709b613326d26ace9168c923b03c752aeef505f2/dof/src/ser.rs | dof/src/ser.rs | //! Functions to serialize crate types into DOF.
// Copyright 2021 Oxide Computer Company
//
// 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... | rust | Apache-2.0 | 709b613326d26ace9168c923b03c752aeef505f2 | 2026-01-04T20:24:42.431196Z | false |
oxidecomputer/usdt | https://github.com/oxidecomputer/usdt/blob/709b613326d26ace9168c923b03c752aeef505f2/dof/src/lib.rs | dof/src/lib.rs | //! Tools for extracting and parsing data in DTrace Object Format (DOF).
//!
//! The `dof` crate provides types and functions for reading and writing the DTrace Object Format,
//! an ELF-like serialization format used to store information about DTrace providers and probes in
//! object files. DOF sections are generated... | rust | Apache-2.0 | 709b613326d26ace9168c923b03c752aeef505f2 | 2026-01-04T20:24:42.431196Z | false |
oxidecomputer/usdt | https://github.com/oxidecomputer/usdt/blob/709b613326d26ace9168c923b03c752aeef505f2/dof/src/dof.rs | dof/src/dof.rs | //! Types representing DTrace Object Format data structures.
//!
//! The [`Section`] struct is used to represent a complete DTrace Object Format section as
//! contained in an object file. It contains one or more [`Provider`]s, each with one or more
//! [`Probe`]s. The `Probe` type contains all the information required... | rust | Apache-2.0 | 709b613326d26ace9168c923b03c752aeef505f2 | 2026-01-04T20:24:42.431196Z | false |
oxidecomputer/usdt | https://github.com/oxidecomputer/usdt/blob/709b613326d26ace9168c923b03c752aeef505f2/dof/src/des.rs | dof/src/des.rs | //! Functions to deserialize crate types from DOF.
// Copyright 2021 Oxide Computer Company
//
// 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/LICEN... | rust | Apache-2.0 | 709b613326d26ace9168c923b03c752aeef505f2 | 2026-01-04T20:24:42.431196Z | false |
oxidecomputer/usdt | https://github.com/oxidecomputer/usdt/blob/709b613326d26ace9168c923b03c752aeef505f2/dof/src/dof_bindings.rs | dof/src/dof_bindings.rs | //! Auto-generated bindings to the DOF-related types in `dtrace.h`
/* automatically generated by rust-bindgen 0.57.0 */
#![allow(non_camel_case_types)]
use zerocopy::{FromBytes, Immutable, IntoBytes, KnownLayout};
pub const DIF_VERSION_1: u32 = 1;
pub const DIF_VERSION_2: u32 = 2;
pub const DIF_VERSION: u32 = 2;
pub... | rust | Apache-2.0 | 709b613326d26ace9168c923b03c752aeef505f2 | 2026-01-04T20:24:42.431196Z | false |
oxidecomputer/usdt | https://github.com/oxidecomputer/usdt/blob/709b613326d26ace9168c923b03c752aeef505f2/dof/src/fmt.rs | dof/src/fmt.rs | //! Functions to format types from DOF.
// Copyright 2021 Oxide Computer Company
//
// 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
//
/... | rust | Apache-2.0 | 709b613326d26ace9168c923b03c752aeef505f2 | 2026-01-04T20:24:42.431196Z | false |
oxidecomputer/usdt | https://github.com/oxidecomputer/usdt/blob/709b613326d26ace9168c923b03c752aeef505f2/probe-test-attr/src/main.rs | probe-test-attr/src/main.rs | //! Example using the `usdt` crate, defining probes inline in Rust code which accept any
//! serializable data type.
// Copyright 2022 Oxide Computer Company
//
// 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 cop... | rust | Apache-2.0 | 709b613326d26ace9168c923b03c752aeef505f2 | 2026-01-04T20:24:42.431196Z | false |
oxidecomputer/usdt | https://github.com/oxidecomputer/usdt/blob/709b613326d26ace9168c923b03c752aeef505f2/usdt-attr-macro/src/lib.rs | usdt-attr-macro/src/lib.rs | //! Generate USDT probes from an attribute macro
// Copyright 2024 Oxide Computer Company
//
// 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... | rust | Apache-2.0 | 709b613326d26ace9168c923b03c752aeef505f2 | 2026-01-04T20:24:42.431196Z | false |
oxidecomputer/usdt | https://github.com/oxidecomputer/usdt/blob/709b613326d26ace9168c923b03c752aeef505f2/usdt/src/lib.rs | usdt/src/lib.rs | // Copyright 2022 Oxide Computer Company
//
// 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 ag... | rust | Apache-2.0 | 709b613326d26ace9168c923b03c752aeef505f2 | 2026-01-04T20:24:42.431196Z | false |
Finomnis/tokio-graceful-shutdown | https://github.com/Finomnis/tokio-graceful-shutdown/blob/21f915e6cd39cd139c5ab4fa8199b9d87dc5aaa3/src/errors.rs | src/errors.rs | //! All the errors that can be caused by this crate.
use std::sync::Arc;
use miette::Diagnostic;
use thiserror::Error;
use tokio::sync::mpsc;
use crate::ErrTypeTraits;
/// This enum contains all the possible errors that could be returned
/// by [`handle_shutdown_requests()`](crate::Toplevel::handle_shutdown_request... | rust | Apache-2.0 | 21f915e6cd39cd139c5ab4fa8199b9d87dc5aaa3 | 2026-01-04T20:24:42.405407Z | false |
Finomnis/tokio-graceful-shutdown | https://github.com/Finomnis/tokio-graceful-shutdown/blob/21f915e6cd39cd139c5ab4fa8199b9d87dc5aaa3/src/signal_handling.rs | src/signal_handling.rs | use std::io;
/// Creates a future that waits for a signal that requests a graceful shutdown, like SIGTERM or SIGINT.
#[cfg(unix)]
fn register_signals_impl() -> io::Result<impl Future<Output = ()>> {
use tokio::signal::unix::{SignalKind, signal};
// Infos here:
// https://www.gnu.org/software/libc/manual/h... | rust | Apache-2.0 | 21f915e6cd39cd139c5ab4fa8199b9d87dc5aaa3 | 2026-01-04T20:24:42.405407Z | false |
Finomnis/tokio-graceful-shutdown | https://github.com/Finomnis/tokio-graceful-shutdown/blob/21f915e6cd39cd139c5ab4fa8199b9d87dc5aaa3/src/future_ext.rs | src/future_ext.rs | use crate::{SubsystemHandle, errors::CancelledByShutdown};
use pin_project_lite::pin_project;
use tokio_util::sync::WaitForCancellationFuture;
pin_project! {
/// A future that is resolved once the corresponding task is finished
/// or a shutdown is initiated.
#[must_use = "futures do nothing unless polle... | rust | Apache-2.0 | 21f915e6cd39cd139c5ab4fa8199b9d87dc5aaa3 | 2026-01-04T20:24:42.405407Z | false |
Finomnis/tokio-graceful-shutdown | https://github.com/Finomnis/tokio-graceful-shutdown/blob/21f915e6cd39cd139c5ab4fa8199b9d87dc5aaa3/src/lib.rs | src/lib.rs | //! This crate provides utility functions to perform a graceful shutdown on tokio-rs based services.
//!
//! Specifically, it provides:
//!
//! - Listening for shutdown requests from within subsystems
//! - Manual shutdown initiation from within subsystems
//! - Automatic shutdown on
//! - SIGINT/SIGTERM/Ctrl+C
//!... | rust | Apache-2.0 | 21f915e6cd39cd139c5ab4fa8199b9d87dc5aaa3 | 2026-01-04T20:24:42.405407Z | false |
Finomnis/tokio-graceful-shutdown | https://github.com/Finomnis/tokio-graceful-shutdown/blob/21f915e6cd39cd139c5ab4fa8199b9d87dc5aaa3/src/toplevel.rs | src/toplevel.rs | use std::{sync::Arc, time::Duration};
use atomic::Atomic;
use tokio::sync::mpsc;
use tokio_util::sync::CancellationToken;
use crate::{
AsyncSubsysFn, BoxedError, ErrTypeTraits, ErrorAction, NestedSubsystem, SubsystemHandle,
errors::{GracefulShutdownError, SubsystemError, handle_dropped_error},
signal_hand... | rust | Apache-2.0 | 21f915e6cd39cd139c5ab4fa8199b9d87dc5aaa3 | 2026-01-04T20:24:42.405407Z | false |
Finomnis/tokio-graceful-shutdown | https://github.com/Finomnis/tokio-graceful-shutdown/blob/21f915e6cd39cd139c5ab4fa8199b9d87dc5aaa3/src/into_subsystem.rs | src/into_subsystem.rs | use core::future::Future;
use std::pin::Pin;
use crate::{BoxedError, ErrTypeTraits, SubsystemHandle};
type IntoSubsystemFuture<'a, Err> = Pin<Box<dyn Future<Output = Result<(), Err>> + 'a + Send>>;
/// Allows a struct to be used as a subsystem.
///
/// Using a struct that does not implement this trait as a subsystem... | rust | Apache-2.0 | 21f915e6cd39cd139c5ab4fa8199b9d87dc5aaa3 | 2026-01-04T20:24:42.405407Z | false |
Finomnis/tokio-graceful-shutdown | https://github.com/Finomnis/tokio-graceful-shutdown/blob/21f915e6cd39cd139c5ab4fa8199b9d87dc5aaa3/src/runner.rs | src/runner.rs | //! The SubsystemRunner is a little tricky, so here some explanation.
//!
//! A two-layer `tokio::spawn` is required to make this work reliably; the inner `spawn` is the actual subsystem,
//! and the outer `spawn` carries out the duty of propagating the `StopReason` and cleaning up.
//!
//! Further, everything in here ... | rust | Apache-2.0 | 21f915e6cd39cd139c5ab4fa8199b9d87dc5aaa3 | 2026-01-04T20:24:42.405407Z | false |
Finomnis/tokio-graceful-shutdown | https://github.com/Finomnis/tokio-graceful-shutdown/blob/21f915e6cd39cd139c5ab4fa8199b9d87dc5aaa3/src/tokio_task.rs | src/tokio_task.rs | use std::future::Future;
use tokio::task::JoinHandle;
#[cfg(not(all(tokio_unstable, feature = "tracing")))]
#[track_caller]
pub(crate) fn spawn<F>(f: F, _name: &str) -> JoinHandle<F::Output>
where
F: Future + Send + 'static,
F::Output: Send + 'static,
{
tokio::spawn(f)
}
#[cfg(all(tokio_unstable, feature ... | rust | Apache-2.0 | 21f915e6cd39cd139c5ab4fa8199b9d87dc5aaa3 | 2026-01-04T20:24:42.405407Z | false |
Finomnis/tokio-graceful-shutdown | https://github.com/Finomnis/tokio-graceful-shutdown/blob/21f915e6cd39cd139c5ab4fa8199b9d87dc5aaa3/src/error_action.rs | src/error_action.rs | use bytemuck::NoUninit;
/// Possible ways a subsystem can react to errors.
///
/// An error will propagate upwards in the subsystem tree until
/// it reaches a subsystem that won't forward it to its parent.
///
/// If an error reaches the [`Toplevel`](crate::Toplevel), a global shutdown will be initiated.
///
/// Also... | rust | Apache-2.0 | 21f915e6cd39cd139c5ab4fa8199b9d87dc5aaa3 | 2026-01-04T20:24:42.405407Z | false |
Finomnis/tokio-graceful-shutdown | https://github.com/Finomnis/tokio-graceful-shutdown/blob/21f915e6cd39cd139c5ab4fa8199b9d87dc5aaa3/src/errors/tests.rs | src/errors/tests.rs | use tracing_test::traced_test;
use crate::BoxedError;
use super::*;
#[allow(clippy::uninlined_format_args)]
fn examine_report(error: impl miette::Diagnostic + Sync + Send + 'static) {
println!("{}", error);
println!("{:?}", error);
println!("{:?}", error.source());
println!("{}", error.code().unwrap(... | rust | Apache-2.0 | 21f915e6cd39cd139c5ab4fa8199b9d87dc5aaa3 | 2026-01-04T20:24:42.405407Z | false |
Finomnis/tokio-graceful-shutdown | https://github.com/Finomnis/tokio-graceful-shutdown/blob/21f915e6cd39cd139c5ab4fa8199b9d87dc5aaa3/src/utils/mod.rs | src/utils/mod.rs | mod joiner_token;
pub(crate) use joiner_token::JoinerToken;
pub(crate) use joiner_token::JoinerTokenRef;
pub(crate) mod remote_drop_collection;
| rust | Apache-2.0 | 21f915e6cd39cd139c5ab4fa8199b9d87dc5aaa3 | 2026-01-04T20:24:42.405407Z | false |
Finomnis/tokio-graceful-shutdown | https://github.com/Finomnis/tokio-graceful-shutdown/blob/21f915e6cd39cd139c5ab4fa8199b9d87dc5aaa3/src/utils/remote_drop_collection.rs | src/utils/remote_drop_collection.rs | use std::sync::{
Arc, Mutex, Weak,
atomic::{AtomicUsize, Ordering},
};
struct RemotelyDroppableItem<T> {
_item: T,
offset: Arc<AtomicUsize>,
}
/// A vector that owns a bunch of objects.
/// Every object is connected to a guard token.
/// Once the token is dropped, the object gets dropped as well.
///
... | rust | Apache-2.0 | 21f915e6cd39cd139c5ab4fa8199b9d87dc5aaa3 | 2026-01-04T20:24:42.405407Z | false |
Finomnis/tokio-graceful-shutdown | https://github.com/Finomnis/tokio-graceful-shutdown/blob/21f915e6cd39cd139c5ab4fa8199b9d87dc5aaa3/src/utils/joiner_token.rs | src/utils/joiner_token.rs | use std::{fmt::Debug, sync::Arc};
use tokio::sync::watch;
use crate::{
ErrTypeTraits,
errors::{SubsystemError, handle_unhandled_stopreason},
};
struct Inner<ErrType: ErrTypeTraits> {
counter: watch::Sender<(bool, u32)>,
parent: Option<Arc<Inner<ErrType>>>,
on_error: Box<dyn Fn(SubsystemError<ErrT... | rust | Apache-2.0 | 21f915e6cd39cd139c5ab4fa8199b9d87dc5aaa3 | 2026-01-04T20:24:42.405407Z | false |
Finomnis/tokio-graceful-shutdown | https://github.com/Finomnis/tokio-graceful-shutdown/blob/21f915e6cd39cd139c5ab4fa8199b9d87dc5aaa3/src/utils/remote_drop_collection/tests.rs | src/utils/remote_drop_collection/tests.rs | use super::*;
use crate::{BoxedError, utils::JoinerToken};
#[test]
fn single_item() {
let items = RemotelyDroppableItems::new();
let (count1, _) = JoinerToken::<BoxedError>::new(|_| None);
assert_eq!(0, count1.count());
let token1 = items.insert(count1.child_token(|_| None));
assert_eq!(1, count1... | rust | Apache-2.0 | 21f915e6cd39cd139c5ab4fa8199b9d87dc5aaa3 | 2026-01-04T20:24:42.405407Z | false |
Finomnis/tokio-graceful-shutdown | https://github.com/Finomnis/tokio-graceful-shutdown/blob/21f915e6cd39cd139c5ab4fa8199b9d87dc5aaa3/src/utils/joiner_token/tests.rs | src/utils/joiner_token/tests.rs | use tokio::time::{Duration, sleep, timeout};
use tracing_test::traced_test;
use crate::BoxedError;
use super::*;
#[test]
#[traced_test]
fn counters() {
let (root, _) = JoinerToken::<BoxedError>::new(|_| None);
assert_eq!(0, root.count());
let (child1, _) = root.child_token(|_| None);
assert_eq!(1, r... | rust | Apache-2.0 | 21f915e6cd39cd139c5ab4fa8199b9d87dc5aaa3 | 2026-01-04T20:24:42.405407Z | false |
Finomnis/tokio-graceful-shutdown | https://github.com/Finomnis/tokio-graceful-shutdown/blob/21f915e6cd39cd139c5ab4fa8199b9d87dc5aaa3/src/runner/alive_guard.rs | src/runner/alive_guard.rs | use std::sync::{Arc, Mutex};
struct Inner {
finished_callback: Option<Box<dyn FnOnce() + Send>>,
cancelled_callback: Option<Box<dyn FnOnce() + Send>>,
}
/// Allows registering callback functions that will get called on destruction.
///
/// This struct is the mechanism that manages lifetime of parents and chil... | rust | Apache-2.0 | 21f915e6cd39cd139c5ab4fa8199b9d87dc5aaa3 | 2026-01-04T20:24:42.405407Z | false |
Finomnis/tokio-graceful-shutdown | https://github.com/Finomnis/tokio-graceful-shutdown/blob/21f915e6cd39cd139c5ab4fa8199b9d87dc5aaa3/src/runner/alive_guard/tests.rs | src/runner/alive_guard/tests.rs | use std::sync::atomic::{AtomicU32, Ordering};
use tracing_test::traced_test;
use super::*;
#[test]
#[traced_test]
fn finished_callback() {
let alive_guard = AliveGuard::new();
let counter = Arc::new(AtomicU32::new(0));
let counter2 = Arc::clone(&counter);
alive_guard.on_finished(move || {
co... | rust | Apache-2.0 | 21f915e6cd39cd139c5ab4fa8199b9d87dc5aaa3 | 2026-01-04T20:24:42.405407Z | false |
Finomnis/tokio-graceful-shutdown | https://github.com/Finomnis/tokio-graceful-shutdown/blob/21f915e6cd39cd139c5ab4fa8199b9d87dc5aaa3/src/subsystem/nested_subsystem.rs | src/subsystem/nested_subsystem.rs | use std::sync::atomic::Ordering;
use crate::{ErrTypeTraits, ErrorAction, errors::SubsystemJoinError};
use super::{NestedSubsystem, SubsystemFinishedFuture};
impl<ErrType: ErrTypeTraits> NestedSubsystem<ErrType> {
/// Wait for the subsystem and all of its children to be finished.
///
/// If its failure/pa... | rust | Apache-2.0 | 21f915e6cd39cd139c5ab4fa8199b9d87dc5aaa3 | 2026-01-04T20:24:42.405407Z | false |
Finomnis/tokio-graceful-shutdown | https://github.com/Finomnis/tokio-graceful-shutdown/blob/21f915e6cd39cd139c5ab4fa8199b9d87dc5aaa3/src/subsystem/error_collector.rs | src/subsystem/error_collector.rs | use std::sync::Arc;
use tokio::sync::mpsc;
use crate::{ErrTypeTraits, errors::SubsystemError};
pub(crate) enum ErrorCollector<ErrType: ErrTypeTraits> {
Collecting(mpsc::UnboundedReceiver<SubsystemError<ErrType>>),
Finished(Arc<[SubsystemError<ErrType>]>),
}
impl<ErrType: ErrTypeTraits> ErrorCollector<ErrTyp... | rust | Apache-2.0 | 21f915e6cd39cd139c5ab4fa8199b9d87dc5aaa3 | 2026-01-04T20:24:42.405407Z | false |
Finomnis/tokio-graceful-shutdown | https://github.com/Finomnis/tokio-graceful-shutdown/blob/21f915e6cd39cd139c5ab4fa8199b9d87dc5aaa3/src/subsystem/subsystem_handle.rs | src/subsystem/subsystem_handle.rs | use std::{
mem::ManuallyDrop,
sync::{Arc, Mutex, atomic::Ordering},
};
use atomic::Atomic;
use tokio::sync::{mpsc, oneshot};
use tokio_util::sync::CancellationToken;
use crate::{
AsyncSubsysFn, BoxedError, ErrTypeTraits, ErrorAction, NestedSubsystem, SubsystemBuilder,
errors::{SubsystemError, handle_d... | rust | Apache-2.0 | 21f915e6cd39cd139c5ab4fa8199b9d87dc5aaa3 | 2026-01-04T20:24:42.405407Z | false |
Finomnis/tokio-graceful-shutdown | https://github.com/Finomnis/tokio-graceful-shutdown/blob/21f915e6cd39cd139c5ab4fa8199b9d87dc5aaa3/src/subsystem/subsystem_builder.rs | src/subsystem/subsystem_builder.rs | use std::borrow::Cow;
use crate::ErrorAction;
/// Configures a subsystem before it gets spawned through
/// [`SubsystemHandle::start`](crate::SubsystemHandle::start).
#[must_use]
pub struct SubsystemBuilder<'a, Subsys> {
pub(crate) name: Cow<'a, str>,
pub(crate) subsystem: Subsys,
pub(crate) failure_actio... | rust | Apache-2.0 | 21f915e6cd39cd139c5ab4fa8199b9d87dc5aaa3 | 2026-01-04T20:24:42.405407Z | false |
Finomnis/tokio-graceful-shutdown | https://github.com/Finomnis/tokio-graceful-shutdown/blob/21f915e6cd39cd139c5ab4fa8199b9d87dc5aaa3/src/subsystem/subsystem_finished_future.rs | src/subsystem/subsystem_finished_future.rs | use std::{
future::Future,
pin::Pin,
task::{Context, Poll},
};
use crate::utils::JoinerTokenRef;
use super::SubsystemFinishedFuture;
impl SubsystemFinishedFuture {
pub(crate) fn new(joiner: JoinerTokenRef) -> Self {
Self {
future: Box::pin(async move { joiner.join().await }),
... | rust | Apache-2.0 | 21f915e6cd39cd139c5ab4fa8199b9d87dc5aaa3 | 2026-01-04T20:24:42.405407Z | false |
Finomnis/tokio-graceful-shutdown | https://github.com/Finomnis/tokio-graceful-shutdown/blob/21f915e6cd39cd139c5ab4fa8199b9d87dc5aaa3/src/subsystem/mod.rs | src/subsystem/mod.rs | mod error_collector;
mod nested_subsystem;
mod subsystem_builder;
mod subsystem_finished_future;
mod subsystem_handle;
use std::{
future::Future,
pin::Pin,
sync::{Arc, Mutex},
};
pub use subsystem_builder::SubsystemBuilder;
pub use subsystem_handle::SubsystemHandle;
pub(crate) use subsystem_handle::root_... | rust | Apache-2.0 | 21f915e6cd39cd139c5ab4fa8199b9d87dc5aaa3 | 2026-01-04T20:24:42.405407Z | false |
Finomnis/tokio-graceful-shutdown | https://github.com/Finomnis/tokio-graceful-shutdown/blob/21f915e6cd39cd139c5ab4fa8199b9d87dc5aaa3/src/subsystem/subsystem_handle/tests.rs | src/subsystem/subsystem_handle/tests.rs | use tokio::time::{Duration, sleep, timeout};
use tracing_test::traced_test;
use super::*;
#[tokio::test(start_paused = true)]
#[traced_test]
async fn recursive_cancellation() {
let root_handle = root_handle::<BoxedError>(CancellationToken::new(), |_| {});
let (drop_sender, mut drop_receiver) = tokio::sync::m... | rust | Apache-2.0 | 21f915e6cd39cd139c5ab4fa8199b9d87dc5aaa3 | 2026-01-04T20:24:42.405407Z | false |
Finomnis/tokio-graceful-shutdown | https://github.com/Finomnis/tokio-graceful-shutdown/blob/21f915e6cd39cd139c5ab4fa8199b9d87dc5aaa3/src/subsystem/error_collector/tests.rs | src/subsystem/error_collector/tests.rs | use tracing_test::traced_test;
use super::*;
#[test]
#[traced_test]
fn normal() {
let (sender, receiver) = mpsc::unbounded_channel();
let mut error_collector = ErrorCollector::<String>::new(receiver);
sender
.send(SubsystemError::Panicked(Arc::from("ABC")))
.unwrap();
sender
.... | rust | Apache-2.0 | 21f915e6cd39cd139c5ab4fa8199b9d87dc5aaa3 | 2026-01-04T20:24:42.405407Z | false |
Finomnis/tokio-graceful-shutdown | https://github.com/Finomnis/tokio-graceful-shutdown/blob/21f915e6cd39cd139c5ab4fa8199b9d87dc5aaa3/src/error_action/tests.rs | src/error_action/tests.rs | //Clone, Copy, Debug, Eq, PartialEq
use super::*;
#[test]
fn derives() {
let a = ErrorAction::Forward;
let b = ErrorAction::CatchAndLocalShutdown;
assert_ne!(a, b.clone());
assert_ne!(format!("{a:?}"), format!("{b:?}"));
}
| rust | Apache-2.0 | 21f915e6cd39cd139c5ab4fa8199b9d87dc5aaa3 | 2026-01-04T20:24:42.405407Z | false |
Finomnis/tokio-graceful-shutdown | https://github.com/Finomnis/tokio-graceful-shutdown/blob/21f915e6cd39cd139c5ab4fa8199b9d87dc5aaa3/tests/integration_test.rs | tests/integration_test.rs | use anyhow::anyhow;
use tokio::time::{Duration, sleep, timeout};
use tokio_graceful_shutdown::{
ErrorAction, IntoSubsystem, SubsystemBuilder, SubsystemHandle, Toplevel,
errors::{GracefulShutdownError, SubsystemError, SubsystemJoinError},
};
use tokio_util::sync::CancellationToken;
use tracing_test::traced_test;... | rust | Apache-2.0 | 21f915e6cd39cd139c5ab4fa8199b9d87dc5aaa3 | 2026-01-04T20:24:42.405407Z | true |
Finomnis/tokio-graceful-shutdown | https://github.com/Finomnis/tokio-graceful-shutdown/blob/21f915e6cd39cd139c5ab4fa8199b9d87dc5aaa3/tests/cancel_on_shutdown.rs | tests/cancel_on_shutdown.rs | mod common;
use tokio::time::{Duration, sleep};
use tokio_graceful_shutdown::{
FutureExt, SubsystemBuilder, SubsystemHandle, Toplevel, errors::CancelledByShutdown,
};
use tracing_test::traced_test;
use common::{BoxedError, BoxedResult};
#[tokio::test(start_paused = true)]
#[traced_test]
async fn cancel_on_shutdow... | rust | Apache-2.0 | 21f915e6cd39cd139c5ab4fa8199b9d87dc5aaa3 | 2026-01-04T20:24:42.405407Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.