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 |
|---|---|---|---|---|---|---|---|---|
ribru17/ts_query_ls | https://github.com/ribru17/ts_query_ls/blob/40593cb9158dbafb6c1f2e89b24629d8b1d16a8f/src/handlers/completion.rs | src/handlers/completion.rs | use std::collections::HashSet;
use streaming_iterator::StreamingIterator;
use tower_lsp::jsonrpc::Result;
use tower_lsp::lsp_types::{
CompletionItem, CompletionItemKind, CompletionParams, CompletionResponse, CompletionTextEdit,
Documentation, InsertTextFormat, MarkupContent, MarkupKind, Position, Range, TextEd... | rust | MIT | 40593cb9158dbafb6c1f2e89b24629d8b1d16a8f | 2026-01-04T20:20:11.073589Z | true |
ribru17/ts_query_ls | https://github.com/ribru17/ts_query_ls/blob/40593cb9158dbafb6c1f2e89b24629d8b1d16a8f/src/handlers/rename.rs | src/handlers/rename.rs | use tower_lsp::{
jsonrpc::{self, Result},
lsp_types::{
DocumentChanges, OneOf, OptionalVersionedTextDocumentIdentifier, RenameParams,
TextDocumentEdit, TextEdit, WorkspaceEdit,
},
};
use tracing::warn;
use tree_sitter::QueryCursor;
use crate::{
Backend, LspClient,
util::{
CA... | rust | MIT | 40593cb9158dbafb6c1f2e89b24629d8b1d16a8f | 2026-01-04T20:20:11.073589Z | false |
ribru17/ts_query_ls | https://github.com/ribru17/ts_query_ls/blob/40593cb9158dbafb6c1f2e89b24629d8b1d16a8f/src/handlers/semantic_tokens.rs | src/handlers/semantic_tokens.rs | use std::sync::LazyLock;
use tower_lsp::lsp_types::{
Range, SemanticToken, SemanticTokens, SemanticTokensParams, SemanticTokensRangeParams,
SemanticTokensRangeResult, SemanticTokensResult, Url,
};
use tracing::warn;
use tree_sitter::{Query, QueryCursor, StreamingIterator};
use crate::{
Backend, LspClient,... | rust | MIT | 40593cb9158dbafb6c1f2e89b24629d8b1d16a8f | 2026-01-04T20:20:11.073589Z | false |
ribru17/ts_query_ls | https://github.com/ribru17/ts_query_ls/blob/40593cb9158dbafb6c1f2e89b24629d8b1d16a8f/src/handlers/references.rs | src/handlers/references.rs | use tower_lsp::lsp_types::{Location, ReferenceParams};
use tracing::warn;
use tree_sitter::QueryCursor;
use crate::LspClient;
use crate::util::{CAPTURES_QUERY, NodeUtil, PosUtil};
use crate::{
Backend,
util::{TextProviderRope, get_current_capture_node, get_references},
};
pub fn references<C: LspClient>(
... | rust | MIT | 40593cb9158dbafb6c1f2e89b24629d8b1d16a8f | 2026-01-04T20:20:11.073589Z | false |
ribru17/ts_query_ls | https://github.com/ribru17/ts_query_ls/blob/40593cb9158dbafb6c1f2e89b24629d8b1d16a8f/src/handlers/selection_range.rs | src/handlers/selection_range.rs | use tower_lsp::lsp_types::{SelectionRange, SelectionRangeParams};
use tracing::warn;
use crate::{
Backend, LspClient,
util::{NodeUtil, PosUtil},
};
pub fn selection_range<C: LspClient>(
backend: &Backend<C>,
params: &SelectionRangeParams,
) -> Option<Vec<SelectionRange>> {
let uri = ¶ms.text_d... | rust | MIT | 40593cb9158dbafb6c1f2e89b24629d8b1d16a8f | 2026-01-04T20:20:11.073589Z | false |
ribru17/ts_query_ls | https://github.com/ribru17/ts_query_ls/blob/40593cb9158dbafb6c1f2e89b24629d8b1d16a8f/src/handlers/did_open.rs | src/handlers/did_open.rs | use std::{
collections::{BTreeSet, HashMap, HashSet},
fs,
path::PathBuf,
};
use dashmap::DashMap;
use ropey::Rope;
use tower_lsp::lsp_types::{DidOpenTextDocumentParams, Url};
use tracing::info;
use tree_sitter::Language;
use crate::{
Backend, DocumentData, ImportedUri, LanguageData, LspClient, Options... | rust | MIT | 40593cb9158dbafb6c1f2e89b24629d8b1d16a8f | 2026-01-04T20:20:11.073589Z | false |
ribru17/ts_query_ls | https://github.com/ribru17/ts_query_ls/blob/40593cb9158dbafb6c1f2e89b24629d8b1d16a8f/src/handlers/hover.rs | src/handlers/hover.rs | use std::{collections::HashMap, sync::LazyLock};
use tower_lsp::{
jsonrpc::Result,
lsp_types::{Hover, HoverContents, HoverParams, MarkupContent, MarkupKind, Position, Range},
};
use tracing::warn;
use tree_sitter::Query;
use ts_query_ls::{ParameterConstraint, PredicateParameterType};
use crate::{
Backend,... | rust | MIT | 40593cb9158dbafb6c1f2e89b24629d8b1d16a8f | 2026-01-04T20:20:11.073589Z | false |
ribru17/ts_query_ls | https://github.com/ribru17/ts_query_ls/blob/40593cb9158dbafb6c1f2e89b24629d8b1d16a8f/src/handlers/initialize.rs | src/handlers/initialize.rs | use std::str::FromStr;
use tower_lsp::jsonrpc::Result;
use tower_lsp::lsp_types::{InitializeParams, InitializeResult, ServerInfo, Url};
use tracing::info;
use crate::util::set_configuration_options;
use crate::{Backend, LspClient, SERVER_CAPABILITIES};
pub async fn initialize<C: LspClient>(
backend: &Backend<C>,... | rust | MIT | 40593cb9158dbafb6c1f2e89b24629d8b1d16a8f | 2026-01-04T20:20:11.073589Z | false |
ribru17/ts_query_ls | https://github.com/ribru17/ts_query_ls/blob/40593cb9158dbafb6c1f2e89b24629d8b1d16a8f/src/handlers/did_save.rs | src/handlers/did_save.rs | use tower_lsp::lsp_types::DidSaveTextDocumentParams;
use tracing::info;
use crate::{Backend, LspClient};
pub fn did_save<C: LspClient>(_: &Backend<C>, params: DidSaveTextDocumentParams) {
let uri = params.text_document.uri;
info!("ts_query_ls saved document with URI: {uri}");
}
| rust | MIT | 40593cb9158dbafb6c1f2e89b24629d8b1d16a8f | 2026-01-04T20:20:11.073589Z | false |
ribru17/ts_query_ls | https://github.com/ribru17/ts_query_ls/blob/40593cb9158dbafb6c1f2e89b24629d8b1d16a8f/src/handlers/mod.rs | src/handlers/mod.rs | pub mod code_action;
pub mod completion;
pub mod diagnostic;
pub mod did_change;
pub mod did_change_configuration;
pub mod did_close;
pub mod did_open;
pub mod did_save;
pub mod document_highlight;
pub mod document_symbol;
pub mod formatting;
pub mod goto_definition;
pub mod hover;
pub mod initialize;
pub mod reference... | rust | MIT | 40593cb9158dbafb6c1f2e89b24629d8b1d16a8f | 2026-01-04T20:20:11.073589Z | false |
ribru17/ts_query_ls | https://github.com/ribru17/ts_query_ls/blob/40593cb9158dbafb6c1f2e89b24629d8b1d16a8f/src/handlers/document_highlight.rs | src/handlers/document_highlight.rs | use std::sync::LazyLock;
use streaming_iterator::StreamingIterator;
use tower_lsp::lsp_types::{DocumentHighlight, DocumentHighlightKind, DocumentHighlightParams};
use tracing::warn;
use tree_sitter::{Query, QueryCursor};
use crate::util::{CAPTURES_QUERY, NodeUtil, PosUtil, TextProviderRope, get_references};
use crate... | rust | MIT | 40593cb9158dbafb6c1f2e89b24629d8b1d16a8f | 2026-01-04T20:20:11.073589Z | false |
ribru17/ts_query_ls | https://github.com/ribru17/ts_query_ls/blob/40593cb9158dbafb6c1f2e89b24629d8b1d16a8f/src/handlers/goto_definition.rs | src/handlers/goto_definition.rs | use tower_lsp::lsp_types::{GotoDefinitionParams, GotoDefinitionResponse, Location, Range};
use tracing::{info, warn};
use tree_sitter::QueryCursor;
use crate::{
Backend, LspClient,
util::{
CAPTURES_QUERY, NodeUtil, PosUtil, TextProviderRope, get_current_capture_node,
get_imported_module_under_c... | rust | MIT | 40593cb9158dbafb6c1f2e89b24629d8b1d16a8f | 2026-01-04T20:20:11.073589Z | false |
ribru17/ts_query_ls | https://github.com/ribru17/ts_query_ls/blob/40593cb9158dbafb6c1f2e89b24629d8b1d16a8f/src/handlers/did_change.rs | src/handlers/did_change.rs | use tower_lsp::lsp_types::{DidChangeTextDocumentParams, Position, Range};
use tracing::warn;
use crate::{
Backend, LspClient,
util::{ByteUtil, TextDocChangeUtil, edit_rope, get_imported_uris, parse, push_diagnostics},
};
use super::did_open::populate_import_documents;
pub async fn did_change<C: LspClient>(ba... | rust | MIT | 40593cb9158dbafb6c1f2e89b24629d8b1d16a8f | 2026-01-04T20:20:11.073589Z | false |
ribru17/ts_query_ls | https://github.com/ribru17/ts_query_ls/blob/40593cb9158dbafb6c1f2e89b24629d8b1d16a8f/src/handlers/formatting.rs | src/handlers/formatting.rs | use std::collections::HashSet;
use std::sync::LazyLock;
use regex::Regex;
use ropey::Rope;
use tower_lsp::lsp_types::{
DocumentFormattingParams, DocumentRangeFormattingParams, Range, TextEdit,
};
use tracing::warn;
use tree_sitter::{
Node, Query, QueryCursor, QueryMatch, QueryPredicateArg, StreamingIterator as... | rust | MIT | 40593cb9158dbafb6c1f2e89b24629d8b1d16a8f | 2026-01-04T20:20:11.073589Z | false |
ribru17/ts_query_ls | https://github.com/ribru17/ts_query_ls/blob/40593cb9158dbafb6c1f2e89b24629d8b1d16a8f/src/handlers/did_close.rs | src/handlers/did_close.rs | use tower_lsp::lsp_types::DidCloseTextDocumentParams;
use tracing::{info, warn};
use crate::{Backend, LspClient};
pub fn did_close<C: LspClient>(backend: &Backend<C>, params: &DidCloseTextDocumentParams) {
let uri = ¶ms.text_document.uri;
info!("ts_query_ls did_close: {uri}");
if backend.document_map.... | rust | MIT | 40593cb9158dbafb6c1f2e89b24629d8b1d16a8f | 2026-01-04T20:20:11.073589Z | false |
ribru17/ts_query_ls | https://github.com/ribru17/ts_query_ls/blob/40593cb9158dbafb6c1f2e89b24629d8b1d16a8f/src/handlers/code_action.rs | src/handlers/code_action.rs | use std::{collections::HashMap, vec};
use ropey::Rope;
use serde::{Deserialize, Serialize};
use tower_lsp::lsp_types::{
CodeAction, CodeActionKind, CodeActionOrCommand, CodeActionParams, CodeActionResponse,
Diagnostic, Position, Range, TextEdit, Url, WorkspaceEdit,
};
use tree_sitter::{QueryCursor, Tree};
use... | rust | MIT | 40593cb9158dbafb6c1f2e89b24629d8b1d16a8f | 2026-01-04T20:20:11.073589Z | false |
ribru17/ts_query_ls | https://github.com/ribru17/ts_query_ls/blob/40593cb9158dbafb6c1f2e89b24629d8b1d16a8f/src/handlers/diagnostic.rs | src/handlers/diagnostic.rs | use std::{
collections::{HashMap, HashSet},
sync::{Arc, LazyLock},
};
use dashmap::DashMap;
use regex::Regex;
use ropey::Rope;
use tower_lsp::{
jsonrpc::{Error, ErrorCode, Result},
lsp_types::{
Diagnostic, DiagnosticRelatedInformation, DiagnosticSeverity, DiagnosticTag,
DocumentDiagnost... | rust | MIT | 40593cb9158dbafb6c1f2e89b24629d8b1d16a8f | 2026-01-04T20:20:11.073589Z | true |
ribru17/ts_query_ls | https://github.com/ribru17/ts_query_ls/blob/40593cb9158dbafb6c1f2e89b24629d8b1d16a8f/src/cli/check.rs | src/cli/check.rs | use std::{
env, fs,
path::PathBuf,
sync::{Arc, LazyLock, atomic::AtomicI32},
};
use dashmap::DashMap;
use futures::future::join_all;
use tower_lsp::lsp_types::Url;
use crate::{
LanguageData, Options,
cli::lint::LintOptions,
handlers::did_open::init_language_data,
util::{self, get_scm_files... | rust | MIT | 40593cb9158dbafb6c1f2e89b24629d8b1d16a8f | 2026-01-04T20:20:11.073589Z | false |
ribru17/ts_query_ls | https://github.com/ribru17/ts_query_ls/blob/40593cb9158dbafb6c1f2e89b24629d8b1d16a8f/src/cli/lint.rs | src/cli/lint.rs | use std::{
env, fs,
path::{Path, PathBuf},
sync::{Arc, atomic::AtomicI32},
};
use dashmap::DashMap;
use futures::future::join_all;
use ropey::Rope;
use tower_lsp::lsp_types::{CodeAction, CodeActionOrCommand, DiagnosticSeverity, Url};
use crate::{
DocumentData, LanguageData, Options,
handlers::{
... | rust | MIT | 40593cb9158dbafb6c1f2e89b24629d8b1d16a8f | 2026-01-04T20:20:11.073589Z | false |
ribru17/ts_query_ls | https://github.com/ribru17/ts_query_ls/blob/40593cb9158dbafb6c1f2e89b24629d8b1d16a8f/src/cli/mod.rs | src/cli/mod.rs | pub mod check;
pub mod format;
pub mod lint;
pub mod profile;
| rust | MIT | 40593cb9158dbafb6c1f2e89b24629d8b1d16a8f | 2026-01-04T20:20:11.073589Z | false |
ribru17/ts_query_ls | https://github.com/ribru17/ts_query_ls/blob/40593cb9158dbafb6c1f2e89b24629d8b1d16a8f/src/cli/format.rs | src/cli/format.rs | use std::{
fs,
path::PathBuf,
sync::{Arc, atomic::AtomicI32},
};
use anstyle::{AnsiColor, Color, Style};
use futures::future::join_all;
use ropey::Rope;
use ts_query_ls::FormattingOptions;
use crate::{
handlers::formatting,
util::{get_scm_files, parse},
};
pub async fn format_directories(
dir... | rust | MIT | 40593cb9158dbafb6c1f2e89b24629d8b1d16a8f | 2026-01-04T20:20:11.073589Z | false |
ribru17/ts_query_ls | https://github.com/ribru17/ts_query_ls/blob/40593cb9158dbafb6c1f2e89b24629d8b1d16a8f/src/cli/profile.rs | src/cli/profile.rs | use std::{
env, fs,
path::PathBuf,
sync::{Arc, LazyLock},
time::Instant,
};
use dashmap::DashMap;
use futures::future::join_all;
use tower_lsp::lsp_types::Url;
use tree_sitter::{Parser, Query, QueryCursor, StreamingIterator as _};
use crate::{
LanguageData, Options, QUERY_LANGUAGE,
handlers::d... | rust | MIT | 40593cb9158dbafb6c1f2e89b24629d8b1d16a8f | 2026-01-04T20:20:11.073589Z | false |
ribru17/ts_query_ls | https://github.com/ribru17/ts_query_ls/blob/40593cb9158dbafb6c1f2e89b24629d8b1d16a8f/tests/lint.rs | tests/lint.rs | #[cfg(test)]
mod test {
use rstest::rstest;
use std::{
collections::{BTreeMap, HashMap},
path::Path,
process::Command,
sync::LazyLock,
};
use ts_query_ls::{Options, Predicate, PredicateParameter};
static CONFIG: LazyLock<Options> = LazyLock::new(|| Options {
... | rust | MIT | 40593cb9158dbafb6c1f2e89b24629d8b1d16a8f | 2026-01-04T20:20:11.073589Z | false |
ribru17/ts_query_ls | https://github.com/ribru17/ts_query_ls/blob/40593cb9158dbafb6c1f2e89b24629d8b1d16a8f/tests/format.rs | tests/format.rs | #[cfg(test)]
mod test {
use rstest::{Context, rstest};
use std::{env::temp_dir, fs, path::Path, process::Command};
#[rstest]
#[case(
include_str!(concat!(env!("CARGO_MANIFEST_DIR"), "/tests/fixtures/formatting_test_files/before_trailing_whitespace.scm")),
include_str!(concat!(env!("CARG... | rust | MIT | 40593cb9158dbafb6c1f2e89b24629d8b1d16a8f | 2026-01-04T20:20:11.073589Z | false |
ribru17/ts_query_ls | https://github.com/ribru17/ts_query_ls/blob/40593cb9158dbafb6c1f2e89b24629d8b1d16a8f/xtask/src/main.rs | xtask/src/main.rs | use std::{fs::File, path::Path};
use clap::{Parser, Subcommand};
use serde_json::to_writer_pretty;
use ts_query_ls::Options;
#[derive(Parser)]
#[command(author, version, about)]
struct Args {
#[command(subcommand)]
command: Commands,
}
#[derive(Subcommand)]
enum Commands {
/// Generate a JSON schema for ... | rust | MIT | 40593cb9158dbafb6c1f2e89b24629d8b1d16a8f | 2026-01-04T20:20:11.073589Z | false |
meithecatte/enumflags2 | https://github.com/meithecatte/enumflags2/blob/8a2dc61708e58a85ac9cb4975eddd3f45a5067a9/benchmarks/from_iterator.rs | benchmarks/from_iterator.rs | use criterion::{black_box, criterion_group, criterion_main, Criterion};
use enumflags2::{bitflags, BitFlags};
#[bitflags]
#[repr(u16)]
#[derive(Clone, Copy)]
pub enum Test {
Flag1 = 1 << 0,
Flag2 = 1 << 1,
Flag3 = 1 << 2,
Flag4 = 1 << 3,
Flag5 = 1 << 4,
Flag6 = 1 << 5,
Flag7 = 1 << 6,
F... | rust | Apache-2.0 | 8a2dc61708e58a85ac9cb4975eddd3f45a5067a9 | 2026-01-04T20:20:11.889172Z | false |
meithecatte/enumflags2 | https://github.com/meithecatte/enumflags2/blob/8a2dc61708e58a85ac9cb4975eddd3f45a5067a9/benchmarks/iterator.rs | benchmarks/iterator.rs | use criterion::{black_box, criterion_group, criterion_main, Criterion};
use enumflags2::{bitflags, BitFlags};
#[bitflags]
#[repr(u16)]
#[derive(Clone, Copy, Debug)]
pub enum Test {
Flag1 = 1 << 0,
Flag2 = 1 << 1,
Flag3 = 1 << 2,
Flag4 = 1 << 3,
Flag5 = 1 << 4,
Flag6 = 1 << 5,
Flag7 = 1 << 6... | rust | Apache-2.0 | 8a2dc61708e58a85ac9cb4975eddd3f45a5067a9 | 2026-01-04T20:20:11.889172Z | false |
meithecatte/enumflags2 | https://github.com/meithecatte/enumflags2/blob/8a2dc61708e58a85ac9cb4975eddd3f45a5067a9/src/lib.rs | src/lib.rs | //! # Enum Flags
//! `enumflags2` implements the classic bitflags datastructure. Annotate an enum
//! with `#[bitflags]`, and `BitFlags<YourEnum>` will be able to hold arbitrary combinations
//! of your enum within the space of a single integer.
//!
//! Unlike other crates, `enumflags2` makes the type-level distinction... | rust | Apache-2.0 | 8a2dc61708e58a85ac9cb4975eddd3f45a5067a9 | 2026-01-04T20:20:11.889172Z | false |
meithecatte/enumflags2 | https://github.com/meithecatte/enumflags2/blob/8a2dc61708e58a85ac9cb4975eddd3f45a5067a9/src/const_api.rs | src/const_api.rs | use crate::{BitFlags, BitFlag};
use core::marker::PhantomData;
/// Workaround for `const fn` limitations.
///
/// Some `const fn`s in this crate will need an instance of this type
/// for some type-level information usually provided by traits.
///
/// A token can be obtained from [`BitFlags::CONST_TOKEN`]. The relevan... | rust | Apache-2.0 | 8a2dc61708e58a85ac9cb4975eddd3f45a5067a9 | 2026-01-04T20:20:11.889172Z | false |
meithecatte/enumflags2 | https://github.com/meithecatte/enumflags2/blob/8a2dc61708e58a85ac9cb4975eddd3f45a5067a9/src/iter.rs | src/iter.rs | use crate::{BitFlag, BitFlags, BitFlagNum};
use core::iter::{FromIterator, FusedIterator};
impl<T> BitFlags<T>
where
T: BitFlag,
{
/// Iterate over the `BitFlags`.
///
/// ```
/// # use enumflags2::{bitflags, make_bitflags};
/// # #[bitflags]
/// # #[derive(Clone, Copy, PartialEq, Debug)]
... | rust | Apache-2.0 | 8a2dc61708e58a85ac9cb4975eddd3f45a5067a9 | 2026-01-04T20:20:11.889172Z | false |
meithecatte/enumflags2 | https://github.com/meithecatte/enumflags2/blob/8a2dc61708e58a85ac9cb4975eddd3f45a5067a9/src/formatting.rs | src/formatting.rs | use crate::{BitFlag, BitFlags};
use core::fmt::{self, Binary, Debug};
impl<T> fmt::Debug for BitFlags<T>
where
T: BitFlag + fmt::Debug,
{
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
let name = T::BITFLAGS_TYPE_NAME;
let bits = DebugBinaryFormatter(&self.val);
let iter =... | rust | Apache-2.0 | 8a2dc61708e58a85ac9cb4975eddd3f45a5067a9 | 2026-01-04T20:20:11.889172Z | false |
meithecatte/enumflags2 | https://github.com/meithecatte/enumflags2/blob/8a2dc61708e58a85ac9cb4975eddd3f45a5067a9/src/fallible.rs | src/fallible.rs | use super::BitFlag;
use super::BitFlags;
use core::convert::TryFrom;
use core::fmt;
// Coherence doesn't let us use a generic type here. Work around by implementing
// for each integer type manually.
for_each_uint! { $ty $hide_docs =>
impl<T> TryFrom<$ty> for BitFlags<T>
where
T: BitFlag<Numeric=$ty>,
... | rust | Apache-2.0 | 8a2dc61708e58a85ac9cb4975eddd3f45a5067a9 | 2026-01-04T20:20:11.889172Z | false |
meithecatte/enumflags2 | https://github.com/meithecatte/enumflags2/blob/8a2dc61708e58a85ac9cb4975eddd3f45a5067a9/test_suite/ui_tests.rs | test_suite/ui_tests.rs | use glob::glob;
#[test]
fn ui() {
let t = trybuild::TestCases::new();
for test in glob("ui/*.rs").unwrap() {
let path = test.unwrap();
if path == std::path::Path::new("ui/must_use_warning.rs") {
t.pass(path)
} else {
t.compile_fail(path)
}
}
}
| rust | Apache-2.0 | 8a2dc61708e58a85ac9cb4975eddd3f45a5067a9 | 2026-01-04T20:20:11.889172Z | false |
meithecatte/enumflags2 | https://github.com/meithecatte/enumflags2/blob/8a2dc61708e58a85ac9cb4975eddd3f45a5067a9/test_suite/common.rs | test_suite/common.rs | #[bitflags]
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)]
#[repr(u8)]
enum Test {
A = 1 << 0,
B = 1 << 1,
C = 1 << 2,
D = 1 << 3,
}
#[bitflags]
#[derive(Copy, Clone, Debug)]
#[repr(u64)]
enum Test1 {
A = 1 << 0,
B = 1 << 1,
C = 1 << 2,
D = 1 << 3,
E = 1 << 34,
}
#[bitflags(def... | rust | Apache-2.0 | 8a2dc61708e58a85ac9cb4975eddd3f45a5067a9 | 2026-01-04T20:20:11.889172Z | false |
meithecatte/enumflags2 | https://github.com/meithecatte/enumflags2/blob/8a2dc61708e58a85ac9cb4975eddd3f45a5067a9/test_suite/tests/serde.rs | test_suite/tests/serde.rs | use enumflags2::{bitflags, BitFlags};
use serde::{Deserialize, Serialize};
#[test]
fn serde_compile() {
#[bitflags]
#[derive(Copy, Clone, Debug, Serialize, Deserialize)]
#[repr(u8)]
enum Test {
A = 1 << 0,
B = 1 << 1,
C = 1 << 2,
D = 1 << 3,
}
type TestBitFlags ... | rust | Apache-2.0 | 8a2dc61708e58a85ac9cb4975eddd3f45a5067a9 | 2026-01-04T20:20:11.889172Z | false |
meithecatte/enumflags2 | https://github.com/meithecatte/enumflags2/blob/8a2dc61708e58a85ac9cb4975eddd3f45a5067a9/test_suite/tests/no_implicit_prelude_2018.rs | test_suite/tests/no_implicit_prelude_2018.rs | #![no_implicit_prelude]
#[::enumflags2::bitflags]
#[derive(Copy, Clone, Debug, PartialEq)]
#[repr(u8)]
pub enum Test {
A = 1 << 0,
B = 1 << 1,
C = 1 << 2,
D = 1 << 3,
}
#[test]
fn test_foo() {
// assert!() doesn't even work in no_implicit_prelude!
use ::enumflags2::BitFlags;
let _ = BitFla... | rust | Apache-2.0 | 8a2dc61708e58a85ac9cb4975eddd3f45a5067a9 | 2026-01-04T20:20:11.889172Z | false |
meithecatte/enumflags2 | https://github.com/meithecatte/enumflags2/blob/8a2dc61708e58a85ac9cb4975eddd3f45a5067a9/test_suite/tests/requires_std.rs | test_suite/tests/requires_std.rs | #![allow(dead_code)]
use enumflags2::{bitflags, BitFlag, BitFlags};
include!("../common.rs");
#[test]
fn debug_format() {
// Assert that our Debug output format meets expectations
assert_eq!(
format!("{:?}", BitFlags::<Test>::all()),
"BitFlags<Test>(0b1111, A | B | C | D)"
);
assert_... | rust | Apache-2.0 | 8a2dc61708e58a85ac9cb4975eddd3f45a5067a9 | 2026-01-04T20:20:11.889172Z | false |
meithecatte/enumflags2 | https://github.com/meithecatte/enumflags2/blob/8a2dc61708e58a85ac9cb4975eddd3f45a5067a9/test_suite/tests/not_literal.rs | test_suite/tests/not_literal.rs | #![forbid(trivial_numeric_casts)]
const FOO_BAR: u8 = 1;
const FOO_BAZ: u8 = 2;
#[enumflags2::bitflags]
#[derive(Clone, Copy)]
#[repr(u8)]
enum Foo {
Bar = FOO_BAR,
Baz = FOO_BAZ,
}
#[enumflags2::bitflags]
#[derive(Clone, Copy)]
#[repr(u8)]
enum SingleTest {
Hello = FOO_BAR,
}
| rust | Apache-2.0 | 8a2dc61708e58a85ac9cb4975eddd3f45a5067a9 | 2026-01-04T20:20:11.889172Z | false |
meithecatte/enumflags2 | https://github.com/meithecatte/enumflags2/blob/8a2dc61708e58a85ac9cb4975eddd3f45a5067a9/test_suite/tests/no_std.rs | test_suite/tests/no_std.rs | #![no_std]
include!("bitflag_tests.rs");
| rust | Apache-2.0 | 8a2dc61708e58a85ac9cb4975eddd3f45a5067a9 | 2026-01-04T20:20:11.889172Z | false |
meithecatte/enumflags2 | https://github.com/meithecatte/enumflags2/blob/8a2dc61708e58a85ac9cb4975eddd3f45a5067a9/test_suite/tests/no_std_2018.rs | test_suite/tests/no_std_2018.rs | #![no_std]
include!("bitflag_tests_2018.rs");
| rust | Apache-2.0 | 8a2dc61708e58a85ac9cb4975eddd3f45a5067a9 | 2026-01-04T20:20:11.889172Z | false |
meithecatte/enumflags2 | https://github.com/meithecatte/enumflags2/blob/8a2dc61708e58a85ac9cb4975eddd3f45a5067a9/test_suite/tests/bitflag_tests.rs | test_suite/tests/bitflag_tests.rs | #[macro_use]
extern crate enumflags2;
include!("../common.rs");
| rust | Apache-2.0 | 8a2dc61708e58a85ac9cb4975eddd3f45a5067a9 | 2026-01-04T20:20:11.889172Z | false |
meithecatte/enumflags2 | https://github.com/meithecatte/enumflags2/blob/8a2dc61708e58a85ac9cb4975eddd3f45a5067a9/test_suite/tests/bitflag_tests_2018.rs | test_suite/tests/bitflag_tests_2018.rs | // "an inner attribute is not permitted in this context" :/
#[deny(clippy::all, clippy::pedantic, clippy::nursery)]
mod everything {
use enumflags2::bitflags;
include!("../common.rs");
}
| rust | Apache-2.0 | 8a2dc61708e58a85ac9cb4975eddd3f45a5067a9 | 2026-01-04T20:20:11.889172Z | false |
meithecatte/enumflags2 | https://github.com/meithecatte/enumflags2/blob/8a2dc61708e58a85ac9cb4975eddd3f45a5067a9/test_suite/tests/no_implicit_prelude.rs | test_suite/tests/no_implicit_prelude.rs | #![no_implicit_prelude]
#[macro_use]
extern crate enumflags2;
use enumflags2::BitFlags;
#[bitflags]
#[derive(Copy, Clone, Debug, PartialEq)]
#[repr(u8)]
pub enum Test {
A = 1 << 0,
B = 1 << 1,
C = 1 << 2,
D = 1 << 3,
}
#[test]
fn test_foo() {
// assert!() doesn't even work in no_implicit_prelude!... | rust | Apache-2.0 | 8a2dc61708e58a85ac9cb4975eddd3f45a5067a9 | 2026-01-04T20:20:11.889172Z | false |
meithecatte/enumflags2 | https://github.com/meithecatte/enumflags2/blob/8a2dc61708e58a85ac9cb4975eddd3f45a5067a9/test_suite/ui/sneaky_make_bitflags.rs | test_suite/ui/sneaky_make_bitflags.rs | use enumflags2::{bitflags, make_bitflags};
#[bitflags]
#[repr(u8)]
#[derive(Copy, Clone, Debug)]
enum Test {
A = 1,
B = 2,
}
impl Test {
const C: u8 = 69;
}
fn main() {
let x = make_bitflags!(Test::{C});
dbg!(x);
}
| rust | Apache-2.0 | 8a2dc61708e58a85ac9cb4975eddd3f45a5067a9 | 2026-01-04T20:20:11.889172Z | false |
meithecatte/enumflags2 | https://github.com/meithecatte/enumflags2/blob/8a2dc61708e58a85ac9cb4975eddd3f45a5067a9/test_suite/ui/invalid_repr.rs | test_suite/ui/invalid_repr.rs | #[enumflags2::bitflags]
#[repr(C)]
#[derive(Clone, Copy)]
enum NotAType {
Bar = 1,
Baz = 2,
}
#[enumflags2::bitflags]
#[repr(i32)]
#[derive(Clone, Copy)]
enum SignedType {
Bar = 1,
Baz = 2,
}
#[enumflags2::bitflags]
#[repr(usize)]
#[derive(Clone, Copy)]
enum Usize {
Bar = 1,
Baz = 2,
}
fn mai... | rust | Apache-2.0 | 8a2dc61708e58a85ac9cb4975eddd3f45a5067a9 | 2026-01-04T20:20:11.889172Z | false |
meithecatte/enumflags2 | https://github.com/meithecatte/enumflags2/blob/8a2dc61708e58a85ac9cb4975eddd3f45a5067a9/test_suite/ui/with_fields.rs | test_suite/ui/with_fields.rs | #[enumflags2::bitflags]
#[repr(u8)]
#[derive(Copy, Clone)]
enum Foo {
Bar(u32),
}
fn main() {}
| rust | Apache-2.0 | 8a2dc61708e58a85ac9cb4975eddd3f45a5067a9 | 2026-01-04T20:20:11.889172Z | false |
meithecatte/enumflags2 | https://github.com/meithecatte/enumflags2/blob/8a2dc61708e58a85ac9cb4975eddd3f45a5067a9/test_suite/ui/invalid_attribute_syntax.rs | test_suite/ui/invalid_attribute_syntax.rs | use enumflags2::bitflags;
#[bitflags(default = A + B)]
enum Test {
A = 1,
B = 2,
}
#[bitflags(default = A |)]
enum Test {
A = 1,
B = 2,
}
#[bitflags(default =)]
enum Test {
A = 1,
B = 2,
}
#[bitflags(default)]
enum Test {
A = 1,
B = 2,
}
#[bitflags(yes)]
enum Test {
A = 1,
B... | rust | Apache-2.0 | 8a2dc61708e58a85ac9cb4975eddd3f45a5067a9 | 2026-01-04T20:20:11.889172Z | false |
meithecatte/enumflags2 | https://github.com/meithecatte/enumflags2/blob/8a2dc61708e58a85ac9cb4975eddd3f45a5067a9/test_suite/ui/literal_out_of_range.rs | test_suite/ui/literal_out_of_range.rs | //#[enumflags2::bitflags]
#[repr(u64)]
#[derive(Copy, Clone)]
enum Foo {
BigNumber = 0xdeadbeefcafebabe1337,
}
fn main() {}
| rust | Apache-2.0 | 8a2dc61708e58a85ac9cb4975eddd3f45a5067a9 | 2026-01-04T20:20:11.889172Z | false |
meithecatte/enumflags2 | https://github.com/meithecatte/enumflags2/blob/8a2dc61708e58a85ac9cb4975eddd3f45a5067a9/test_suite/ui/shift_out_of_range.rs | test_suite/ui/shift_out_of_range.rs | #[enumflags2::bitflags]
#[repr(u64)]
#[derive(Copy, Clone)]
enum Foo {
BigNumber = 1 << 69,
}
#[enumflags2::bitflags]
#[repr(u16)]
#[derive(Copy, Clone)]
enum Bar {
BigNumber = 1 << 20,
}
#[enumflags2::bitflags]
#[repr(u16)]
#[derive(Copy, Clone)]
enum Baz {
BigNumber = (1 << 10) << 10,
}
fn main() {}
| rust | Apache-2.0 | 8a2dc61708e58a85ac9cb4975eddd3f45a5067a9 | 2026-01-04T20:20:11.889172Z | false |
meithecatte/enumflags2 | https://github.com/meithecatte/enumflags2/blob/8a2dc61708e58a85ac9cb4975eddd3f45a5067a9/test_suite/ui/with_generics.rs | test_suite/ui/with_generics.rs | #[enumflags2::bitflags]
#[repr(u8)]
enum Foo<A> {
Bar,
}
fn main() {}
| rust | Apache-2.0 | 8a2dc61708e58a85ac9cb4975eddd3f45a5067a9 | 2026-01-04T20:20:11.889172Z | false |
meithecatte/enumflags2 | https://github.com/meithecatte/enumflags2/blob/8a2dc61708e58a85ac9cb4975eddd3f45a5067a9/test_suite/ui/multiple_bits_deferred.rs | test_suite/ui/multiple_bits_deferred.rs | const THREE: u8 = 3;
#[enumflags2::bitflags]
#[derive(Copy, Clone)]
#[repr(u8)]
enum Foo {
Three = THREE,
}
fn main() {}
| rust | Apache-2.0 | 8a2dc61708e58a85ac9cb4975eddd3f45a5067a9 | 2026-01-04T20:20:11.889172Z | false |
meithecatte/enumflags2 | https://github.com/meithecatte/enumflags2/blob/8a2dc61708e58a85ac9cb4975eddd3f45a5067a9/test_suite/ui/invalid_name_in_default.rs | test_suite/ui/invalid_name_in_default.rs | use enumflags2::bitflags;
#[bitflags(default = A | C)]
#[repr(u8)]
#[derive(Clone, Copy)]
enum Test {
A = 1,
B = 2,
}
fn main() {}
| rust | Apache-2.0 | 8a2dc61708e58a85ac9cb4975eddd3f45a5067a9 | 2026-01-04T20:20:11.889172Z | false |
meithecatte/enumflags2 | https://github.com/meithecatte/enumflags2/blob/8a2dc61708e58a85ac9cb4975eddd3f45a5067a9/test_suite/ui/zero_discriminant_deferred.rs | test_suite/ui/zero_discriminant_deferred.rs | const ZERO: u8 = 0;
#[enumflags2::bitflags]
#[derive(Copy, Clone)]
#[repr(u8)]
enum Foo {
Zero = ZERO,
}
#[enumflags2::bitflags]
#[derive(Copy, Clone)]
#[repr(u8)]
enum Bar {
Overflown = (ZERO + 2) << 7,
}
fn main() {}
| rust | Apache-2.0 | 8a2dc61708e58a85ac9cb4975eddd3f45a5067a9 | 2026-01-04T20:20:11.889172Z | false |
meithecatte/enumflags2 | https://github.com/meithecatte/enumflags2/blob/8a2dc61708e58a85ac9cb4975eddd3f45a5067a9/test_suite/ui/overlapping_flags.rs | test_suite/ui/overlapping_flags.rs | #[enumflags2::bitflags]
#[repr(u8)]
#[derive(Copy, Clone)]
enum Foo {
SomeFlag = 1 << 0,
OverlappingFlag = 1 << 0,
}
fn main() {}
| rust | Apache-2.0 | 8a2dc61708e58a85ac9cb4975eddd3f45a5067a9 | 2026-01-04T20:20:11.889172Z | false |
meithecatte/enumflags2 | https://github.com/meithecatte/enumflags2/blob/8a2dc61708e58a85ac9cb4975eddd3f45a5067a9/test_suite/ui/multiple_bits.rs | test_suite/ui/multiple_bits.rs | #[enumflags2::bitflags]
#[repr(u8)]
#[derive(Copy, Clone)]
enum Foo {
SingleBit = 1,
MultipleBits = 6,
}
fn main() {}
| rust | Apache-2.0 | 8a2dc61708e58a85ac9cb4975eddd3f45a5067a9 | 2026-01-04T20:20:11.889172Z | false |
meithecatte/enumflags2 | https://github.com/meithecatte/enumflags2/blob/8a2dc61708e58a85ac9cb4975eddd3f45a5067a9/test_suite/ui/zero_disciminant.rs | test_suite/ui/zero_disciminant.rs | #[enumflags2::bitflags]
#[repr(u8)]
#[derive(Copy, Clone)]
enum Foo {
Zero = 0,
}
fn main() {}
| rust | Apache-2.0 | 8a2dc61708e58a85ac9cb4975eddd3f45a5067a9 | 2026-01-04T20:20:11.889172Z | false |
meithecatte/enumflags2 | https://github.com/meithecatte/enumflags2/blob/8a2dc61708e58a85ac9cb4975eddd3f45a5067a9/test_suite/ui/not_enum.rs | test_suite/ui/not_enum.rs | #[enumflags2::bitflags]
#[derive(Copy, Clone)]
struct Foo(u16);
#[enumflags2::bitflags]
const WTF: u8 = 42;
fn main() {}
| rust | Apache-2.0 | 8a2dc61708e58a85ac9cb4975eddd3f45a5067a9 | 2026-01-04T20:20:11.889172Z | false |
meithecatte/enumflags2 | https://github.com/meithecatte/enumflags2/blob/8a2dc61708e58a85ac9cb4975eddd3f45a5067a9/enumflags_derive/src/lib.rs | enumflags_derive/src/lib.rs | #![recursion_limit = "2048"]
extern crate proc_macro;
#[macro_use]
extern crate quote;
use proc_macro2::{Span, TokenStream};
use std::convert::TryFrom;
use syn::{
parse::{Parse, ParseStream},
parse_macro_input,
spanned::Spanned,
Expr, Ident, DeriveInput, Data, Token, Variant,
};
struct Flag<'a> {
... | rust | Apache-2.0 | 8a2dc61708e58a85ac9cb4975eddd3f45a5067a9 | 2026-01-04T20:20:11.889172Z | false |
GothenburgBitFactory/taskchampion | https://github.com/GothenburgBitFactory/taskchampion/blob/45f5345daff60aba526db9e54dc03c8e0da37f14/src/errors.rs | src/errors.rs | use std::io;
use thiserror::Error;
#[derive(Debug, Error)]
#[non_exhaustive]
/// Errors returned from taskchampion operations
pub enum Error {
/// A server-related error
#[error("Server Error: {0}")]
Server(String),
/// A task-database-related error
#[error("Task Database Error: {0}")]
Database... | rust | MIT | 45f5345daff60aba526db9e54dc03c8e0da37f14 | 2026-01-04T20:19:44.628446Z | false |
GothenburgBitFactory/taskchampion | https://github.com/GothenburgBitFactory/taskchampion/blob/45f5345daff60aba526db9e54dc03c8e0da37f14/src/lib.rs | src/lib.rs | #![deny(clippy::all)]
#![deny(unreachable_pub)]
#![deny(unnameable_types)]
#![deny(clippy::dbg_macro)]
#![doc = include_str!("crate-doc.md")]
mod depmap;
mod errors;
mod operation;
mod replica;
pub mod server;
pub mod storage;
mod task;
mod taskdb;
mod utils;
mod workingset;
pub use depmap::DependencyMap;
pub use err... | rust | MIT | 45f5345daff60aba526db9e54dc03c8e0da37f14 | 2026-01-04T20:19:44.628446Z | false |
GothenburgBitFactory/taskchampion | https://github.com/GothenburgBitFactory/taskchampion/blob/45f5345daff60aba526db9e54dc03c8e0da37f14/src/replica.rs | src/replica.rs | use crate::depmap::DependencyMap;
use crate::errors::Result;
use crate::operation::{Operation, Operations};
use crate::server::Server;
use crate::storage::{Storage, TaskMap};
use crate::task::{Status, Task};
use crate::taskdb::TaskDb;
use crate::workingset::WorkingSet;
use crate::{Error, TaskData};
use anyhow::Context;... | rust | MIT | 45f5345daff60aba526db9e54dc03c8e0da37f14 | 2026-01-04T20:19:44.628446Z | true |
GothenburgBitFactory/taskchampion | https://github.com/GothenburgBitFactory/taskchampion/blob/45f5345daff60aba526db9e54dc03c8e0da37f14/src/utils.rs | src/utils.rs | use std::convert::TryInto;
use uuid::Uuid;
/// A representation of a UUID as a key. This is just a newtype wrapping the 128-bit packed form
/// of a UUID.
#[derive(Debug, PartialEq, Eq, PartialOrd, Ord)]
pub(crate) struct Key(uuid::Bytes);
impl From<&[u8]> for Key {
fn from(bytes: &[u8]) -> Key {
Key(byt... | rust | MIT | 45f5345daff60aba526db9e54dc03c8e0da37f14 | 2026-01-04T20:19:44.628446Z | false |
GothenburgBitFactory/taskchampion | https://github.com/GothenburgBitFactory/taskchampion/blob/45f5345daff60aba526db9e54dc03c8e0da37f14/src/depmap.rs | src/depmap.rs | use uuid::Uuid;
/// DependencyMap stores information on task dependencies between pending tasks.
///
/// This information requires a scan of the working set to generate, so it is
/// typically calculated once and re-used.
#[derive(Debug, PartialEq, Eq, Clone)]
pub struct DependencyMap {
/// Edges of the dependency... | rust | MIT | 45f5345daff60aba526db9e54dc03c8e0da37f14 | 2026-01-04T20:19:44.628446Z | false |
GothenburgBitFactory/taskchampion | https://github.com/GothenburgBitFactory/taskchampion/blob/45f5345daff60aba526db9e54dc03c8e0da37f14/src/workingset.rs | src/workingset.rs | use std::collections::HashMap;
use uuid::Uuid;
/// A WorkingSet represents a snapshot of the working set from a replica.
///
/// A replica's working set is a mapping from small integers to task uuids for all pending tasks.
/// The small integers are meant to be stable, easily-typed identifiers for users to interact wi... | rust | MIT | 45f5345daff60aba526db9e54dc03c8e0da37f14 | 2026-01-04T20:19:44.628446Z | false |
GothenburgBitFactory/taskchampion | https://github.com/GothenburgBitFactory/taskchampion/blob/45f5345daff60aba526db9e54dc03c8e0da37f14/src/operation.rs | src/operation.rs | use crate::storage::TaskMap;
use chrono::{DateTime, Utc};
use serde::{Deserialize, Serialize};
use std::cmp::{Ord, Ordering};
use uuid::Uuid;
/// An Operation defines a single change to the task database, as stored locally in the replica.
///
/// Operations are the means by which changes are made to the database, typi... | rust | MIT | 45f5345daff60aba526db9e54dc03c8e0da37f14 | 2026-01-04T20:19:44.628446Z | false |
GothenburgBitFactory/taskchampion | https://github.com/GothenburgBitFactory/taskchampion/blob/45f5345daff60aba526db9e54dc03c8e0da37f14/src/storage/config.rs | src/storage/config.rs | #[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum AccessMode {
ReadOnly,
ReadWrite,
}
| rust | MIT | 45f5345daff60aba526db9e54dc03c8e0da37f14 | 2026-01-04T20:19:44.628446Z | false |
GothenburgBitFactory/taskchampion | https://github.com/GothenburgBitFactory/taskchampion/blob/45f5345daff60aba526db9e54dc03c8e0da37f14/src/storage/test.rs | src/storage/test.rs | //! Tests for storage backends. This tests consistency across multiple method calls, to ensure that
//! all implementations are consistent.
use super::{Storage, TaskMap};
use crate::errors::Result;
use crate::storage::{taskmap_with, DEFAULT_BASE_VERSION};
use crate::Operation;
use chrono::Utc;
use pretty_assertions::a... | rust | MIT | 45f5345daff60aba526db9e54dc03c8e0da37f14 | 2026-01-04T20:19:44.628446Z | false |
GothenburgBitFactory/taskchampion | https://github.com/GothenburgBitFactory/taskchampion/blob/45f5345daff60aba526db9e54dc03c8e0da37f14/src/storage/mod.rs | src/storage/mod.rs | /*!
This module defines the backend storage used by [`Replica`](crate::Replica).
It defines a [trait](crate::storage::Storage) for storage implementations, and provides a default
on-disk implementation as well as an in-memory implementation for testing.
Typical uses of this crate do not interact directly with this mo... | rust | MIT | 45f5345daff60aba526db9e54dc03c8e0da37f14 | 2026-01-04T20:19:44.628446Z | false |
GothenburgBitFactory/taskchampion | https://github.com/GothenburgBitFactory/taskchampion/blob/45f5345daff60aba526db9e54dc03c8e0da37f14/src/storage/inmemory.rs | src/storage/inmemory.rs | #![allow(clippy::new_without_default)]
use crate::errors::{Error, Result};
use crate::operation::Operation;
use crate::storage::{Storage, StorageTxn, TaskMap, VersionId, DEFAULT_BASE_VERSION};
use async_trait::async_trait;
use std::collections::hash_map::Entry;
use std::collections::HashMap;
use uuid::Uuid;
#[derive(... | rust | MIT | 45f5345daff60aba526db9e54dc03c8e0da37f14 | 2026-01-04T20:19:44.628446Z | false |
GothenburgBitFactory/taskchampion | https://github.com/GothenburgBitFactory/taskchampion/blob/45f5345daff60aba526db9e54dc03c8e0da37f14/src/storage/sqlite/inner.rs | src/storage/sqlite/inner.rs | use crate::errors::{Error, Result};
use crate::operation::Operation;
use crate::storage::config::AccessMode;
use crate::storage::send_wrapper::{WrappedStorage, WrappedStorageTxn};
use crate::storage::sqlite::{schema, SqliteError, StoredUuid};
use crate::storage::{TaskMap, VersionId, DEFAULT_BASE_VERSION};
use anyhow::C... | rust | MIT | 45f5345daff60aba526db9e54dc03c8e0da37f14 | 2026-01-04T20:19:44.628446Z | false |
GothenburgBitFactory/taskchampion | https://github.com/GothenburgBitFactory/taskchampion/blob/45f5345daff60aba526db9e54dc03c8e0da37f14/src/storage/sqlite/schema.rs | src/storage/sqlite/schema.rs | use crate::errors::{Error, Result};
use anyhow::Context;
use rusqlite::{params, Connection, OptionalExtension, Transaction};
/// A database schema version.
///
/// The first value is the major version, with different major versions completely incompatible
/// with one another.
///
/// The second is the minor version, ... | rust | MIT | 45f5345daff60aba526db9e54dc03c8e0da37f14 | 2026-01-04T20:19:44.628446Z | false |
GothenburgBitFactory/taskchampion | https://github.com/GothenburgBitFactory/taskchampion/blob/45f5345daff60aba526db9e54dc03c8e0da37f14/src/storage/sqlite/mod.rs | src/storage/sqlite/mod.rs | use crate::errors::Result;
use crate::storage::config::AccessMode;
use crate::storage::send_wrapper::Wrapper;
use crate::storage::sqlite::inner::SqliteStorageInner;
use crate::storage::{Storage, StorageTxn};
use async_trait::async_trait;
use rusqlite::types::FromSql;
use rusqlite::ToSql;
use std::path::Path;
use uuid::... | rust | MIT | 45f5345daff60aba526db9e54dc03c8e0da37f14 | 2026-01-04T20:19:44.628446Z | false |
GothenburgBitFactory/taskchampion | https://github.com/GothenburgBitFactory/taskchampion/blob/45f5345daff60aba526db9e54dc03c8e0da37f14/src/storage/indexeddb/storage.rs | src/storage/indexeddb/storage.rs | use super::schema;
use crate::errors::{Error, Result};
use crate::operation::Operation;
use crate::storage::send_wrapper::{WrappedStorage, WrappedStorageTxn, Wrapper};
use crate::storage::{Storage, StorageTxn, TaskMap, VersionId, DEFAULT_BASE_VERSION};
use async_trait::async_trait;
use idb::{CursorDirection, DatabaseEv... | rust | MIT | 45f5345daff60aba526db9e54dc03c8e0da37f14 | 2026-01-04T20:19:44.628446Z | false |
GothenburgBitFactory/taskchampion | https://github.com/GothenburgBitFactory/taskchampion/blob/45f5345daff60aba526db9e54dc03c8e0da37f14/src/storage/indexeddb/schema.rs | src/storage/indexeddb/schema.rs | use crate::errors::Result;
use idb::{Database, KeyPath};
/// The IndexedDB database version. This can be incremented to trigger calls to
/// `upgrade`.
pub(super) const DB_VERSION: u32 = 1;
pub(super) const TASKS: &str = "tasks";
pub(super) const OPERATIONS: &str = "operations";
pub(super) const OPERATIONS_BY_UUID: &... | rust | MIT | 45f5345daff60aba526db9e54dc03c8e0da37f14 | 2026-01-04T20:19:44.628446Z | false |
GothenburgBitFactory/taskchampion | https://github.com/GothenburgBitFactory/taskchampion/blob/45f5345daff60aba526db9e54dc03c8e0da37f14/src/storage/indexeddb/mod.rs | src/storage/indexeddb/mod.rs | #[cfg(not(target_arch = "wasm32"))]
compile_error!("IndexdDBStorage is only available on WASM targets");
mod storage;
pub use storage::IndexedDbStorage;
mod schema;
| rust | MIT | 45f5345daff60aba526db9e54dc03c8e0da37f14 | 2026-01-04T20:19:44.628446Z | false |
GothenburgBitFactory/taskchampion | https://github.com/GothenburgBitFactory/taskchampion/blob/45f5345daff60aba526db9e54dc03c8e0da37f14/src/storage/send_wrapper/test.rs | src/storage/send_wrapper/test.rs | use super::Wrapper;
use crate::errors::{Error, Result};
use crate::operation::Operation;
use crate::storage::inmemory::InMemoryStorage;
use crate::storage::send_wrapper::{WrappedStorage, WrappedStorageTxn};
use crate::storage::{Storage, StorageTxn, TaskMap, VersionId};
use async_trait::async_trait;
use pretty_assertion... | rust | MIT | 45f5345daff60aba526db9e54dc03c8e0da37f14 | 2026-01-04T20:19:44.628446Z | false |
GothenburgBitFactory/taskchampion | https://github.com/GothenburgBitFactory/taskchampion/blob/45f5345daff60aba526db9e54dc03c8e0da37f14/src/storage/send_wrapper/actor.rs | src/storage/send_wrapper/actor.rs | use super::{WrappedStorage, WrappedStorageTxn};
use crate::errors::Result;
use crate::operation::Operation;
use crate::storage::{TaskMap, VersionId};
use tokio::sync::{mpsc, oneshot};
use uuid::Uuid;
/// An enum for messages sent to the sync thread actor.
pub(super) enum ActorMessage {
// Transaction control
B... | rust | MIT | 45f5345daff60aba526db9e54dc03c8e0da37f14 | 2026-01-04T20:19:44.628446Z | false |
GothenburgBitFactory/taskchampion | https://github.com/GothenburgBitFactory/taskchampion/blob/45f5345daff60aba526db9e54dc03c8e0da37f14/src/storage/send_wrapper/wrapper.rs | src/storage/send_wrapper/wrapper.rs | use super::actor::{ActorImpl, ActorMessage, TxnMessage};
use super::WrappedStorage;
use crate::errors::Result;
use crate::operation::Operation;
use crate::storage::{Storage, StorageTxn, TaskMap, VersionId};
use async_trait::async_trait;
use std::future::Future;
use tokio::sync::{mpsc, oneshot};
use uuid::Uuid;
/// Wra... | rust | MIT | 45f5345daff60aba526db9e54dc03c8e0da37f14 | 2026-01-04T20:19:44.628446Z | false |
GothenburgBitFactory/taskchampion | https://github.com/GothenburgBitFactory/taskchampion/blob/45f5345daff60aba526db9e54dc03c8e0da37f14/src/storage/send_wrapper/mod.rs | src/storage/send_wrapper/mod.rs | //! This module implements a wrapper around a non-Send version of the Storage and StorageTxn
//! traits, exposing implementations of those traits.
//!
//! The wrapper uses an actor model: the wrapper uses channels to communicate with a single
//! instance of the wrapped type, running in a dedicated thread.
mod actor;
... | rust | MIT | 45f5345daff60aba526db9e54dc03c8e0da37f14 | 2026-01-04T20:19:44.628446Z | false |
GothenburgBitFactory/taskchampion | https://github.com/GothenburgBitFactory/taskchampion/blob/45f5345daff60aba526db9e54dc03c8e0da37f14/src/storage/send_wrapper/traits.rs | src/storage/send_wrapper/traits.rs | use crate::errors::Result;
use crate::operation::Operation;
use crate::storage::{TaskMap, VersionId};
use async_trait::async_trait;
use uuid::Uuid;
/// This trait is identical to [`crate::storage::StorageTxn`] except that it is not Send.
#[async_trait(?Send)]
pub(in crate::storage) trait WrappedStorageTxn {
async ... | rust | MIT | 45f5345daff60aba526db9e54dc03c8e0da37f14 | 2026-01-04T20:19:44.628446Z | false |
GothenburgBitFactory/taskchampion | https://github.com/GothenburgBitFactory/taskchampion/blob/45f5345daff60aba526db9e54dc03c8e0da37f14/src/server/op.rs | src/server/op.rs | use crate::operation::Operation;
use chrono::{DateTime, Utc};
use serde::{Deserialize, Serialize};
use uuid::Uuid;
/// A SyncOp defines a single change to the task database, that can be synchronized
/// via a server.
#[derive(PartialEq, Eq, Clone, Debug, Serialize, Deserialize)]
pub(crate) enum SyncOp {
/// Create... | rust | MIT | 45f5345daff60aba526db9e54dc03c8e0da37f14 | 2026-01-04T20:19:44.628446Z | false |
GothenburgBitFactory/taskchampion | https://github.com/GothenburgBitFactory/taskchampion/blob/45f5345daff60aba526db9e54dc03c8e0da37f14/src/server/config.rs | src/server/config.rs | use super::types::Server;
use crate::errors::Result;
#[cfg(feature = "server-aws")]
pub use crate::server::cloud::aws::AwsCredentials;
#[cfg(feature = "server-aws")]
use crate::server::cloud::aws::AwsService;
#[cfg(feature = "server-gcp")]
use crate::server::cloud::gcp::GcpService;
#[cfg(feature = "cloud")]
use crate::... | rust | MIT | 45f5345daff60aba526db9e54dc03c8e0da37f14 | 2026-01-04T20:19:44.628446Z | false |
GothenburgBitFactory/taskchampion | https://github.com/GothenburgBitFactory/taskchampion/blob/45f5345daff60aba526db9e54dc03c8e0da37f14/src/server/test.rs | src/server/test.rs | use crate::errors::Result;
use crate::server::{
AddVersionResult, GetVersionResult, HistorySegment, Server, Snapshot, SnapshotUrgency,
VersionId, NIL_VERSION_ID,
};
use async_trait::async_trait;
use std::collections::HashMap;
use std::sync::{Arc, Mutex};
use uuid::Uuid;
struct Version {
version_id: Version... | rust | MIT | 45f5345daff60aba526db9e54dc03c8e0da37f14 | 2026-01-04T20:19:44.628446Z | false |
GothenburgBitFactory/taskchampion | https://github.com/GothenburgBitFactory/taskchampion/blob/45f5345daff60aba526db9e54dc03c8e0da37f14/src/server/http.rs | src/server/http.rs | //! Common support for HTTP client
//!
//! This contains some utilities to make using `reqwest` easier, including getting
//! the correct TLS certificate store.
use crate::errors::Result;
#[cfg(all(
not(target_arch = "wasm32"),
not(any(feature = "tls-native-roots", feature = "tls-webpki-roots"))
))]
compile_e... | rust | MIT | 45f5345daff60aba526db9e54dc03c8e0da37f14 | 2026-01-04T20:19:44.628446Z | false |
GothenburgBitFactory/taskchampion | https://github.com/GothenburgBitFactory/taskchampion/blob/45f5345daff60aba526db9e54dc03c8e0da37f14/src/server/encryption.rs | src/server/encryption.rs | /// This module implements the encryption specified in the sync-protocol
/// document.
use crate::errors::{Error, Result};
use ring::{aead, pbkdf2, rand, rand::SecureRandom};
use uuid::Uuid;
const PBKDF2_ITERATIONS: u32 = 600000;
const ENVELOPE_VERSION: u8 = 1;
const AAD_LEN: usize = 17;
const TASK_APP_ID: u8 = 1;
//... | rust | MIT | 45f5345daff60aba526db9e54dc03c8e0da37f14 | 2026-01-04T20:19:44.628446Z | false |
GothenburgBitFactory/taskchampion | https://github.com/GothenburgBitFactory/taskchampion/blob/45f5345daff60aba526db9e54dc03c8e0da37f14/src/server/types.rs | src/server/types.rs | use crate::errors::Result;
use async_trait::async_trait;
use uuid::Uuid;
/// Versions are referred to with UUIDs.
pub type VersionId = Uuid;
/// The distinguished value for "no version"
pub const NIL_VERSION_ID: VersionId = Uuid::nil();
/// A segment in the history of this task database, in the form of a sequence of... | rust | MIT | 45f5345daff60aba526db9e54dc03c8e0da37f14 | 2026-01-04T20:19:44.628446Z | false |
GothenburgBitFactory/taskchampion | https://github.com/GothenburgBitFactory/taskchampion/blob/45f5345daff60aba526db9e54dc03c8e0da37f14/src/server/mod.rs | src/server/mod.rs | /*!
This module defines the client interface to TaskChampion sync servers.
It defines a [trait](crate::server::Server) for servers, and implements both local and remote
servers.
Typical uses of this crate do not interact directly with this module; [`ServerConfig`] is
sufficient. However, users who wish to implement t... | rust | MIT | 45f5345daff60aba526db9e54dc03c8e0da37f14 | 2026-01-04T20:19:44.628446Z | false |
GothenburgBitFactory/taskchampion | https://github.com/GothenburgBitFactory/taskchampion/blob/45f5345daff60aba526db9e54dc03c8e0da37f14/src/server/cloud/gcp.rs | src/server/cloud/gcp.rs | use super::service::{validate_object_name, ObjectInfo, Service};
use crate::errors::Result;
use crate::server::{cloud::iter::AsyncObjectIterator, http};
use async_trait::async_trait;
use google_cloud_storage::client::google_cloud_auth::credentials::CredentialsFile;
use google_cloud_storage::client::{Client, ClientConfi... | rust | MIT | 45f5345daff60aba526db9e54dc03c8e0da37f14 | 2026-01-04T20:19:44.628446Z | false |
GothenburgBitFactory/taskchampion | https://github.com/GothenburgBitFactory/taskchampion/blob/45f5345daff60aba526db9e54dc03c8e0da37f14/src/server/cloud/aws.rs | src/server/cloud/aws.rs | use super::service::{validate_object_name, ObjectInfo, Service};
use crate::{
errors::Result,
server::{cloud::iter::AsyncObjectIterator, http},
};
use async_trait::async_trait;
use aws_config::{
environment::EnvironmentVariableRegionProvider,
meta::region::RegionProviderChain,
profile::{self, Profil... | rust | MIT | 45f5345daff60aba526db9e54dc03c8e0da37f14 | 2026-01-04T20:19:44.628446Z | false |
GothenburgBitFactory/taskchampion | https://github.com/GothenburgBitFactory/taskchampion/blob/45f5345daff60aba526db9e54dc03c8e0da37f14/src/server/cloud/test.rs | src/server/cloud/test.rs | //! Tests for cloud services.
//!
//! This tests that the various service methods, and especially `compare_and_swap`,
//! satisfy their requirements.
//!
//! The server must also satisfy:
//! - `list`: Use a page size of 6 for n `#[cfg(test)]`
//! - `compare_and_swap`: if the object name ends with `-racing-delete`, d... | rust | MIT | 45f5345daff60aba526db9e54dc03c8e0da37f14 | 2026-01-04T20:19:44.628446Z | false |
GothenburgBitFactory/taskchampion | https://github.com/GothenburgBitFactory/taskchampion/blob/45f5345daff60aba526db9e54dc03c8e0da37f14/src/server/cloud/service.rs | src/server/cloud/service.rs | use crate::{errors::Result, server::cloud::iter::AsyncObjectIterator};
use async_trait::async_trait;
/// Information about an object as returned from `Service::list`
pub(in crate::server) struct ObjectInfo {
/// Name of the object.
pub(in crate::server) name: String,
/// Creation time of the object, in sec... | rust | MIT | 45f5345daff60aba526db9e54dc03c8e0da37f14 | 2026-01-04T20:19:44.628446Z | false |
GothenburgBitFactory/taskchampion | https://github.com/GothenburgBitFactory/taskchampion/blob/45f5345daff60aba526db9e54dc03c8e0da37f14/src/server/cloud/mod.rs | src/server/cloud/mod.rs | /*!
* Support for cloud-service-backed sync.
*
* All of these operate using a similar approach, with specific patterns of object names. The
* process of adding a new version requires a compare-and-swap operation that sets a new version
* as the "latest" only if the existing "latest" has the expected value. This ensures... | rust | MIT | 45f5345daff60aba526db9e54dc03c8e0da37f14 | 2026-01-04T20:19:44.628446Z | false |
GothenburgBitFactory/taskchampion | https://github.com/GothenburgBitFactory/taskchampion/blob/45f5345daff60aba526db9e54dc03c8e0da37f14/src/server/cloud/server.rs | src/server/cloud/server.rs | use super::service::{ObjectInfo, Service};
use crate::errors::{Error, Result};
use crate::server::encryption::{Cryptor, Sealed, Unsealed};
use crate::server::{
AddVersionResult, GetVersionResult, HistorySegment, Server, Snapshot, SnapshotUrgency,
VersionId,
};
use async_trait::async_trait;
use ring::rand;
use s... | rust | MIT | 45f5345daff60aba526db9e54dc03c8e0da37f14 | 2026-01-04T20:19:44.628446Z | true |
GothenburgBitFactory/taskchampion | https://github.com/GothenburgBitFactory/taskchampion/blob/45f5345daff60aba526db9e54dc03c8e0da37f14/src/server/cloud/iter.rs | src/server/cloud/iter.rs | use crate::{errors::Result, server::cloud::service::ObjectInfo};
use async_trait::async_trait;
#[async_trait]
pub(crate) trait AsyncObjectIterator {
async fn next(&mut self) -> Option<Result<ObjectInfo>>;
}
#[cfg(test)]
// This struct takes a synchronous iterator `I` and adapts it for async.
pub(crate) struct Syn... | rust | MIT | 45f5345daff60aba526db9e54dc03c8e0da37f14 | 2026-01-04T20:19:44.628446Z | false |
GothenburgBitFactory/taskchampion | https://github.com/GothenburgBitFactory/taskchampion/blob/45f5345daff60aba526db9e54dc03c8e0da37f14/src/server/local/mod.rs | src/server/local/mod.rs | use crate::errors::Result;
use crate::server::{
AddVersionResult, GetVersionResult, HistorySegment, Server, Snapshot, SnapshotUrgency,
VersionId, NIL_VERSION_ID,
};
use crate::storage::sqlite::StoredUuid;
use anyhow::Context;
use async_trait::async_trait;
use rusqlite::params;
use rusqlite::OptionalExtension;
u... | rust | MIT | 45f5345daff60aba526db9e54dc03c8e0da37f14 | 2026-01-04T20:19:44.628446Z | false |
GothenburgBitFactory/taskchampion | https://github.com/GothenburgBitFactory/taskchampion/blob/45f5345daff60aba526db9e54dc03c8e0da37f14/src/server/sync/mod.rs | src/server/sync/mod.rs | use crate::errors::{Error, Result};
use crate::server::{
http, AddVersionResult, GetVersionResult, HistorySegment, Server, Snapshot, SnapshotUrgency,
VersionId,
};
use async_trait::async_trait;
use reqwest::StatusCode;
use url::Url;
use uuid::Uuid;
use super::encryption::{Cryptor, Sealed, Secret, Unsealed};
p... | rust | MIT | 45f5345daff60aba526db9e54dc03c8e0da37f14 | 2026-01-04T20:19:44.628446Z | false |
GothenburgBitFactory/taskchampion | https://github.com/GothenburgBitFactory/taskchampion/blob/45f5345daff60aba526db9e54dc03c8e0da37f14/src/task/status.rs | src/task/status.rs | /// The status of a task, as defined by the task data model.
#[derive(Debug, PartialEq, Eq, Clone, strum_macros::Display)]
#[repr(C)]
pub enum Status {
Pending,
Completed,
Deleted,
Recurring,
/// Unknown signifies a status in the task DB that was not
/// recognized. This supports forward-compat... | rust | MIT | 45f5345daff60aba526db9e54dc03c8e0da37f14 | 2026-01-04T20:19:44.628446Z | false |
GothenburgBitFactory/taskchampion | https://github.com/GothenburgBitFactory/taskchampion/blob/45f5345daff60aba526db9e54dc03c8e0da37f14/src/task/annotation.rs | src/task/annotation.rs | use super::Timestamp;
/// An annotation for a task
#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Clone)]
pub struct Annotation {
/// Time the annotation was made
pub entry: Timestamp,
/// Content of the annotation
pub description: String,
}
| rust | MIT | 45f5345daff60aba526db9e54dc03c8e0da37f14 | 2026-01-04T20:19:44.628446Z | false |
GothenburgBitFactory/taskchampion | https://github.com/GothenburgBitFactory/taskchampion/blob/45f5345daff60aba526db9e54dc03c8e0da37f14/src/task/time.rs | src/task/time.rs | use chrono::{offset::LocalResult, DateTime, TimeZone, Utc};
pub(crate) type Timestamp = DateTime<Utc>;
pub fn utc_timestamp(secs: i64) -> Timestamp {
match Utc.timestamp_opt(secs, 0) {
LocalResult::Single(tz) => tz,
// The other two variants are None and Ambiguous, which both are caused by DST.
... | rust | MIT | 45f5345daff60aba526db9e54dc03c8e0da37f14 | 2026-01-04T20:19:44.628446Z | false |
GothenburgBitFactory/taskchampion | https://github.com/GothenburgBitFactory/taskchampion/blob/45f5345daff60aba526db9e54dc03c8e0da37f14/src/task/mod.rs | src/task/mod.rs | #![allow(clippy::module_inception)]
mod annotation;
mod data;
mod status;
mod tag;
mod task;
mod time;
pub use annotation::Annotation;
pub use data::TaskData;
pub use status::Status;
pub use tag::Tag;
pub use task::Task;
pub use time::utc_timestamp;
pub(crate) use time::Timestamp;
| rust | MIT | 45f5345daff60aba526db9e54dc03c8e0da37f14 | 2026-01-04T20:19:44.628446Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.