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 |
|---|---|---|---|---|---|---|---|---|
aspect-build/aspect-cli | https://github.com/aspect-build/aspect-cli/blob/683f7133a97bd2edb6ffb54569c3bb2a3c4e7eee/crates/axl-lsp/src/axl_context.rs | crates/axl-lsp/src/axl_context.rs | use axl_runtime::eval;
use starlark::docs::DocModule;
use starlark::errors::EvalMessage;
use starlark::syntax::AstModule;
use starlark::syntax::Dialect;
use starlark::syntax::DialectTypes;
use starlark_lsp::error::eval_message_to_lsp_diagnostic;
use starlark_lsp::server::LspContext;
use starlark_lsp::server::LspEvalRes... | rust | Apache-2.0 | 683f7133a97bd2edb6ffb54569c3bb2a3c4e7eee | 2026-01-04T20:17:03.553553Z | false |
aspect-build/aspect-cli | https://github.com/aspect-build/aspect-cli/blob/683f7133a97bd2edb6ffb54569c3bb2a3c4e7eee/crates/axl-lsp/src/main.rs | crates/axl-lsp/src/main.rs | mod axl_context;
fn main() -> anyhow::Result<()> {
println!("AXL LSP");
let ctx = axl_context::AxlContext {};
starlark_lsp::server::stdio_server(ctx)?;
Ok(())
}
| rust | Apache-2.0 | 683f7133a97bd2edb6ffb54569c3bb2a3c4e7eee | 2026-01-04T20:17:03.553553Z | false |
aspect-build/aspect-cli | https://github.com/aspect-build/aspect-cli/blob/683f7133a97bd2edb6ffb54569c3bb2a3c4e7eee/crates/aspect-telemetry/build.rs | crates/aspect-telemetry/build.rs | fn main() {
let target = std::env::var("TARGET").unwrap();
println!("cargo:rustc-env=BUILD_TARGET_TRIPLE={target}");
// We use the @platforms names for things
// Which are bad and terrible but we're sorta stuck with them
let (bzlos, bzlarch) = match target.as_str() {
"aarch64-apple-darwin" ... | rust | Apache-2.0 | 683f7133a97bd2edb6ffb54569c3bb2a3c4e7eee | 2026-01-04T20:17:03.553553Z | false |
aspect-build/aspect-cli | https://github.com/aspect-build/aspect-cli/blob/683f7133a97bd2edb6ffb54569c3bb2a3c4e7eee/crates/aspect-telemetry/src/lib.rs | crates/aspect-telemetry/src/lib.rs | use reqwest::header::HeaderName;
use reqwest::redirect::Policy;
use reqwest::{self, Method, StatusCode};
use std::env::var;
use std::time::Duration;
// The Bazel arch and os per @platforms and //bazel/platforms
pub static BZLOS: &str = env!("BUILD_BZLOS");
pub static BZLARCH: &str = env!("BUILD_BZLARCH");
// And the ... | rust | Apache-2.0 | 683f7133a97bd2edb6ffb54569c3bb2a3c4e7eee | 2026-01-04T20:17:03.553553Z | false |
aspect-build/aspect-cli | https://github.com/aspect-build/aspect-cli/blob/683f7133a97bd2edb6ffb54569c3bb2a3c4e7eee/crates/starbuf-derive/src/lib.rs | crates/starbuf-derive/src/lib.rs | extern crate proc_macro;
use std::collections::BTreeMap;
use anyhow::{bail, Error};
use darling::{FromField, FromMeta, FromVariant};
use proc_macro2::{Span, TokenStream};
use quote::{quote, ToTokens};
use syn::Item;
use syn::{parse_str, spanned::Spanned, Attribute, Field};
use syn::{
Data, DataEnum, DataStruct, D... | rust | Apache-2.0 | 683f7133a97bd2edb6ffb54569c3bb2a3c4e7eee | 2026-01-04T20:17:03.553553Z | false |
aspect-build/aspect-cli | https://github.com/aspect-build/aspect-cli/blob/683f7133a97bd2edb6ffb54569c3bb2a3c4e7eee/crates/galvanize/src/lib.rs | crates/galvanize/src/lib.rs | use std::fs::File;
use std::io::{self, ErrorKind, Read};
use std::path::PathBuf;
use nix::sys::stat::Mode;
use nix::unistd::mkfifo;
pub struct Pipe {
path: PathBuf,
inner: File,
policy: RetryPolicy,
}
pub enum RetryPolicy {
/// Never retry
Never,
/// Retries EOF errors if the FD is still open... | rust | Apache-2.0 | 683f7133a97bd2edb6ffb54569c3bb2a3c4e7eee | 2026-01-04T20:17:03.553553Z | false |
aspect-build/aspect-cli | https://github.com/aspect-build/aspect-cli/blob/683f7133a97bd2edb6ffb54569c3bb2a3c4e7eee/crates/example-tui/src/action_screen.rs | crates/example-tui/src/action_screen.rs | use ratatui::style::{Color, Style, Stylize};
use ratatui::text::{Line, Span, Text};
use ratatui::widgets::{
Block, Borders, List, ListDirection, ListState, Scrollbar, ScrollbarOrientation, ScrollbarState,
};
use ratatui::{layout::*, Frame, Terminal};
#[derive(Debug, Clone, Default)]
pub struct ActionScreen {}
imp... | rust | Apache-2.0 | 683f7133a97bd2edb6ffb54569c3bb2a3c4e7eee | 2026-01-04T20:17:03.553553Z | false |
aspect-build/aspect-cli | https://github.com/aspect-build/aspect-cli/blob/683f7133a97bd2edb6ffb54569c3bb2a3c4e7eee/crates/example-tui/src/dummy_backend.rs | crates/example-tui/src/dummy_backend.rs | use std::{fmt::Display, io::Write};
use anes::{ResetAttributes, SetAttribute, SetBackgroundColor, SetForegroundColor};
use ratatui::{
backend::WindowSize,
layout::{Position, Size},
style::{Color, Modifier},
};
use std::io::Result as IOResult;
/// A pure ANSI implementation of RataTUI's backend.
///
/// Th... | rust | Apache-2.0 | 683f7133a97bd2edb6ffb54569c3bb2a3c4e7eee | 2026-01-04T20:17:03.553553Z | false |
aspect-build/aspect-cli | https://github.com/aspect-build/aspect-cli/blob/683f7133a97bd2edb6ffb54569c3bb2a3c4e7eee/crates/example-tui/src/main_screen.rs | crates/example-tui/src/main_screen.rs | use ratatui::layout::*;
use ratatui::style::{Color, Style, Stylize};
use ratatui::text::{Line, Span, Text};
use ratatui::widgets::{List, ListDirection, ListState, Paragraph};
use ratatui::Frame;
use serde::{Deserialize, Serialize};
const LOGO: &'static str = include_str!("./bazel.txt");
#[derive(Default, Deserialize)... | rust | Apache-2.0 | 683f7133a97bd2edb6ffb54569c3bb2a3c4e7eee | 2026-01-04T20:17:03.553553Z | false |
aspect-build/aspect-cli | https://github.com/aspect-build/aspect-cli/blob/683f7133a97bd2edb6ffb54569c3bb2a3c4e7eee/crates/example-tui/src/main.rs | crates/example-tui/src/main.rs | mod action_screen;
mod dummy_backend;
mod main_screen;
use once_cell::sync::Lazy;
use peak_alloc::PeakAlloc;
use ratatui::backend::CrosstermBackend;
use ratatui::{crossterm, Terminal};
use std::ffi::CStr;
use std::io::Stdout;
use std::sync::RwLock;
use std::thread;
use std::time::Duration;
use crate::action_screen::A... | rust | Apache-2.0 | 683f7133a97bd2edb6ffb54569c3bb2a3c4e7eee | 2026-01-04T20:17:03.553553Z | false |
zenlist/serde_dynamo | https://github.com/zenlist/serde_dynamo/blob/c26133eb296bb921c486a27fbb1bb55bdaf05390/src/lib.rs | src/lib.rs | #![deny(warnings)]
#![deny(missing_docs)]
#![cfg_attr(docsrs, feature(doc_cfg))]
//! [DynamoDB] is an AWS database that stores key/value and document data.
//!
//! **serde_dynamo** provides a way to serialize and deserialize between data stored in these
//! items and strongly-typed Rust data structures.
//!
//!
//! ##... | rust | MIT | c26133eb296bb921c486a27fbb1bb55bdaf05390 | 2026-01-04T20:17:38.400599Z | false |
zenlist/serde_dynamo | https://github.com/zenlist/serde_dynamo/blob/c26133eb296bb921c486a27fbb1bb55bdaf05390/src/tests.rs | src/tests.rs | use super::{from_item, to_item, Item};
use serde_derive::{Deserialize, Serialize};
fn round_trip<T>(value: T)
where
T: serde::Serialize + serde::de::DeserializeOwned + Eq + Clone + std::fmt::Debug,
{
let serialized = to_item::<T, Item>(value.clone()).unwrap();
let deserialized = from_item::<Item, T>(serial... | rust | MIT | c26133eb296bb921c486a27fbb1bb55bdaf05390 | 2026-01-04T20:17:38.400599Z | false |
zenlist/serde_dynamo | https://github.com/zenlist/serde_dynamo/blob/c26133eb296bb921c486a27fbb1bb55bdaf05390/src/error.rs | src/error.rs | use serde_core::{de, ser};
use std::fmt::{self, Display};
/// This type represents all possible errors that can occur when serializing or deserializing
/// DynamoDB data.
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct Error(ErrorImpl);
impl Display for Error {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::... | rust | MIT | c26133eb296bb921c486a27fbb1bb55bdaf05390 | 2026-01-04T20:17:38.400599Z | false |
zenlist/serde_dynamo | https://github.com/zenlist/serde_dynamo/blob/c26133eb296bb921c486a27fbb1bb55bdaf05390/src/string_set.rs | src/string_set.rs | //! Serializer codec for serializing a list of strings as a set
//!
//! # Usage
//!
//! To use, annotate the field with `#[serde(with = "serde_dynamo::string_set")]`.
//!
//! DynamoDB will return an error if given an empty set. Thus, it may
//! be beneficial to additionally annotate the field with `#[serde(default)]`
/... | rust | MIT | c26133eb296bb921c486a27fbb1bb55bdaf05390 | 2026-01-04T20:17:38.400599Z | false |
zenlist/serde_dynamo | https://github.com/zenlist/serde_dynamo/blob/c26133eb296bb921c486a27fbb1bb55bdaf05390/src/binary_set.rs | src/binary_set.rs | //! Serializer codec for serializing a list of binaries as a set
//!
//! # Usage
//!
//! To use, annotate the field with `#[serde(with = "serde_dynamo::binary_set")]`.
//!
//! DynamoDB will return an error if given an empty set. Thus, it may
//! be beneficial to additionally annotate the field with `#[serde(default)]`
... | rust | MIT | c26133eb296bb921c486a27fbb1bb55bdaf05390 | 2026-01-04T20:17:38.400599Z | false |
zenlist/serde_dynamo | https://github.com/zenlist/serde_dynamo/blob/c26133eb296bb921c486a27fbb1bb55bdaf05390/src/attribute_value.rs | src/attribute_value.rs | use base64::Engine;
use std::collections::HashMap;
const BASE64_ENGINE: base64::engine::GeneralPurpose = base64::engine::general_purpose::STANDARD;
/// The value for an attribute that comes from DynamoDb.
#[derive(Debug, Clone, Eq, PartialEq)]
pub enum AttributeValue {
/// An attribute of type Number. For example... | rust | MIT | c26133eb296bb921c486a27fbb1bb55bdaf05390 | 2026-01-04T20:17:38.400599Z | false |
zenlist/serde_dynamo | https://github.com/zenlist/serde_dynamo/blob/c26133eb296bb921c486a27fbb1bb55bdaf05390/src/number_set.rs | src/number_set.rs | //! Serializer codec for serializing a list of numbers as a set
//!
//! # Usage
//!
//! To use, annotate the field with `#[serde(with = "serde_dynamo::number_set")]`.
//!
//! DynamoDB will return an error if given an empty set. Thus, it may
//! be beneficial to additionally annotate the field with `#[serde(default)]`
/... | rust | MIT | c26133eb296bb921c486a27fbb1bb55bdaf05390 | 2026-01-04T20:17:38.400599Z | false |
zenlist/serde_dynamo | https://github.com/zenlist/serde_dynamo/blob/c26133eb296bb921c486a27fbb1bb55bdaf05390/src/de/tests.rs | src/de/tests.rs | #![allow(clippy::float_cmp, clippy::redundant_clone, clippy::unit_cmp)]
use crate::from_attribute_value;
use crate::AttributeValue;
use serde_derive::{Deserialize, Serialize};
use std::collections::HashMap;
macro_rules! assert_identical_json {
($ty:ty, $expr:expr) => {
assert_identical_json::<$ty>($expr, ... | rust | MIT | c26133eb296bb921c486a27fbb1bb55bdaf05390 | 2026-01-04T20:17:38.400599Z | false |
zenlist/serde_dynamo | https://github.com/zenlist/serde_dynamo/blob/c26133eb296bb921c486a27fbb1bb55bdaf05390/src/de/deserializer_map.rs | src/de/deserializer_map.rs | use super::{AttributeValue, Deserializer, Error, ErrorImpl, Result};
use serde_core::{
de::{self, DeserializeSeed, MapAccess, Visitor},
forward_to_deserialize_any,
};
use std::collections::HashMap;
pub struct DeserializerMap<'a> {
drain: std::collections::hash_map::Drain<'a, String, AttributeValue>,
re... | rust | MIT | c26133eb296bb921c486a27fbb1bb55bdaf05390 | 2026-01-04T20:17:38.400599Z | false |
zenlist/serde_dynamo | https://github.com/zenlist/serde_dynamo/blob/c26133eb296bb921c486a27fbb1bb55bdaf05390/src/de/deserializer_seq.rs | src/de/deserializer_seq.rs | use super::deserializer_bytes::DeserializerBytes;
use super::deserializer_number::DeserializerNumber;
use super::{AttributeValue, Deserializer, Error, Result};
use serde_core::de::{DeserializeSeed, IntoDeserializer, SeqAccess};
pub struct DeserializerSeq {
iter: std::vec::IntoIter<AttributeValue>,
}
impl Deserial... | rust | MIT | c26133eb296bb921c486a27fbb1bb55bdaf05390 | 2026-01-04T20:17:38.400599Z | false |
zenlist/serde_dynamo | https://github.com/zenlist/serde_dynamo/blob/c26133eb296bb921c486a27fbb1bb55bdaf05390/src/de/deserializer_enum.rs | src/de/deserializer_enum.rs | use super::{AttributeValue, Deserializer, Error, ErrorImpl, Result};
use serde_core::de::{
DeserializeSeed, Deserializer as _, EnumAccess, IntoDeserializer, VariantAccess, Visitor,
};
use std::collections::HashMap;
pub struct DeserializerEnum {
input: HashMap<String, AttributeValue>,
}
impl DeserializerEnum {... | rust | MIT | c26133eb296bb921c486a27fbb1bb55bdaf05390 | 2026-01-04T20:17:38.400599Z | false |
zenlist/serde_dynamo | https://github.com/zenlist/serde_dynamo/blob/c26133eb296bb921c486a27fbb1bb55bdaf05390/src/de/mod.rs | src/de/mod.rs | use super::AttributeValue;
use crate::{error::ErrorImpl, Error, Item, Items, Result};
use serde_core::Deserialize;
use std::collections::HashMap;
mod deserializer;
mod deserializer_bytes;
mod deserializer_enum;
mod deserializer_map;
mod deserializer_number;
mod deserializer_seq;
#[cfg(test)]
mod tests;
pub use deser... | rust | MIT | c26133eb296bb921c486a27fbb1bb55bdaf05390 | 2026-01-04T20:17:38.400599Z | false |
zenlist/serde_dynamo | https://github.com/zenlist/serde_dynamo/blob/c26133eb296bb921c486a27fbb1bb55bdaf05390/src/de/deserializer_bytes.rs | src/de/deserializer_bytes.rs | use super::{Error, Result};
use serde_core::de::{self, Visitor};
use serde_core::forward_to_deserialize_any;
pub struct DeserializerBytes<T> {
input: T,
}
impl<T> DeserializerBytes<T> {
pub fn from_bytes(input: T) -> Self {
DeserializerBytes { input }
}
}
impl<'de, T> de::Deserializer<'de> for De... | rust | MIT | c26133eb296bb921c486a27fbb1bb55bdaf05390 | 2026-01-04T20:17:38.400599Z | false |
zenlist/serde_dynamo | https://github.com/zenlist/serde_dynamo/blob/c26133eb296bb921c486a27fbb1bb55bdaf05390/src/de/deserializer.rs | src/de/deserializer.rs | use super::{
deserializer_bytes::DeserializerBytes,
deserializer_enum::DeserializerEnum,
deserializer_map::DeserializerMap,
deserializer_number::DeserializerNumber,
deserializer_seq::{
DeserializerSeq, DeserializerSeqBytes, DeserializerSeqNumbers, DeserializerSeqStrings,
},
Attribute... | rust | MIT | c26133eb296bb921c486a27fbb1bb55bdaf05390 | 2026-01-04T20:17:38.400599Z | false |
zenlist/serde_dynamo | https://github.com/zenlist/serde_dynamo/blob/c26133eb296bb921c486a27fbb1bb55bdaf05390/src/de/deserializer_number.rs | src/de/deserializer_number.rs | use super::{Error, ErrorImpl, Result};
use serde_core::de::{self, Visitor};
use serde_core::forward_to_deserialize_any;
pub struct DeserializerNumber {
input: String,
}
impl DeserializerNumber {
pub fn from_string(input: String) -> Self {
DeserializerNumber { input }
}
fn deserialize_number<'... | rust | MIT | c26133eb296bb921c486a27fbb1bb55bdaf05390 | 2026-01-04T20:17:38.400599Z | false |
zenlist/serde_dynamo | https://github.com/zenlist/serde_dynamo/blob/c26133eb296bb921c486a27fbb1bb55bdaf05390/src/macros/aws_sdk_streams.rs | src/macros/aws_sdk_streams.rs | macro_rules! aws_sdk_streams_macro {
(
feature = $feature:literal,
crate_name = $crate_name:ident,
mod_name = $mod_name:ident,
attribute_value_path = $attribute_value_path:path,
blob_path = $blob_path:path,
aws_version = $version:literal,
) => {
#[cfg(feat... | rust | MIT | c26133eb296bb921c486a27fbb1bb55bdaf05390 | 2026-01-04T20:17:38.400599Z | false |
zenlist/serde_dynamo | https://github.com/zenlist/serde_dynamo/blob/c26133eb296bb921c486a27fbb1bb55bdaf05390/src/macros/aws_sdk.rs | src/macros/aws_sdk.rs | macro_rules! aws_sdk_macro {
(
feature = $feature:literal,
crate_name = $crate_name:ident,
mod_name = $mod_name:ident,
attribute_value_path = $attribute_value_path:path,
blob_path = $blob_path:path,
aws_version = $version:literal,
config_version = $config_vers... | rust | MIT | c26133eb296bb921c486a27fbb1bb55bdaf05390 | 2026-01-04T20:17:38.400599Z | false |
zenlist/serde_dynamo | https://github.com/zenlist/serde_dynamo/blob/c26133eb296bb921c486a27fbb1bb55bdaf05390/src/macros/rusoto.rs | src/macros/rusoto.rs | macro_rules! rusoto_macro {
(feature = $feature:literal, crate_name = $crate_name:ident, mod_name = $mod_name:ident, rusoto_version = $version:literal,) => {
#[cfg(feature = $feature)]
#[cfg_attr(docsrs, doc(cfg(feature = $feature)))]
pub mod $mod_name {
#![doc = concat!("Support... | rust | MIT | c26133eb296bb921c486a27fbb1bb55bdaf05390 | 2026-01-04T20:17:38.400599Z | false |
zenlist/serde_dynamo | https://github.com/zenlist/serde_dynamo/blob/c26133eb296bb921c486a27fbb1bb55bdaf05390/src/macros/aws_sdk_before_0_35.rs | src/macros/aws_sdk_before_0_35.rs | macro_rules! aws_sdk_macro_before_0_35 {
(
feature = $feature:literal,
crate_name = $crate_name:ident,
mod_name = $mod_name:ident,
attribute_value_path = $attribute_value_path:path,
blob_path = $blob_path:path,
aws_version = $version:literal,
config_version = ... | rust | MIT | c26133eb296bb921c486a27fbb1bb55bdaf05390 | 2026-01-04T20:17:38.400599Z | false |
zenlist/serde_dynamo | https://github.com/zenlist/serde_dynamo/blob/c26133eb296bb921c486a27fbb1bb55bdaf05390/src/macros/mod.rs | src/macros/mod.rs | mod aws_lambda_events;
mod aws_sdk;
mod aws_sdk_before_0_35;
mod aws_sdk_streams;
mod rusoto;
mod rusoto_streams;
pub(crate) use aws_lambda_events::aws_lambda_events_macro;
pub(crate) use aws_sdk::aws_sdk_macro;
pub(crate) use aws_sdk_before_0_35::aws_sdk_macro_before_0_35;
pub(crate) use aws_sdk_streams::aws_sdk_stre... | rust | MIT | c26133eb296bb921c486a27fbb1bb55bdaf05390 | 2026-01-04T20:17:38.400599Z | false |
zenlist/serde_dynamo | https://github.com/zenlist/serde_dynamo/blob/c26133eb296bb921c486a27fbb1bb55bdaf05390/src/macros/aws_lambda_events.rs | src/macros/aws_lambda_events.rs | macro_rules! aws_lambda_events_macro {
(feature = $feature:literal, crate_name = $crate_name:ident, mod_name = $mod_name:ident, aws_lambda_events_version = $version:literal,) => {
#[cfg(feature = $feature)]
#[cfg_attr(docsrs, doc(cfg(feature = $feature)))]
pub mod $mod_name {
#![... | rust | MIT | c26133eb296bb921c486a27fbb1bb55bdaf05390 | 2026-01-04T20:17:38.400599Z | false |
zenlist/serde_dynamo | https://github.com/zenlist/serde_dynamo/blob/c26133eb296bb921c486a27fbb1bb55bdaf05390/src/macros/rusoto_streams.rs | src/macros/rusoto_streams.rs | macro_rules! rusoto_streams_macro {
(feature = $feature:literal, crate_name = $crate_name:ident, mod_name = $mod_name:ident, rusoto_version = $version:literal,) => {
#[cfg(feature = $feature)]
#[cfg_attr(docsrs, doc(cfg(feature = $feature)))]
pub mod $mod_name {
#![doc = concat!(... | rust | MIT | c26133eb296bb921c486a27fbb1bb55bdaf05390 | 2026-01-04T20:17:38.400599Z | false |
zenlist/serde_dynamo | https://github.com/zenlist/serde_dynamo/blob/c26133eb296bb921c486a27fbb1bb55bdaf05390/src/ser/tests.rs | src/ser/tests.rs | #![allow(clippy::float_cmp, clippy::redundant_clone)]
use crate::{to_attribute_value, to_item};
use crate::{AttributeValue, Item};
use serde_derive::{Deserialize, Serialize};
use std::collections::HashMap;
macro_rules! assert_identical_json {
($expr:expr) => {
assert_identical_json($expr, $expr);
};
}... | rust | MIT | c26133eb296bb921c486a27fbb1bb55bdaf05390 | 2026-01-04T20:17:38.400599Z | false |
zenlist/serde_dynamo | https://github.com/zenlist/serde_dynamo/blob/c26133eb296bb921c486a27fbb1bb55bdaf05390/src/ser/serializer.rs | src/ser/serializer.rs | use super::{
AttributeValue, Error, SerializerMap, SerializerSeq, SerializerStruct, SerializerStructVariant,
SerializerTupleVariant,
};
use serde_core::{ser, Serialize};
use std::collections::HashMap;
/// A structure for serializing Rust values into [`AttributeValue`]s.
#[derive(Copy, Clone, Debug, Default)]
p... | rust | MIT | c26133eb296bb921c486a27fbb1bb55bdaf05390 | 2026-01-04T20:17:38.400599Z | false |
zenlist/serde_dynamo | https://github.com/zenlist/serde_dynamo/blob/c26133eb296bb921c486a27fbb1bb55bdaf05390/src/ser/serializer_seq.rs | src/ser/serializer_seq.rs | use super::{AttributeValue, Error, Result, Serializer};
use serde_core::{ser, Serialize};
pub struct SerializerSeq {
vec: Vec<AttributeValue>,
}
impl SerializerSeq {
pub fn new(len: Option<usize>) -> Self {
let vec = if let Some(len) = len {
Vec::with_capacity(len)
} else {
... | rust | MIT | c26133eb296bb921c486a27fbb1bb55bdaf05390 | 2026-01-04T20:17:38.400599Z | false |
zenlist/serde_dynamo | https://github.com/zenlist/serde_dynamo/blob/c26133eb296bb921c486a27fbb1bb55bdaf05390/src/ser/serializer_struct.rs | src/ser/serializer_struct.rs | use super::{AttributeValue, Error, Result, Serializer};
use serde_core::{ser, Serialize};
use std::collections::HashMap;
pub struct SerializerStruct {
item: HashMap<String, AttributeValue>,
}
impl SerializerStruct {
pub fn new(len: usize) -> Self {
SerializerStruct {
item: HashMap::with_ca... | rust | MIT | c26133eb296bb921c486a27fbb1bb55bdaf05390 | 2026-01-04T20:17:38.400599Z | false |
zenlist/serde_dynamo | https://github.com/zenlist/serde_dynamo/blob/c26133eb296bb921c486a27fbb1bb55bdaf05390/src/ser/mod.rs | src/ser/mod.rs | use super::AttributeValue;
use crate::{error::ErrorImpl, Error, Item, Result};
use serde_core::Serialize;
mod serializer;
mod serializer_map;
mod serializer_seq;
mod serializer_struct;
mod serializer_struct_variant;
mod serializer_tuple_variant;
#[cfg(test)]
mod tests;
pub use serializer::Serializer;
use serializer_... | rust | MIT | c26133eb296bb921c486a27fbb1bb55bdaf05390 | 2026-01-04T20:17:38.400599Z | false |
zenlist/serde_dynamo | https://github.com/zenlist/serde_dynamo/blob/c26133eb296bb921c486a27fbb1bb55bdaf05390/src/ser/serializer_tuple_variant.rs | src/ser/serializer_tuple_variant.rs | use super::{AttributeValue, Error, Result, Serializer};
use serde_core::{ser, Serialize};
use std::collections::HashMap;
pub struct SerializerTupleVariant {
key: &'static str,
vec: Vec<AttributeValue>,
}
impl SerializerTupleVariant {
pub fn new(key: &'static str, len: usize) -> Self {
Self {
... | rust | MIT | c26133eb296bb921c486a27fbb1bb55bdaf05390 | 2026-01-04T20:17:38.400599Z | false |
zenlist/serde_dynamo | https://github.com/zenlist/serde_dynamo/blob/c26133eb296bb921c486a27fbb1bb55bdaf05390/src/ser/serializer_struct_variant.rs | src/ser/serializer_struct_variant.rs | use super::{AttributeValue, Error, Result, Serializer};
use serde_core::{ser, Serialize};
use std::collections::HashMap;
pub struct SerializerStructVariant {
key: &'static str,
item: HashMap<String, AttributeValue>,
}
impl SerializerStructVariant {
pub fn new(key: &'static str, len: usize) -> Self {
... | rust | MIT | c26133eb296bb921c486a27fbb1bb55bdaf05390 | 2026-01-04T20:17:38.400599Z | false |
zenlist/serde_dynamo | https://github.com/zenlist/serde_dynamo/blob/c26133eb296bb921c486a27fbb1bb55bdaf05390/src/ser/serializer_map.rs | src/ser/serializer_map.rs | use super::{AttributeValue, Error, ErrorImpl, Result, Serializer};
use serde_core::{ser, Serialize};
use std::collections::HashMap;
pub struct SerializerMap {
item: HashMap<String, AttributeValue>,
next_key: Option<String>,
}
impl SerializerMap {
pub fn new(len: Option<usize>) -> Self {
let item =... | rust | MIT | c26133eb296bb921c486a27fbb1bb55bdaf05390 | 2026-01-04T20:17:38.400599Z | false |
srijs/rust-tokio-retry | https://github.com/srijs/rust-tokio-retry/blob/88eab611f8721e08ab8792b2acf2c0af8ccb645a/src/lib.rs | src/lib.rs | //! This library provides extensible asynchronous retry behaviours
//! for use with the ecosystem of [`tokio`](https://tokio.rs/) libraries.
//!
//! # Installation
//!
//! Add this to your `Cargo.toml`:
//!
//! ```toml
//! [dependencies]
//! tokio-retry = "0.3"
//! ```
//!
//! # Example
//!
//! ```rust,no_run
//! # ext... | rust | MIT | 88eab611f8721e08ab8792b2acf2c0af8ccb645a | 2026-01-04T20:17:43.779274Z | false |
srijs/rust-tokio-retry | https://github.com/srijs/rust-tokio-retry/blob/88eab611f8721e08ab8792b2acf2c0af8ccb645a/src/future.rs | src/future.rs | use std::cmp;
use std::error;
use std::fmt;
use std::future::Future;
use std::iter::{IntoIterator, Iterator};
use std::pin::Pin;
use std::task::{Context, Poll};
use pin_project::pin_project;
use tokio::time::{sleep_until, Duration, Instant, Sleep};
use super::action::Action;
use super::condition::Condition;
#[pin_pr... | rust | MIT | 88eab611f8721e08ab8792b2acf2c0af8ccb645a | 2026-01-04T20:17:43.779274Z | false |
srijs/rust-tokio-retry | https://github.com/srijs/rust-tokio-retry/blob/88eab611f8721e08ab8792b2acf2c0af8ccb645a/src/condition.rs | src/condition.rs | /// Specifies under which conditions a retry is attempted.
pub trait Condition<E> {
fn should_retry(&mut self, error: &E) -> bool;
}
impl<E, F: FnMut(&E) -> bool> Condition<E> for F {
fn should_retry(&mut self, error: &E) -> bool {
self(error)
}
}
| rust | MIT | 88eab611f8721e08ab8792b2acf2c0af8ccb645a | 2026-01-04T20:17:43.779274Z | false |
srijs/rust-tokio-retry | https://github.com/srijs/rust-tokio-retry/blob/88eab611f8721e08ab8792b2acf2c0af8ccb645a/src/action.rs | src/action.rs | use std::future::Future;
/// An action can be run multiple times and produces a future.
pub trait Action {
/// The future that this action produces.
type Future: Future<Output = Result<Self::Item, Self::Error>>;
/// The item that the future may resolve with.
type Item;
/// The error that the future... | rust | MIT | 88eab611f8721e08ab8792b2acf2c0af8ccb645a | 2026-01-04T20:17:43.779274Z | false |
srijs/rust-tokio-retry | https://github.com/srijs/rust-tokio-retry/blob/88eab611f8721e08ab8792b2acf2c0af8ccb645a/src/strategy/fibonacci_backoff.rs | src/strategy/fibonacci_backoff.rs | use std::iter::Iterator;
use std::time::Duration;
use std::u64::MAX as U64_MAX;
/// A retry strategy driven by the fibonacci series.
///
/// Each retry uses a delay which is the sum of the two previous delays.
///
/// Depending on the problem at hand, a fibonacci retry strategy might
/// perform better and lead to bet... | rust | MIT | 88eab611f8721e08ab8792b2acf2c0af8ccb645a | 2026-01-04T20:17:43.779274Z | false |
srijs/rust-tokio-retry | https://github.com/srijs/rust-tokio-retry/blob/88eab611f8721e08ab8792b2acf2c0af8ccb645a/src/strategy/exponential_backoff.rs | src/strategy/exponential_backoff.rs | use std::iter::Iterator;
use std::time::Duration;
use std::u64::MAX as U64_MAX;
/// A retry strategy driven by exponential back-off.
///
/// The power corresponds to the number of past attempts.
#[derive(Debug, Clone)]
pub struct ExponentialBackoff {
current: u64,
base: u64,
factor: u64,
max_delay: Opt... | rust | MIT | 88eab611f8721e08ab8792b2acf2c0af8ccb645a | 2026-01-04T20:17:43.779274Z | false |
srijs/rust-tokio-retry | https://github.com/srijs/rust-tokio-retry/blob/88eab611f8721e08ab8792b2acf2c0af8ccb645a/src/strategy/mod.rs | src/strategy/mod.rs | mod exponential_backoff;
mod fibonacci_backoff;
mod fixed_interval;
mod jitter;
pub use self::exponential_backoff::ExponentialBackoff;
pub use self::fibonacci_backoff::FibonacciBackoff;
pub use self::fixed_interval::FixedInterval;
pub use self::jitter::jitter;
| rust | MIT | 88eab611f8721e08ab8792b2acf2c0af8ccb645a | 2026-01-04T20:17:43.779274Z | false |
srijs/rust-tokio-retry | https://github.com/srijs/rust-tokio-retry/blob/88eab611f8721e08ab8792b2acf2c0af8ccb645a/src/strategy/jitter.rs | src/strategy/jitter.rs | use std::time::Duration;
pub fn jitter(duration: Duration) -> Duration {
duration.mul_f64(rand::random::<f64>())
}
| rust | MIT | 88eab611f8721e08ab8792b2acf2c0af8ccb645a | 2026-01-04T20:17:43.779274Z | false |
srijs/rust-tokio-retry | https://github.com/srijs/rust-tokio-retry/blob/88eab611f8721e08ab8792b2acf2c0af8ccb645a/src/strategy/fixed_interval.rs | src/strategy/fixed_interval.rs | use std::iter::Iterator;
use std::time::Duration;
/// A retry strategy driven by a fixed interval.
#[derive(Debug, Clone)]
pub struct FixedInterval {
duration: Duration,
}
impl FixedInterval {
/// Constructs a new fixed interval strategy.
pub fn new(duration: Duration) -> FixedInterval {
FixedInte... | rust | MIT | 88eab611f8721e08ab8792b2acf2c0af8ccb645a | 2026-01-04T20:17:43.779274Z | false |
srijs/rust-tokio-retry | https://github.com/srijs/rust-tokio-retry/blob/88eab611f8721e08ab8792b2acf2c0af8ccb645a/tests/future.rs | tests/future.rs | use std::future;
use std::iter::Take;
use std::sync::atomic::{AtomicUsize, Ordering};
use std::sync::Arc;
use tokio_retry::{Retry, RetryIf};
#[tokio::test]
async fn attempts_just_once() {
use std::iter::empty;
let counter = Arc::new(AtomicUsize::new(0));
let cloned_counter = counter.clone();
let futur... | rust | MIT | 88eab611f8721e08ab8792b2acf2c0af8ccb645a | 2026-01-04T20:17:43.779274Z | false |
gx0r/rrgeo | https://github.com/gx0r/rrgeo/blob/308ce2b54b61de23b79cc2b7cc67b9800dac3f97/axum/src/main.rs | axum/src/main.rs | use axum::{extract::Query, http::StatusCode, response::IntoResponse, routing::get, Json, Router};
use lazy_static::lazy_static;
use reverse_geocoder::ReverseGeocoder;
use serde::Deserialize;
use tokio::net::TcpListener;
lazy_static! {
static ref GEOCODER: ReverseGeocoder = ReverseGeocoder::new();
}
#[tokio::main]... | rust | Apache-2.0 | 308ce2b54b61de23b79cc2b7cc67b9800dac3f97 | 2026-01-04T20:17:41.994046Z | false |
gx0r/rrgeo | https://github.com/gx0r/rrgeo/blob/308ce2b54b61de23b79cc2b7cc67b9800dac3f97/cmd/src/cmdline.rs | cmd/src/cmdline.rs | use reverse_geocoder::ReverseGeocoder;
use std::error::Error;
use std::time::Instant;
use std::{env, process::exit};
fn main() -> Result<(), Box<dyn Error>> {
let args: Vec<_> = env::args().collect();
if args.len() < 3 {
eprint!("Usage: rreverse lat long\n e.g., rreverse 40.7831 -73.9712\n\n");
... | rust | Apache-2.0 | 308ce2b54b61de23b79cc2b7cc67b9800dac3f97 | 2026-01-04T20:17:41.994046Z | false |
gx0r/rrgeo | https://github.com/gx0r/rrgeo/blob/308ce2b54b61de23b79cc2b7cc67b9800dac3f97/reverse-geocoder/src/reverse_geocoder.rs | reverse-geocoder/src/reverse_geocoder.rs | //! A library for fast, offline reverse geocoding. The location data are from [GeoNames](http://www.geonames.org/).
//!
//! # Usage
//! ```
//! use reverse_geocoder::{ReverseGeocoder, SearchResult};
//!
//! fn main() {
//! let geocoder = ReverseGeocoder::new();
//! let coords = (40.7831, -73.9712);
//! let ... | rust | Apache-2.0 | 308ce2b54b61de23b79cc2b7cc67b9800dac3f97 | 2026-01-04T20:17:41.994046Z | false |
gx0r/rrgeo | https://github.com/gx0r/rrgeo/blob/308ce2b54b61de23b79cc2b7cc67b9800dac3f97/reverse-geocoder/benches/benchmark.rs | reverse-geocoder/benches/benchmark.rs | #[macro_use]
extern crate criterion;
#[macro_use]
extern crate lazy_static;
extern crate reverse_geocoder;
use reverse_geocoder::ReverseGeocoder;
use criterion::Criterion;
lazy_static! {
static ref GEOCODER: ReverseGeocoder = ReverseGeocoder::new();
}
fn criterion_benchmark(c: &mut Criterion) {
c.bench_func... | rust | Apache-2.0 | 308ce2b54b61de23b79cc2b7cc67b9800dac3f97 | 2026-01-04T20:17:41.994046Z | false |
gx0r/rrgeo | https://github.com/gx0r/rrgeo/blob/308ce2b54b61de23b79cc2b7cc67b9800dac3f97/warp/src/warp.rs | warp/src/warp.rs | use lazy_static::lazy_static;
use reverse_geocoder::ReverseGeocoder;
use serde_derive::Deserialize;
use warp::Filter;
#[derive(Deserialize)]
struct LatLong {
lat: f64,
long: f64,
}
lazy_static! {
static ref GEOCODER: ReverseGeocoder = ReverseGeocoder::new();
}
#[tokio::main]
async fn main() {
let hel... | rust | Apache-2.0 | 308ce2b54b61de23b79cc2b7cc67b9800dac3f97 | 2026-01-04T20:17:41.994046Z | false |
gx0r/rrgeo | https://github.com/gx0r/rrgeo/blob/308ce2b54b61de23b79cc2b7cc67b9800dac3f97/actix/src/actix.rs | actix/src/actix.rs | use actix_web::{http::KeepAlive, middleware, web, App, HttpServer, Result};
use lazy_static::lazy_static;
use reverse_geocoder::{Record, ReverseGeocoder};
use serde_derive::Deserialize;
use std::time::Duration;
#[derive(Deserialize)]
struct LatLong {
lat: f64,
long: f64,
}
async fn index(lat_long: web::Query<... | rust | Apache-2.0 | 308ce2b54b61de23b79cc2b7cc67b9800dac3f97 | 2026-01-04T20:17:41.994046Z | false |
kellpossible/cargo-i18n | https://github.com/kellpossible/cargo-i18n/blob/659b53c45bc68b0742696bc8f53fc6cace83b11b/i18n-embed-fl/src/lib.rs | i18n-embed-fl/src/lib.rs | use fluent::concurrent::FluentBundle;
use fluent::{FluentAttribute, FluentMessage, FluentResource};
use fluent_syntax::ast::{CallArguments, Expression, InlineExpression, Pattern, PatternElement};
use i18n_embed::{fluent::FluentLanguageLoader, FileSystemAssets, LanguageLoader};
use proc_macro::TokenStream;
use proc_macr... | rust | MIT | 659b53c45bc68b0742696bc8f53fc6cace83b11b | 2026-01-04T20:17:34.492149Z | false |
kellpossible/cargo-i18n | https://github.com/kellpossible/cargo-i18n/blob/659b53c45bc68b0742696bc8f53fc6cace83b11b/i18n-embed-fl/tests/fl_macro.rs | i18n-embed-fl/tests/fl_macro.rs | use i18n_embed::{
fluent::{fluent_language_loader, FluentLanguageLoader},
LanguageLoader,
};
use i18n_embed_fl::fl;
use rust_embed::RustEmbed;
use std::collections::HashMap;
#[derive(RustEmbed)]
#[folder = "i18n/"]
struct Localizations;
#[test]
fn with_args_hashmap() {
let loader: FluentLanguageLoader = f... | rust | MIT | 659b53c45bc68b0742696bc8f53fc6cace83b11b | 2026-01-04T20:17:34.492149Z | false |
kellpossible/cargo-i18n | https://github.com/kellpossible/cargo-i18n/blob/659b53c45bc68b0742696bc8f53fc6cace83b11b/i18n-embed-fl/examples/web-server/src/main.rs | i18n-embed-fl/examples/web-server/src/main.rs | use i18n_embed::{
fluent::{fluent_language_loader, FluentLanguageLoader, NegotiationStrategy},
LanguageLoader,
};
use i18n_embed_fl::fl;
use rust_embed::RustEmbed;
#[derive(RustEmbed)]
#[folder = "i18n/"]
struct Localizations;
fn main() {
let loader: FluentLanguageLoader = fluent_language_loader!();
l... | rust | MIT | 659b53c45bc68b0742696bc8f53fc6cace83b11b | 2026-01-04T20:17:34.492149Z | false |
kellpossible/cargo-i18n | https://github.com/kellpossible/cargo-i18n/blob/659b53c45bc68b0742696bc8f53fc6cace83b11b/src/lib.rs | src/lib.rs | #[cfg(doctest)]
#[macro_use]
extern crate doc_comment;
#[cfg(doctest)]
doctest!("../README.md");
| rust | MIT | 659b53c45bc68b0742696bc8f53fc6cace83b11b | 2026-01-04T20:17:34.492149Z | false |
kellpossible/cargo-i18n | https://github.com/kellpossible/cargo-i18n/blob/659b53c45bc68b0742696bc8f53fc6cace83b11b/src/main.rs | src/main.rs | use anyhow::Result;
use clap::{builder::PossibleValuesParser, crate_authors, crate_version, Arg, Command};
use i18n_build::run;
use i18n_config::Crate;
use i18n_embed::{
gettext::{gettext_language_loader, GettextLanguageLoader},
DefaultLocalizer, DesktopLanguageRequester, LanguageLoader, LanguageRequester, Loca... | rust | MIT | 659b53c45bc68b0742696bc8f53fc6cace83b11b | 2026-01-04T20:17:34.492149Z | false |
kellpossible/cargo-i18n | https://github.com/kellpossible/cargo-i18n/blob/659b53c45bc68b0742696bc8f53fc6cace83b11b/i18n-build/src/lib.rs | i18n-build/src/lib.rs | //! This library is designed for use within the
//! [cargo-i18n](https://crates.io/crates/cargo_i18n) tool for
//! localizing crates. It has been exposed and published as a library
//! to allow its direct use within project build scripts if required.
//!
//! `xtr` (installed with `cargo install xtr`), and GNU Gettext C... | rust | MIT | 659b53c45bc68b0742696bc8f53fc6cace83b11b | 2026-01-04T20:17:34.492149Z | false |
kellpossible/cargo-i18n | https://github.com/kellpossible/cargo-i18n/blob/659b53c45bc68b0742696bc8f53fc6cace83b11b/i18n-build/src/error.rs | i18n-build/src/error.rs | //! Error types for use with the `i18n_build` library.
use std::fmt::Display;
use std::io;
use std::path::PathBuf;
use thiserror::Error;
use tr::tr;
/// Type of path being represented in an error message.
#[derive(Debug)]
pub enum PathType {
File,
Directory,
Symlink,
}
impl Display for PathType {
fn ... | rust | MIT | 659b53c45bc68b0742696bc8f53fc6cace83b11b | 2026-01-04T20:17:34.492149Z | false |
kellpossible/cargo-i18n | https://github.com/kellpossible/cargo-i18n/blob/659b53c45bc68b0742696bc8f53fc6cace83b11b/i18n-build/src/util.rs | i18n-build/src/util.rs | //! Utility functions for use with the `i18n_build` library.
use log::debug;
use std::fs::{create_dir_all, remove_file, rename};
use std::path::Path;
use std::process::Command;
use crate::error::PathError;
use anyhow::{ensure, Context, Result};
use tr::tr;
/// Run the specified command, check that it's output was re... | rust | MIT | 659b53c45bc68b0742696bc8f53fc6cace83b11b | 2026-01-04T20:17:34.492149Z | false |
kellpossible/cargo-i18n | https://github.com/kellpossible/cargo-i18n/blob/659b53c45bc68b0742696bc8f53fc6cace83b11b/i18n-build/src/watch.rs | i18n-build/src/watch.rs | //! Utility functions to use within a `build.rs` build script using
//! this library.
use crate::error::{PathError, PathType};
use std::path::Path;
use anyhow::{anyhow, Result};
use walkdir::WalkDir;
/// Tell `Cargo` to rerun the build script that calls this function
/// (upon rebuild) if the specified file/directo... | rust | MIT | 659b53c45bc68b0742696bc8f53fc6cace83b11b | 2026-01-04T20:17:34.492149Z | false |
kellpossible/cargo-i18n | https://github.com/kellpossible/cargo-i18n/blob/659b53c45bc68b0742696bc8f53fc6cace83b11b/i18n-build/src/gettext_impl/mod.rs | i18n-build/src/gettext_impl/mod.rs | //! This module contains the implementation for localizing using the
//! `gettext` localization system.
use crate::error::{PathError, PathType};
use crate::util;
use i18n_config::{Crate, GettextConfig, I18nConfigError};
use std::ffi::OsStr;
use std::fs::{create_dir_all, File};
use std::path::{Path, PathBuf};
use std:... | rust | MIT | 659b53c45bc68b0742696bc8f53fc6cace83b11b | 2026-01-04T20:17:34.492149Z | false |
kellpossible/cargo-i18n | https://github.com/kellpossible/cargo-i18n/blob/659b53c45bc68b0742696bc8f53fc6cace83b11b/i18n-config/src/lib.rs | i18n-config/src/lib.rs | //! This library contains the configuration structs (along with their
//! parsing functions) for the
//! [cargo-i18n](https://crates.io/crates/cargo_i18n) tool/system.
mod fluent;
mod gettext;
pub use fluent::FluentConfig;
pub use gettext::GettextConfig;
use std::fs::read_to_string;
use std::io;
use std::{
fmt::... | rust | MIT | 659b53c45bc68b0742696bc8f53fc6cace83b11b | 2026-01-04T20:17:34.492149Z | false |
kellpossible/cargo-i18n | https://github.com/kellpossible/cargo-i18n/blob/659b53c45bc68b0742696bc8f53fc6cace83b11b/i18n-config/src/fluent.rs | i18n-config/src/fluent.rs | use serde::Deserialize;
use std::path::PathBuf;
/// The data structure representing what is stored (and possible to
/// store) within the `fluent` subsection of a `i18n.toml` file.
#[derive(Deserialize, Debug, Clone)]
pub struct FluentConfig {
/// (Required) The path to the assets directory.
///
/// The pa... | rust | MIT | 659b53c45bc68b0742696bc8f53fc6cace83b11b | 2026-01-04T20:17:34.492149Z | false |
kellpossible/cargo-i18n | https://github.com/kellpossible/cargo-i18n/blob/659b53c45bc68b0742696bc8f53fc6cace83b11b/i18n-config/src/gettext.rs | i18n-config/src/gettext.rs | use serde::Deserialize;
use std::path::PathBuf;
/// The data structure representing what is stored (and possible to
/// store) within the `gettext` subsection of a `i18n.toml` file.
#[derive(Deserialize, Debug, Clone)]
pub struct GettextConfig {
/// The languages that the software will be translated into.
pub ... | rust | MIT | 659b53c45bc68b0742696bc8f53fc6cace83b11b | 2026-01-04T20:17:34.492149Z | false |
kellpossible/cargo-i18n | https://github.com/kellpossible/cargo-i18n/blob/659b53c45bc68b0742696bc8f53fc6cace83b11b/i18n-embed/i18n-embed-impl/src/lib.rs | i18n-embed/i18n-embed-impl/src/lib.rs | /// A procedural macro to create a new `GettextLanguageLoader` using
/// the current crate's `i18n.toml` configuration, and domain.
///
/// ⚠️ *This API requires the following crate features to be
/// activated: `gettext-system`.*
///
/// ## Example
///
/// ```ignore
/// use i18n_embed::gettext::{gettext_language_loade... | rust | MIT | 659b53c45bc68b0742696bc8f53fc6cace83b11b | 2026-01-04T20:17:34.492149Z | false |
kellpossible/cargo-i18n | https://github.com/kellpossible/cargo-i18n/blob/659b53c45bc68b0742696bc8f53fc6cace83b11b/i18n-embed/src/requester.rs | i18n-embed/src/requester.rs | use crate::{I18nEmbedError, Localizer};
use std::{collections::HashMap, sync::Weak};
/// A trait used by [I18nAssets](crate::I18nAssets) to ascertain which
/// languages are being requested.
pub trait LanguageRequester<'a> {
/// Add a listener to this `LanguageRequester`. When the system
/// reports that the c... | rust | MIT | 659b53c45bc68b0742696bc8f53fc6cace83b11b | 2026-01-04T20:17:34.492149Z | false |
kellpossible/cargo-i18n | https://github.com/kellpossible/cargo-i18n/blob/659b53c45bc68b0742696bc8f53fc6cace83b11b/i18n-embed/src/lib.rs | i18n-embed/src/lib.rs | #![allow(clippy::needless_doctest_main)]
//! Traits and macros to conveniently embed localization assets into
//! your application binary or library in order to localize it at
//! runtime. Works in unison with
//! [cargo-i18n](https://crates.io/crates/cargo_i18n).
//!
//! This library recommends that you make use of
//... | rust | MIT | 659b53c45bc68b0742696bc8f53fc6cace83b11b | 2026-01-04T20:17:34.492149Z | false |
kellpossible/cargo-i18n | https://github.com/kellpossible/cargo-i18n/blob/659b53c45bc68b0742696bc8f53fc6cace83b11b/i18n-embed/src/fluent.rs | i18n-embed/src/fluent.rs | //! This module contains the types and functions to interact with the
//! `fluent` localization system.
//!
//! Most important is the [FluentLanguageLoader].
//!
//! ⚠️ *This module requires the following crate features to be activated: `fluent-system`.*
use crate::{I18nAssets, I18nEmbedError, LanguageLoader};
use ar... | rust | MIT | 659b53c45bc68b0742696bc8f53fc6cace83b11b | 2026-01-04T20:17:34.492149Z | false |
kellpossible/cargo-i18n | https://github.com/kellpossible/cargo-i18n/blob/659b53c45bc68b0742696bc8f53fc6cace83b11b/i18n-embed/src/util.rs | i18n-embed/src/util.rs | /// Get the translation domain from the module path (first module in
/// the module path).
pub fn domain_from_module(module_path: &str) -> &str {
module_path.split("::").next().unwrap_or(module_path)
}
| rust | MIT | 659b53c45bc68b0742696bc8f53fc6cace83b11b | 2026-01-04T20:17:34.492149Z | false |
kellpossible/cargo-i18n | https://github.com/kellpossible/cargo-i18n/blob/659b53c45bc68b0742696bc8f53fc6cace83b11b/i18n-embed/src/assets.rs | i18n-embed/src/assets.rs | use std::borrow::Cow;
use rust_embed::RustEmbed;
use crate::I18nEmbedError;
/// A trait to handle the retrieval of localization assets.
pub trait I18nAssets {
/// Get localization asset files that correspond to the specified `file_path`. Returns an empty
/// [`Vec`] if the asset does not exist, or unable to ... | rust | MIT | 659b53c45bc68b0742696bc8f53fc6cace83b11b | 2026-01-04T20:17:34.492149Z | false |
kellpossible/cargo-i18n | https://github.com/kellpossible/cargo-i18n/blob/659b53c45bc68b0742696bc8f53fc6cace83b11b/i18n-embed/src/gettext.rs | i18n-embed/src/gettext.rs | //! This module contains the types and functions to interact with the
//! `gettext` localization system.
//!
//! Most important is the [GettextLanguageLoader].
//!
//! ⚠️ *This module requires the following crate features to be activated: `gettext-system`.*
use crate::{domain_from_module, I18nAssets, I18nEmbedError, L... | rust | MIT | 659b53c45bc68b0742696bc8f53fc6cace83b11b | 2026-01-04T20:17:34.492149Z | false |
kellpossible/cargo-i18n | https://github.com/kellpossible/cargo-i18n/blob/659b53c45bc68b0742696bc8f53fc6cace83b11b/i18n-embed/tests/loader.rs | i18n-embed/tests/loader.rs | #[cfg(any(feature = "fluent-system", feature = "gettext-system"))]
fn setup() {
let _ = env_logger::try_init();
}
#[cfg(feature = "fluent-system")]
mod fluent {
use super::setup;
use fluent_langneg::NegotiationStrategy;
use i18n_embed::{fluent::FluentLanguageLoader, LanguageLoader};
use rust_embed:... | rust | MIT | 659b53c45bc68b0742696bc8f53fc6cace83b11b | 2026-01-04T20:17:34.492149Z | false |
kellpossible/cargo-i18n | https://github.com/kellpossible/cargo-i18n/blob/659b53c45bc68b0742696bc8f53fc6cace83b11b/i18n-embed/examples/library-fluent/src/lib.rs | i18n-embed/examples/library-fluent/src/lib.rs | use i18n_embed::{
fluent::{fluent_language_loader, FluentLanguageLoader},
DefaultLocalizer, LanguageLoader, RustEmbedNotifyAssets,
};
use i18n_embed_fl::fl;
use once_cell::sync::Lazy;
use rust_embed::RustEmbed;
#[derive(RustEmbed)]
#[folder = "i18n/"]
pub struct LocalizationsEmbed;
pub static LOCALIZATIONS: L... | rust | MIT | 659b53c45bc68b0742696bc8f53fc6cace83b11b | 2026-01-04T20:17:34.492149Z | false |
kellpossible/cargo-i18n | https://github.com/kellpossible/cargo-i18n/blob/659b53c45bc68b0742696bc8f53fc6cace83b11b/i18n-embed/examples/library-fluent/tests/no_localizer.rs | i18n-embed/examples/library-fluent/tests/no_localizer.rs | use library_fluent::hello_world;
/// Test using the library without using the provided
/// [`localizer()`](library_fluent::localizer()) method.
#[test]
fn test_no_localizer() {
assert_eq!(&hello_world(), "Hello World!")
}
| rust | MIT | 659b53c45bc68b0742696bc8f53fc6cace83b11b | 2026-01-04T20:17:34.492149Z | false |
kellpossible/cargo-i18n | https://github.com/kellpossible/cargo-i18n/blob/659b53c45bc68b0742696bc8f53fc6cace83b11b/i18n-embed/examples/library-fluent/tests/with_localizer.rs | i18n-embed/examples/library-fluent/tests/with_localizer.rs | use i18n_embed::Localizer;
use library_fluent::{hello_world, localizer};
use std::collections::HashSet;
use std::iter::FromIterator;
/// Test that the expected languages and fallback language are
/// available.
#[test]
fn test_available_languages() {
let localizer = localizer();
assert_eq!(
&localizer... | rust | MIT | 659b53c45bc68b0742696bc8f53fc6cace83b11b | 2026-01-04T20:17:34.492149Z | false |
kellpossible/cargo-i18n | https://github.com/kellpossible/cargo-i18n/blob/659b53c45bc68b0742696bc8f53fc6cace83b11b/i18n-embed/examples/desktop-bin/src/main.rs | i18n-embed/examples/desktop-bin/src/main.rs | use std::time::Duration;
use i18n_embed::{DesktopLanguageRequester, Localizer};
use library_fluent::{hello_world, localizer};
fn main() {
env_logger::init();
let library_localizer = localizer().with_autoreload().unwrap();
let requested_languages = DesktopLanguageRequester::requested_languages();
if l... | rust | MIT | 659b53c45bc68b0742696bc8f53fc6cace83b11b | 2026-01-04T20:17:34.492149Z | false |
rustyscreeps/screeps-starter-rust | https://github.com/rustyscreeps/screeps-starter-rust/blob/2a5be61bd16ee53b375a81ac5fd86d6617b22d5c/src/lib.rs | src/lib.rs | use std::{
cell::RefCell,
collections::{hash_map::Entry, HashMap, HashSet},
};
use js_sys::{JsString, Object, Reflect};
use log::*;
use screeps::{
action_error_codes::*,
constants::{Part, ResourceType},
enums::StructureObject,
find, game,
local::ObjectId,
objects::{Creep, Source, Struct... | rust | MIT | 2a5be61bd16ee53b375a81ac5fd86d6617b22d5c | 2026-01-04T20:17:50.173041Z | false |
rustyscreeps/screeps-starter-rust | https://github.com/rustyscreeps/screeps-starter-rust/blob/2a5be61bd16ee53b375a81ac5fd86d6617b22d5c/src/logging.rs | src/logging.rs | use std::{fmt::Write, panic};
use js_sys::JsString;
use log::*;
use screeps::game;
use wasm_bindgen::prelude::wasm_bindgen;
use web_sys::console;
pub use log::LevelFilter::*;
struct JsLog;
struct JsNotify;
impl log::Log for JsLog {
fn enabled(&self, _: &log::Metadata<'_>) -> bool {
true
}
fn log... | rust | MIT | 2a5be61bd16ee53b375a81ac5fd86d6617b22d5c | 2026-01-04T20:17:50.173041Z | false |
PRQL/prql-query | https://github.com/PRQL/prql-query/blob/0f6da9dc92090f42b6e1fbb6439d015641364996/src/backends.rs | src/backends.rs | #[cfg(feature = "datafusion")]
pub mod datafusion;
#[cfg(feature = "duckdb")]
pub mod duckdb;
| rust | Apache-2.0 | 0f6da9dc92090f42b6e1fbb6439d015641364996 | 2026-01-04T20:17:53.826001Z | false |
PRQL/prql-query | https://github.com/PRQL/prql-query/blob/0f6da9dc92090f42b6e1fbb6439d015641364996/src/main.rs | src/main.rs | #![allow(unused)]
mod backends;
use anyhow::{anyhow, Result};
use log::{debug, error, info, warn};
use camino::Utf8Path;
use std::collections::{HashMap, HashSet};
use std::fmt::{self, Debug, Display};
use std::io::prelude::*;
use std::{fs, io};
use clap::{Parser, ValueEnum};
use prql_compiler::{compile, Options, PR... | rust | Apache-2.0 | 0f6da9dc92090f42b6e1fbb6439d015641364996 | 2026-01-04T20:17:53.826001Z | false |
PRQL/prql-query | https://github.com/PRQL/prql-query/blob/0f6da9dc92090f42b6e1fbb6439d015641364996/src/backends/datafusion.rs | src/backends/datafusion.rs | use std::io::prelude::*;
use anyhow::{anyhow, Result};
use log::{debug, error, info, warn};
use datafusion::dataframe::DataFrame;
use datafusion::datasource::listing::{ListingTable, ListingTableConfig};
use datafusion::prelude::*;
// writer imports
use datafusion::arrow::record_batch::RecordBatch;
use datafusion::ar... | rust | Apache-2.0 | 0f6da9dc92090f42b6e1fbb6439d015641364996 | 2026-01-04T20:17:53.826001Z | false |
PRQL/prql-query | https://github.com/PRQL/prql-query/blob/0f6da9dc92090f42b6e1fbb6439d015641364996/src/backends/duckdb.rs | src/backends/duckdb.rs | use std::io::prelude::*;
use anyhow::{anyhow, Result};
use log::{debug, error, info, warn};
use arrow::record_batch::RecordBatch;
use arrow::util::pretty::pretty_format_batches;
use arrow::{csv, json};
use parquet::arrow::arrow_writer;
use chrono::{DateTime, Utc};
use duckdb::{
types::{FromSql, ValueRef},
Co... | rust | Apache-2.0 | 0f6da9dc92090f42b6e1fbb6439d015641364996 | 2026-01-04T20:17:53.826001Z | false |
saber-hq/vipers | https://github.com/saber-hq/vipers/blob/8cf200f75d7e3217eb902ff96c9894f48b050edb/vipers/src/assert.rs | vipers/src/assert.rs | //! Various assertions.
/// Runs a block, returning a [anchor_lang::prelude::Result<()>].
#[macro_export]
macro_rules! test_assertion {
($body: block) => {
(|| -> crate::Result<()> {
$body
Ok(())
})()
};
}
/// Asserts that the given assertion block does not throw any er... | rust | Apache-2.0 | 8cf200f75d7e3217eb902ff96c9894f48b050edb | 2026-01-04T20:17:56.177787Z | false |
saber-hq/vipers | https://github.com/saber-hq/vipers/blob/8cf200f75d7e3217eb902ff96c9894f48b050edb/vipers/src/keyref.rs | vipers/src/keyref.rs | //! Allows getting the reference of the key of an account or [Pubkey].
use anchor_lang::prelude::*;
use anchor_lang::ZeroCopy;
/// Defines the Pubkey of an account, fetching it as a reference.
pub trait AsKeyRef {
/// Returns the [Pubkey] of the account or key as a reference.
fn as_key_ref(&self) -> &Pubkey;
... | rust | Apache-2.0 | 8cf200f75d7e3217eb902ff96c9894f48b050edb | 2026-01-04T20:17:56.177787Z | false |
saber-hq/vipers | https://github.com/saber-hq/vipers/blob/8cf200f75d7e3217eb902ff96c9894f48b050edb/vipers/src/lib.rs | vipers/src/lib.rs | //! Library for writing safer Solana programs.
#![deny(missing_docs)]
#![deny(rustdoc::all)]
#![allow(rustdoc::missing_doc_code_examples)]
pub mod assert;
mod error;
mod keyref;
pub mod validate;
use anchor_lang::prelude::*;
pub use error::*;
pub use keyref::AsKeyRef;
#[cfg(feature = "spl-associated-token-account")]
... | rust | Apache-2.0 | 8cf200f75d7e3217eb902ff96c9894f48b050edb | 2026-01-04T20:17:56.177787Z | false |
saber-hq/vipers | https://github.com/saber-hq/vipers/blob/8cf200f75d7e3217eb902ff96c9894f48b050edb/vipers/src/error.rs | vipers/src/error.rs | #![allow(missing_docs)]
use std::fmt::Display;
use anchor_lang::prelude::*;
/// Vipers validation error.
#[error_code(offset = 1100)]
pub enum VipersError {
#[msg("Keys do not match.")]
KeyMismatch,
#[msg("Associated token account does not match.")]
ATAMismatch,
#[msg("Program ID does not match."... | rust | Apache-2.0 | 8cf200f75d7e3217eb902ff96c9894f48b050edb | 2026-01-04T20:17:56.177787Z | false |
saber-hq/vipers | https://github.com/saber-hq/vipers/blob/8cf200f75d7e3217eb902ff96c9894f48b050edb/vipers/src/validate.rs | vipers/src/validate.rs | //! Validations for accounts.
use anchor_lang::prelude::*;
/// Validates the contents of a variable. Generally used for [Accounts] structs and struct members.
pub trait Validate<'info> {
/// Validates the account struct.
fn validate(&self) -> Result<()>;
}
| rust | Apache-2.0 | 8cf200f75d7e3217eb902ff96c9894f48b050edb | 2026-01-04T20:17:56.177787Z | false |
saber-hq/vipers | https://github.com/saber-hq/vipers/blob/8cf200f75d7e3217eb902ff96c9894f48b050edb/tests/vipers-tests/src/lib.rs | tests/vipers-tests/src/lib.rs | //! Vipers tests.
#![cfg(test)]
use std::collections::BTreeMap;
use anchor_lang::prelude::*;
declare_id!("VipersTest111111111111111111111111111111111");
use anchor_spl::{
associated_token::get_associated_token_address,
token::{self},
};
use vipers::*;
#[error_code]
pub enum ErrorCode {
MyError,
MyO... | rust | Apache-2.0 | 8cf200f75d7e3217eb902ff96c9894f48b050edb | 2026-01-04T20:17:56.177787Z | false |
ljedrz/lambda_calculus | https://github.com/ljedrz/lambda_calculus/blob/6641e77f18e9f0698f367fa605c444d3d65d0cd5/src/lib.rs | src/lib.rs | //! **lambda_calculus** is a simple implementation of the untyped lambda calculus in Rust.
#![deny(missing_docs)]
#![deny(unsafe_code)]
#[macro_use]
pub mod term;
pub mod combinators;
pub mod parser;
pub mod reduction;
pub use self::parser::{parse, parse_with_context};
pub use self::reduction::beta;
pub use self::re... | rust | CC0-1.0 | 6641e77f18e9f0698f367fa605c444d3d65d0cd5 | 2026-01-04T20:17:59.260758Z | false |
ljedrz/lambda_calculus | https://github.com/ljedrz/lambda_calculus/blob/6641e77f18e9f0698f367fa605c444d3d65d0cd5/src/parser.rs | src/parser.rs | //! A parser for lambda expressions
use self::CToken::*;
use self::Expression::*;
use self::ParseError::*;
use self::Token::*;
use crate::term::Context;
pub use crate::term::Notation::*;
use crate::term::Term::*;
use crate::term::{abs, app, Notation, Term};
use std::error::Error;
use std::fmt;
/// An error returned b... | rust | CC0-1.0 | 6641e77f18e9f0698f367fa605c444d3d65d0cd5 | 2026-01-04T20:17:59.260758Z | false |
ljedrz/lambda_calculus | https://github.com/ljedrz/lambda_calculus/blob/6641e77f18e9f0698f367fa605c444d3d65d0cd5/src/reduction.rs | src/reduction.rs | //! [β-reduction](https://en.wikipedia.org/wiki/Beta_normal_form) for lambda `Term`s
pub use self::Order::*;
use crate::term::Term::*;
use crate::term::{Term, TermError};
use std::{cmp, fmt, mem};
/// The [evaluation order](http://www.cs.cornell.edu/courses/cs6110/2014sp/Handouts/Sestoft.pdf) of
/// β-reductions.
///... | rust | CC0-1.0 | 6641e77f18e9f0698f367fa605c444d3d65d0cd5 | 2026-01-04T20:17:59.260758Z | false |
ljedrz/lambda_calculus | https://github.com/ljedrz/lambda_calculus/blob/6641e77f18e9f0698f367fa605c444d3d65d0cd5/src/combinators.rs | src/combinators.rs | //! [Standard terms](https://en.wikipedia.org/wiki/Lambda_calculus#Standard_terms) and
//! [combinators](https://en.wikipedia.org/wiki/Combinatory_logic#Combinatory_calculi)
//!
//! * [SKI](https://en.wikipedia.org/wiki/SKI_combinator_calculus)
//! * [Iota](https://en.wikipedia.org/wiki/Iota_and_Jot)
//! * [BCKW](https... | rust | CC0-1.0 | 6641e77f18e9f0698f367fa605c444d3d65d0cd5 | 2026-01-04T20:17:59.260758Z | false |
ljedrz/lambda_calculus | https://github.com/ljedrz/lambda_calculus/blob/6641e77f18e9f0698f367fa605c444d3d65d0cd5/src/term.rs | src/term.rs | //! [Lambda terms](https://en.wikipedia.org/wiki/Lambda_calculus#Lambda_terms)
pub use self::Notation::*;
pub use self::Term::*;
use self::TermError::*;
use std::borrow::Cow;
use std::error::Error;
use std::fmt;
/// The character used to display lambda abstractions (a backslash).
#[cfg(feature = "backslash_lambda")]
... | rust | CC0-1.0 | 6641e77f18e9f0698f367fa605c444d3d65d0cd5 | 2026-01-04T20:17:59.260758Z | false |
ljedrz/lambda_calculus | https://github.com/ljedrz/lambda_calculus/blob/6641e77f18e9f0698f367fa605c444d3d65d0cd5/src/data/boolean.rs | src/data/boolean.rs | //! [Lambda-encoded booleans](https://en.wikipedia.org/wiki/Church_encoding#Church_Booleans)
use crate::term::Term::*;
use crate::term::{abs, app, Term};
/// A lambda-encoded boolean `true`.
///
/// TRUE ≡ λab.a ≡ λ λ 2
pub fn tru() -> Term {
abs!(2, Var(2))
}
/// A lambda-encoded boolean `false`.
///
/// FALSE ... | rust | CC0-1.0 | 6641e77f18e9f0698f367fa605c444d3d65d0cd5 | 2026-01-04T20:17:59.260758Z | false |
ljedrz/lambda_calculus | https://github.com/ljedrz/lambda_calculus/blob/6641e77f18e9f0698f367fa605c444d3d65d0cd5/src/data/pair.rs | src/data/pair.rs | //! [Lambda-encoded pair](https://en.wikipedia.org/wiki/Church_encoding#Church_pairs)
use crate::data::boolean::{fls, tru};
use crate::term::Term::*;
use crate::term::{abs, app, Term};
/// Applied to two `Term`s it contains them in a lambda-encoded pair.
///
/// PAIR ≡ λxyz.z x y ≡ λ λ λ 1 3 2
///
/// # Example
/// `... | rust | CC0-1.0 | 6641e77f18e9f0698f367fa605c444d3d65d0cd5 | 2026-01-04T20:17:59.260758Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.