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
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/cli/tests/mcp_list.rs
codex-rs/cli/tests/mcp_list.rs
use std::path::Path; use anyhow::Result; use codex_core::config::edit::ConfigEditsBuilder; use codex_core::config::load_global_mcp_servers; use codex_core::config::types::McpServerTransportConfig; use predicates::prelude::PredicateBooleanExt; use predicates::str::contains; use pretty_assertions::assert_eq; use serde_j...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/cli/tests/execpolicy.rs
codex-rs/cli/tests/execpolicy.rs
use std::fs; use assert_cmd::Command; use pretty_assertions::assert_eq; use serde_json::json; use tempfile::TempDir; #[test] fn execpolicy_check_matches_expected_json() -> Result<(), Box<dyn std::error::Error>> { let codex_home = TempDir::new()?; let policy_path = codex_home.path().join("rules").join("policy....
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/cli/tests/mcp_add_remove.rs
codex-rs/cli/tests/mcp_add_remove.rs
use std::path::Path; use anyhow::Result; use codex_core::config::load_global_mcp_servers; use codex_core::config::types::McpServerTransportConfig; use predicates::str::contains; use pretty_assertions::assert_eq; use tempfile::TempDir; fn codex_command(codex_home: &Path) -> Result<assert_cmd::Command> { let mut cm...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/mcp-server/src/error_code.rs
codex-rs/mcp-server/src/error_code.rs
pub(crate) const INVALID_REQUEST_ERROR_CODE: i64 = -32600; pub(crate) const INTERNAL_ERROR_CODE: i64 = -32603;
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/mcp-server/src/codex_tool_runner.rs
codex-rs/mcp-server/src/codex_tool_runner.rs
//! Asynchronous worker that executes a **Codex** tool-call inside a spawned //! Tokio task. Separated from `message_processor.rs` to keep that file small //! and to make future feature-growth easier to manage. use std::collections::HashMap; use std::sync::Arc; use crate::exec_approval::handle_exec_approval_request; ...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/mcp-server/src/codex_tool_config.rs
codex-rs/mcp-server/src/codex_tool_config.rs
//! Configuration object accepted by the `codex` MCP tool-call. use codex_core::config::Config; use codex_core::config::ConfigOverrides; use codex_core::protocol::AskForApproval; use codex_protocol::config_types::SandboxMode; use codex_utils_json_to_toml::json_to_toml; use mcp_types::Tool; use mcp_types::ToolInputSche...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/mcp-server/src/lib.rs
codex-rs/mcp-server/src/lib.rs
//! Prototype MCP server. #![deny(clippy::print_stdout, clippy::print_stderr)] use std::io::ErrorKind; use std::io::Result as IoResult; use std::path::PathBuf; use codex_common::CliConfigOverrides; use codex_core::config::Config; use mcp_types::JSONRPCMessage; use tokio::io::AsyncBufReadExt; use tokio::io::AsyncWrit...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/mcp-server/src/message_processor.rs
codex-rs/mcp-server/src/message_processor.rs
use std::collections::HashMap; use std::path::PathBuf; use crate::codex_tool_config::CodexToolCallParam; use crate::codex_tool_config::CodexToolCallReplyParam; use crate::codex_tool_config::create_tool_for_codex_tool_call_param; use crate::codex_tool_config::create_tool_for_codex_tool_call_reply_param; use crate::erro...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/mcp-server/src/exec_approval.rs
codex-rs/mcp-server/src/exec_approval.rs
use std::path::PathBuf; use std::sync::Arc; use codex_core::CodexConversation; use codex_core::protocol::Op; use codex_core::protocol::ReviewDecision; use codex_protocol::parse_command::ParsedCommand; use mcp_types::ElicitRequest; use mcp_types::ElicitRequestParamsRequestedSchema; use mcp_types::JSONRPCErrorError; use...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/mcp-server/src/patch_approval.rs
codex-rs/mcp-server/src/patch_approval.rs
use std::collections::HashMap; use std::path::PathBuf; use std::sync::Arc; use codex_core::CodexConversation; use codex_core::protocol::FileChange; use codex_core::protocol::Op; use codex_core::protocol::ReviewDecision; use mcp_types::ElicitRequest; use mcp_types::ElicitRequestParamsRequestedSchema; use mcp_types::JSO...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/mcp-server/src/main.rs
codex-rs/mcp-server/src/main.rs
use codex_arg0::arg0_dispatch_or_else; use codex_common::CliConfigOverrides; use codex_mcp_server::run_main; fn main() -> anyhow::Result<()> { arg0_dispatch_or_else(|codex_linux_sandbox_exe| async move { run_main(codex_linux_sandbox_exe, CliConfigOverrides::default()).await?; Ok(()) }) }
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/mcp-server/src/outgoing_message.rs
codex-rs/mcp-server/src/outgoing_message.rs
use std::collections::HashMap; use std::sync::atomic::AtomicI64; use std::sync::atomic::Ordering; use codex_core::protocol::Event; use mcp_types::JSONRPC_VERSION; use mcp_types::JSONRPCError; use mcp_types::JSONRPCErrorError; use mcp_types::JSONRPCMessage; use mcp_types::JSONRPCNotification; use mcp_types::JSONRPCRequ...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/mcp-server/src/tool_handlers/mod.rs
codex-rs/mcp-server/src/tool_handlers/mod.rs
pub(crate) mod create_conversation; pub(crate) mod send_message;
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/mcp-server/tests/all.rs
codex-rs/mcp-server/tests/all.rs
// Single integration test binary that aggregates all test modules. // The submodules live in `tests/suite/`. mod suite;
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/mcp-server/tests/suite/mod.rs
codex-rs/mcp-server/tests/suite/mod.rs
mod codex_tool;
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/mcp-server/tests/suite/codex_tool.rs
codex-rs/mcp-server/tests/suite/codex_tool.rs
use std::collections::HashMap; use std::env; use std::path::Path; use std::path::PathBuf; use codex_core::parse_command; use codex_core::protocol::FileChange; use codex_core::protocol::ReviewDecision; use codex_core::spawn::CODEX_SANDBOX_NETWORK_DISABLED_ENV_VAR; use codex_mcp_server::CodexToolCallParam; use codex_mcp...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/mcp-server/tests/common/responses.rs
codex-rs/mcp-server/tests/common/responses.rs
use serde_json::json; use std::path::Path; pub fn create_shell_command_sse_response( command: Vec<String>, workdir: Option<&Path>, timeout_ms: Option<u64>, call_id: &str, ) -> anyhow::Result<String> { // The `arguments` for the `shell_command` tool is a serialized JSON object. let command_str =...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/mcp-server/tests/common/lib.rs
codex-rs/mcp-server/tests/common/lib.rs
mod mcp_process; mod mock_model_server; mod responses; pub use core_test_support::format_with_current_shell; pub use core_test_support::format_with_current_shell_display_non_login; pub use core_test_support::format_with_current_shell_non_login; pub use mcp_process::McpProcess; use mcp_types::JSONRPCResponse; pub use m...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/mcp-server/tests/common/mcp_process.rs
codex-rs/mcp-server/tests/common/mcp_process.rs
use std::path::Path; use std::process::Stdio; use std::sync::atomic::AtomicI64; use std::sync::atomic::Ordering; use tokio::io::AsyncBufReadExt; use tokio::io::AsyncWriteExt; use tokio::io::BufReader; use tokio::process::Child; use tokio::process::ChildStdin; use tokio::process::ChildStdout; use anyhow::Context; use c...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/mcp-server/tests/common/mock_model_server.rs
codex-rs/mcp-server/tests/common/mock_model_server.rs
use std::sync::atomic::AtomicUsize; use std::sync::atomic::Ordering; use wiremock::Mock; use wiremock::MockServer; use wiremock::Respond; use wiremock::ResponseTemplate; use wiremock::matchers::method; use wiremock::matchers::path; /// Create a mock server that will provide the responses, in order, for /// requests t...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/process-hardening/src/lib.rs
codex-rs/process-hardening/src/lib.rs
#[cfg(unix)] use std::ffi::OsString; #[cfg(unix)] use std::os::unix::ffi::OsStrExt; /// This is designed to be called pre-main() (using `#[ctor::ctor]`) to perform /// various process hardening steps, such as /// - disabling core dumps /// - disabling ptrace attach on Linux and macOS. /// - removing dangerous environ...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/async-utils/src/lib.rs
codex-rs/async-utils/src/lib.rs
use async_trait::async_trait; use std::future::Future; use tokio_util::sync::CancellationToken; #[derive(Debug, PartialEq, Eq)] pub enum CancelErr { Cancelled, } #[async_trait] pub trait OrCancelExt: Sized { type Output; async fn or_cancel(self, token: &CancellationToken) -> Result<Self::Output, CancelEr...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/apply-patch/src/invocation.rs
codex-rs/apply-patch/src/invocation.rs
use std::collections::HashMap; use std::path::Path; use std::sync::LazyLock; use tree_sitter::Parser; use tree_sitter::Query; use tree_sitter::QueryCursor; use tree_sitter::StreamingIterator; use tree_sitter_bash::LANGUAGE as BASH; use crate::ApplyPatchAction; use crate::ApplyPatchArgs; use crate::ApplyPatchError; us...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/apply-patch/src/standalone_executable.rs
codex-rs/apply-patch/src/standalone_executable.rs
use std::io::Read; use std::io::Write; pub fn main() -> ! { let exit_code = run_main(); std::process::exit(exit_code); } /// We would prefer to return `std::process::ExitCode`, but its `exit_process()` /// method is still a nightly API and we want main() to return !. pub fn run_main() -> i32 { // Expect e...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/apply-patch/src/lib.rs
codex-rs/apply-patch/src/lib.rs
mod invocation; mod parser; mod seek_sequence; mod standalone_executable; use std::collections::HashMap; use std::path::Path; use std::path::PathBuf; use anyhow::Context; use anyhow::Result; pub use parser::Hunk; pub use parser::ParseError; use parser::ParseError::*; use parser::UpdateFileChunk; pub use parser::parse...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
true
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/apply-patch/src/parser.rs
codex-rs/apply-patch/src/parser.rs
//! This module is responsible for parsing & validating a patch into a list of "hunks". //! (It does not attempt to actually check that the patch can be applied to the filesystem.) //! //! The official Lark grammar for the apply-patch format is: //! //! start: begin_patch hunk+ end_patch //! begin_patch: "*** Begin Pat...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/apply-patch/src/main.rs
codex-rs/apply-patch/src/main.rs
pub fn main() -> ! { codex_apply_patch::main() }
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/apply-patch/src/seek_sequence.rs
codex-rs/apply-patch/src/seek_sequence.rs
/// Attempt to find the sequence of `pattern` lines within `lines` beginning at or after `start`. /// Returns the starting index of the match or `None` if not found. Matches are attempted with /// decreasing strictness: exact match, then ignoring trailing whitespace, then ignoring leading /// and trailing whitespace. W...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/apply-patch/tests/all.rs
codex-rs/apply-patch/tests/all.rs
// Single integration test binary that aggregates all test modules. // The submodules live in `tests/suite/`. mod suite;
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/apply-patch/tests/suite/scenarios.rs
codex-rs/apply-patch/tests/suite/scenarios.rs
use pretty_assertions::assert_eq; use std::collections::BTreeMap; use std::fs; use std::path::Path; use std::path::PathBuf; use std::process::Command; use tempfile::tempdir; #[test] fn test_apply_patch_scenarios() -> anyhow::Result<()> { let scenarios_dir = Path::new(env!("CARGO_MANIFEST_DIR")).join("tests/fixture...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/apply-patch/tests/suite/cli.rs
codex-rs/apply-patch/tests/suite/cli.rs
use assert_cmd::Command; use std::fs; use tempfile::tempdir; fn apply_patch_command() -> anyhow::Result<Command> { Ok(Command::new(codex_utils_cargo_bin::cargo_bin( "apply_patch", )?)) } #[test] fn test_apply_patch_cli_add_and_update() -> anyhow::Result<()> { let tmp = tempdir()?; let file = "...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/apply-patch/tests/suite/mod.rs
codex-rs/apply-patch/tests/suite/mod.rs
mod cli; mod scenarios; #[cfg(not(target_os = "windows"))] mod tool;
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/apply-patch/tests/suite/tool.rs
codex-rs/apply-patch/tests/suite/tool.rs
use assert_cmd::Command; use pretty_assertions::assert_eq; use std::fs; use std::path::Path; use tempfile::tempdir; fn run_apply_patch_in_dir(dir: &Path, patch: &str) -> anyhow::Result<assert_cmd::assert::Assert> { let mut cmd = Command::new(codex_utils_cargo_bin::cargo_bin("apply_patch")?); cmd.current_dir(di...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/file-search/src/lib.rs
codex-rs/file-search/src/lib.rs
use ignore::WalkBuilder; use ignore::overrides::OverrideBuilder; use nucleo_matcher::Matcher; use nucleo_matcher::Utf32Str; use nucleo_matcher::pattern::AtomKind; use nucleo_matcher::pattern::CaseMatching; use nucleo_matcher::pattern::Normalization; use nucleo_matcher::pattern::Pattern; use serde::Serialize; use std::c...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/file-search/src/cli.rs
codex-rs/file-search/src/cli.rs
use std::num::NonZero; use std::path::PathBuf; use clap::ArgAction; use clap::Parser; /// Fuzzy matches filenames under a directory. #[derive(Parser)] #[command(version)] pub struct Cli { /// Whether to output results in JSON format. #[clap(long, default_value = "false")] pub json: bool, /// Maximum ...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/file-search/src/main.rs
codex-rs/file-search/src/main.rs
use std::io::IsTerminal; use std::path::Path; use clap::Parser; use codex_file_search::Cli; use codex_file_search::FileMatch; use codex_file_search::Reporter; use codex_file_search::run_main; use serde_json::json; #[tokio::main] async fn main() -> anyhow::Result<()> { let cli = Cli::parse(); let reporter = St...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/stdio-to-uds/src/lib.rs
codex-rs/stdio-to-uds/src/lib.rs
#![deny(clippy::print_stdout)] use std::io; use std::io::Write; use std::net::Shutdown; use std::path::Path; use std::thread; use anyhow::Context; use anyhow::anyhow; #[cfg(unix)] use std::os::unix::net::UnixStream; #[cfg(windows)] use uds_windows::UnixStream; /// Connects to the Unix Domain Socket at `socket_path...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/stdio-to-uds/src/main.rs
codex-rs/stdio-to-uds/src/main.rs
use std::env; use std::path::PathBuf; use std::process; fn main() -> anyhow::Result<()> { let mut args = env::args_os().skip(1); let Some(socket_path) = args.next() else { eprintln!("Usage: codex-stdio-to-uds <socket-path>"); process::exit(1); }; if args.next().is_some() { epri...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/stdio-to-uds/tests/stdio_to_uds.rs
codex-rs/stdio-to-uds/tests/stdio_to_uds.rs
use std::io::ErrorKind; use std::io::Read; use std::io::Write; use std::sync::mpsc; use std::thread; use std::time::Duration; use anyhow::Context; use assert_cmd::Command; use pretty_assertions::assert_eq; #[cfg(unix)] use std::os::unix::net::UnixListener; #[cfg(windows)] use uds_windows::UnixListener; #[test] fn p...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/protocol/src/config_types.rs
codex-rs/protocol/src/config_types.rs
use schemars::JsonSchema; use serde::Deserialize; use serde::Serialize; use strum_macros::Display; use ts_rs::TS; /// A summary of the reasoning performed by the model. This can be useful for /// debugging and understanding the model's reasoning process. /// See https://platform.openai.com/docs/guides/reasoning?api-mo...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/protocol/src/plan_tool.rs
codex-rs/protocol/src/plan_tool.rs
use schemars::JsonSchema; use serde::Deserialize; use serde::Serialize; use ts_rs::TS; // Types for the TODO tool arguments matching codex-vscode/todo-mcp/src/main.rs #[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, TS)] #[serde(rename_all = "snake_case")] pub enum StepStatus { Pending, InProgress, ...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/protocol/src/lib.rs
codex-rs/protocol/src/lib.rs
pub mod account; mod conversation_id; pub use conversation_id::ConversationId; pub mod approvals; pub mod config_types; pub mod custom_prompts; pub mod items; pub mod message_history; pub mod models; pub mod num_format; pub mod openai_models; pub mod parse_command; pub mod plan_tool; pub mod protocol; pub mod user_inpu...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/protocol/src/num_format.rs
codex-rs/protocol/src/num_format.rs
use std::sync::OnceLock; use icu_decimal::DecimalFormatter; use icu_decimal::input::Decimal; use icu_decimal::options::DecimalFormatterOptions; use icu_locale_core::Locale; fn make_local_formatter() -> Option<DecimalFormatter> { let loc: Locale = sys_locale::get_locale()?.parse().ok()?; DecimalFormatter::try_...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/protocol/src/custom_prompts.rs
codex-rs/protocol/src/custom_prompts.rs
use schemars::JsonSchema; use serde::Deserialize; use serde::Serialize; use std::path::PathBuf; use ts_rs::TS; /// Base namespace for custom prompt slash commands (without trailing colon). /// Example usage forms constructed in code: /// - Command token after '/': `"{PROMPTS_CMD_PREFIX}:name"` /// - Full slash prefix:...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/protocol/src/items.rs
codex-rs/protocol/src/items.rs
use crate::protocol::AgentMessageEvent; use crate::protocol::AgentReasoningEvent; use crate::protocol::AgentReasoningRawContentEvent; use crate::protocol::EventMsg; use crate::protocol::UserMessageEvent; use crate::protocol::WebSearchEndEvent; use crate::user_input::UserInput; use schemars::JsonSchema; use serde::Deser...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/protocol/src/parse_command.rs
codex-rs/protocol/src/parse_command.rs
use schemars::JsonSchema; use serde::Deserialize; use serde::Serialize; use std::path::PathBuf; use ts_rs::TS; #[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize, JsonSchema, TS)] #[serde(tag = "type", rename_all = "snake_case")] pub enum ParsedCommand { Read { cmd: String, name: String, ...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/protocol/src/openai_models.rs
codex-rs/protocol/src/openai_models.rs
use std::collections::HashMap; use schemars::JsonSchema; use serde::Deserialize; use serde::Serialize; use strum::IntoEnumIterator; use strum_macros::Display; use strum_macros::EnumIter; use ts_rs::TS; use crate::config_types::Verbosity; /// See https://platform.openai.com/docs/guides/reasoning?api-mode=responses#ge...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/protocol/src/approvals.rs
codex-rs/protocol/src/approvals.rs
use std::collections::HashMap; use std::path::PathBuf; use crate::parse_command::ParsedCommand; use crate::protocol::FileChange; use mcp_types::RequestId; use schemars::JsonSchema; use serde::Deserialize; use serde::Serialize; use ts_rs::TS; /// Proposed execpolicy change to allow commands starting with this prefix. ...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/protocol/src/message_history.rs
codex-rs/protocol/src/message_history.rs
use schemars::JsonSchema; use serde::Deserialize; use serde::Serialize; use ts_rs::TS; #[derive(Serialize, Deserialize, Debug, Clone, JsonSchema, TS)] pub struct HistoryEntry { pub conversation_id: String, pub ts: u64, pub text: String, }
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/protocol/src/user_input.rs
codex-rs/protocol/src/user_input.rs
use schemars::JsonSchema; use serde::Deserialize; use serde::Serialize; use ts_rs::TS; /// User input #[non_exhaustive] #[derive(Debug, Clone, Deserialize, Serialize, PartialEq, TS, JsonSchema)] #[serde(tag = "type", rename_all = "snake_case")] pub enum UserInput { Text { text: String, }, /// Pre‑e...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/protocol/src/protocol.rs
codex-rs/protocol/src/protocol.rs
//! Defines the protocol for a Codex session between a client and an agent. //! //! Uses a SQ (Submission Queue) / EQ (Event Queue) pattern to asynchronously communicate //! between user and agent. use std::collections::HashMap; use std::fmt; use std::path::Path; use std::path::PathBuf; use std::str::FromStr; use std:...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
true
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/protocol/src/conversation_id.rs
codex-rs/protocol/src/conversation_id.rs
use std::fmt::Display; use schemars::JsonSchema; use schemars::r#gen::SchemaGenerator; use schemars::schema::Schema; use serde::Deserialize; use serde::Serialize; use ts_rs::TS; use uuid::Uuid; #[derive(Debug, Clone, Copy, PartialEq, Eq, TS, Hash)] #[ts(type = "string")] pub struct ConversationId { uuid: Uuid, } ...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/protocol/src/models.rs
codex-rs/protocol/src/models.rs
use std::collections::HashMap; use codex_utils_image::load_and_resize_to_fit; use mcp_types::CallToolResult; use mcp_types::ContentBlock; use serde::Deserialize; use serde::Deserializer; use serde::Serialize; use serde::ser::Serializer; use ts_rs::TS; use crate::user_input::UserInput; use codex_git::GhostCommit; use ...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/protocol/src/account.rs
codex-rs/protocol/src/account.rs
use schemars::JsonSchema; use serde::Deserialize; use serde::Serialize; use ts_rs::TS; #[derive(Serialize, Deserialize, Copy, Clone, Debug, PartialEq, Eq, JsonSchema, TS, Default)] #[serde(rename_all = "lowercase")] #[ts(rename_all = "lowercase")] pub enum PlanType { #[default] Free, Plus, Pro, Tea...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
ajeetdsouza/zoxide
https://github.com/ajeetdsouza/zoxide/blob/f00fe0f0aeaeaf8fda48ca467c706a5174830b77/build.rs
build.rs
#[path = "src/cmd/cmd.rs"] mod cmd; use std::{env, io}; use clap::CommandFactory as _; use clap_complete::shells::{Bash, Elvish, Fish, PowerShell, Zsh}; use clap_complete_fig::Fig; use clap_complete_nushell::Nushell; use cmd::Cmd; fn main() -> io::Result<()> { // Since we are generating completions in the packag...
rust
MIT
f00fe0f0aeaeaf8fda48ca467c706a5174830b77
2026-01-04T15:32:37.541534Z
false
ajeetdsouza/zoxide
https://github.com/ajeetdsouza/zoxide/blob/f00fe0f0aeaeaf8fda48ca467c706a5174830b77/src/config.rs
src/config.rs
use std::env; use std::ffi::OsString; use std::path::PathBuf; use anyhow::{Context, Result, ensure}; use glob::Pattern; use crate::db::Rank; pub fn data_dir() -> Result<PathBuf> { let dir = match env::var_os("_ZO_DATA_DIR") { Some(path) => PathBuf::from(path), None => dirs::data_local_dir() ...
rust
MIT
f00fe0f0aeaeaf8fda48ca467c706a5174830b77
2026-01-04T15:32:37.541534Z
false
ajeetdsouza/zoxide
https://github.com/ajeetdsouza/zoxide/blob/f00fe0f0aeaeaf8fda48ca467c706a5174830b77/src/shell.rs
src/shell.rs
use crate::cmd::InitHook; #[derive(Debug, Eq, PartialEq)] pub struct Opts<'a> { pub cmd: Option<&'a str>, pub hook: InitHook, pub echo: bool, pub resolve_symlinks: bool, } macro_rules! make_template { ($name:ident, $path:expr) => { #[derive(::std::fmt::Debug, ::askama::Template)] #...
rust
MIT
f00fe0f0aeaeaf8fda48ca467c706a5174830b77
2026-01-04T15:32:37.541534Z
false
ajeetdsouza/zoxide
https://github.com/ajeetdsouza/zoxide/blob/f00fe0f0aeaeaf8fda48ca467c706a5174830b77/src/error.rs
src/error.rs
use std::fmt::{self, Display, Formatter}; use std::io; use anyhow::{Context, Result, bail}; /// Custom error type for early exit. #[derive(Debug)] pub struct SilentExit { pub code: u8, } impl Display for SilentExit { fn fmt(&self, _: &mut Formatter<'_>) -> fmt::Result { Ok(()) } } pub trait Brok...
rust
MIT
f00fe0f0aeaeaf8fda48ca467c706a5174830b77
2026-01-04T15:32:37.541534Z
false
ajeetdsouza/zoxide
https://github.com/ajeetdsouza/zoxide/blob/f00fe0f0aeaeaf8fda48ca467c706a5174830b77/src/util.rs
src/util.rs
use std::ffi::OsStr; use std::fs::{self, File, OpenOptions}; use std::io::{self, Read, Write}; use std::path::{Component, Path, PathBuf}; use std::process::{Child, Command, Stdio}; use std::time::SystemTime; use std::{env, mem}; #[cfg(windows)] use anyhow::anyhow; use anyhow::{Context, Result, bail}; use crate::db::{...
rust
MIT
f00fe0f0aeaeaf8fda48ca467c706a5174830b77
2026-01-04T15:32:37.541534Z
false
ajeetdsouza/zoxide
https://github.com/ajeetdsouza/zoxide/blob/f00fe0f0aeaeaf8fda48ca467c706a5174830b77/src/main.rs
src/main.rs
#![allow(clippy::single_component_path_imports)] mod cmd; mod config; mod db; mod error; mod shell; mod util; use std::env; use std::io::{self, Write}; use std::process::ExitCode; use clap::Parser; use crate::cmd::{Cmd, Run}; use crate::error::SilentExit; pub fn main() -> ExitCode { // Forcibly disable backtra...
rust
MIT
f00fe0f0aeaeaf8fda48ca467c706a5174830b77
2026-01-04T15:32:37.541534Z
false
ajeetdsouza/zoxide
https://github.com/ajeetdsouza/zoxide/blob/f00fe0f0aeaeaf8fda48ca467c706a5174830b77/src/cmd/mod.rs
src/cmd/mod.rs
mod add; mod cmd; mod edit; mod import; mod init; mod query; mod remove; use anyhow::Result; pub use crate::cmd::cmd::*; pub trait Run { fn run(&self) -> Result<()>; } impl Run for Cmd { fn run(&self) -> Result<()> { match self { Cmd::Add(cmd) => cmd.run(), Cmd::Edit(cmd) => ...
rust
MIT
f00fe0f0aeaeaf8fda48ca467c706a5174830b77
2026-01-04T15:32:37.541534Z
false
ajeetdsouza/zoxide
https://github.com/ajeetdsouza/zoxide/blob/f00fe0f0aeaeaf8fda48ca467c706a5174830b77/src/cmd/init.rs
src/cmd/init.rs
use std::io::{self, Write}; use anyhow::{Context, Result}; use askama::Template; use crate::cmd::{Init, InitShell, Run}; use crate::config; use crate::error::BrokenPipeHandler; use crate::shell::{Bash, Elvish, Fish, Nushell, Opts, Posix, Powershell, Tcsh, Xonsh, Zsh}; impl Run for Init { fn run(&self) -> Result<...
rust
MIT
f00fe0f0aeaeaf8fda48ca467c706a5174830b77
2026-01-04T15:32:37.541534Z
false
ajeetdsouza/zoxide
https://github.com/ajeetdsouza/zoxide/blob/f00fe0f0aeaeaf8fda48ca467c706a5174830b77/src/cmd/query.rs
src/cmd/query.rs
use std::io::{self, Write}; use anyhow::{Context, Result}; use crate::cmd::{Query, Run}; use crate::config; use crate::db::{Database, Epoch, Stream, StreamOptions}; use crate::error::BrokenPipeHandler; use crate::util::{self, Fzf, FzfChild}; impl Run for Query { fn run(&self) -> Result<()> { let mut db =...
rust
MIT
f00fe0f0aeaeaf8fda48ca467c706a5174830b77
2026-01-04T15:32:37.541534Z
false
ajeetdsouza/zoxide
https://github.com/ajeetdsouza/zoxide/blob/f00fe0f0aeaeaf8fda48ca467c706a5174830b77/src/cmd/edit.rs
src/cmd/edit.rs
use std::io::{self, Write}; use anyhow::Result; use crate::cmd::{Edit, EditCommand, Run}; use crate::db::Database; use crate::error::BrokenPipeHandler; use crate::util::{self, Fzf, FzfChild}; impl Run for Edit { fn run(&self) -> Result<()> { let now = util::current_time()?; let db = &mut Database...
rust
MIT
f00fe0f0aeaeaf8fda48ca467c706a5174830b77
2026-01-04T15:32:37.541534Z
false
ajeetdsouza/zoxide
https://github.com/ajeetdsouza/zoxide/blob/f00fe0f0aeaeaf8fda48ca467c706a5174830b77/src/cmd/add.rs
src/cmd/add.rs
use std::path::Path; use anyhow::{Result, bail}; use crate::cmd::{Add, Run}; use crate::db::Database; use crate::{config, util}; impl Run for Add { fn run(&self) -> Result<()> { // These characters can't be printed cleanly to a single line, so they can cause // confusion when writing to stdout. ...
rust
MIT
f00fe0f0aeaeaf8fda48ca467c706a5174830b77
2026-01-04T15:32:37.541534Z
false
ajeetdsouza/zoxide
https://github.com/ajeetdsouza/zoxide/blob/f00fe0f0aeaeaf8fda48ca467c706a5174830b77/src/cmd/import.rs
src/cmd/import.rs
use std::fs; use anyhow::{Context, Result, bail}; use crate::cmd::{Import, ImportFrom, Run}; use crate::db::Database; impl Run for Import { fn run(&self) -> Result<()> { let buffer = fs::read_to_string(&self.path).with_context(|| { format!("could not open database for importing: {}", &self.pa...
rust
MIT
f00fe0f0aeaeaf8fda48ca467c706a5174830b77
2026-01-04T15:32:37.541534Z
false
ajeetdsouza/zoxide
https://github.com/ajeetdsouza/zoxide/blob/f00fe0f0aeaeaf8fda48ca467c706a5174830b77/src/cmd/remove.rs
src/cmd/remove.rs
use anyhow::{Result, bail}; use crate::cmd::{Remove, Run}; use crate::db::Database; use crate::util; impl Run for Remove { fn run(&self) -> Result<()> { let mut db = Database::open()?; for path in &self.paths { if !db.remove(path) { let path_abs = util::resolve_path(pa...
rust
MIT
f00fe0f0aeaeaf8fda48ca467c706a5174830b77
2026-01-04T15:32:37.541534Z
false
ajeetdsouza/zoxide
https://github.com/ajeetdsouza/zoxide/blob/f00fe0f0aeaeaf8fda48ca467c706a5174830b77/src/cmd/cmd.rs
src/cmd/cmd.rs
#![allow(clippy::module_inception)] use std::path::PathBuf; use clap::builder::{IntoResettable, Resettable, StyledStr}; use clap::{Parser, Subcommand, ValueEnum, ValueHint}; struct HelpTemplate; impl IntoResettable<StyledStr> for HelpTemplate { fn into_resettable(self) -> Resettable<StyledStr> { color_p...
rust
MIT
f00fe0f0aeaeaf8fda48ca467c706a5174830b77
2026-01-04T15:32:37.541534Z
false
ajeetdsouza/zoxide
https://github.com/ajeetdsouza/zoxide/blob/f00fe0f0aeaeaf8fda48ca467c706a5174830b77/src/db/stream.rs
src/db/stream.rs
use std::iter::Rev; use std::ops::Range; use std::path::Path; use std::{fs, path}; use glob::Pattern; use crate::db::{Database, Dir, Epoch}; use crate::util::{self, MONTH}; pub struct Stream<'a> { db: &'a mut Database, idxs: Rev<Range<usize>>, options: StreamOptions, } impl<'a> Stream<'a> { pub fn n...
rust
MIT
f00fe0f0aeaeaf8fda48ca467c706a5174830b77
2026-01-04T15:32:37.541534Z
false
ajeetdsouza/zoxide
https://github.com/ajeetdsouza/zoxide/blob/f00fe0f0aeaeaf8fda48ca467c706a5174830b77/src/db/mod.rs
src/db/mod.rs
mod dir; mod stream; use std::path::{Path, PathBuf}; use std::{fs, io}; use anyhow::{Context, Result, bail}; use bincode::Options; use ouroboros::self_referencing; pub use crate::db::dir::{Dir, Epoch, Rank}; pub use crate::db::stream::{Stream, StreamOptions}; use crate::{config, util}; #[self_referencing] pub struc...
rust
MIT
f00fe0f0aeaeaf8fda48ca467c706a5174830b77
2026-01-04T15:32:37.541534Z
false
ajeetdsouza/zoxide
https://github.com/ajeetdsouza/zoxide/blob/f00fe0f0aeaeaf8fda48ca467c706a5174830b77/src/db/dir.rs
src/db/dir.rs
use std::borrow::Cow; use std::fmt::{self, Display, Formatter}; use serde::{Deserialize, Serialize}; use crate::util::{DAY, HOUR, WEEK}; #[derive(Clone, Debug, Deserialize, Serialize)] pub struct Dir<'a> { #[serde(borrow)] pub path: Cow<'a, str>, pub rank: Rank, pub last_accessed: Epoch, } impl Dir<...
rust
MIT
f00fe0f0aeaeaf8fda48ca467c706a5174830b77
2026-01-04T15:32:37.541534Z
false
ajeetdsouza/zoxide
https://github.com/ajeetdsouza/zoxide/blob/f00fe0f0aeaeaf8fda48ca467c706a5174830b77/tests/completions.rs
tests/completions.rs
//! Test clap generated completions. #![cfg(feature = "nix-dev")] use assert_cmd::Command; #[test] fn completions_bash() { let source = include_str!("../contrib/completions/zoxide.bash"); Command::new("bash") .args(["--noprofile", "--norc", "-c", source]) .assert() .success() ....
rust
MIT
f00fe0f0aeaeaf8fda48ca467c706a5174830b77
2026-01-04T15:32:37.541534Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/examples/06-routing/link.rs
examples/06-routing/link.rs
//! How to use links in Dioxus //! //! The `router` crate gives us a `Link` component which is a much more powerful version of the standard HTML link. //! However, you can use the traditional `<a>` tag if you want to build your own `Link` component. //! //! The `Link` component integrates with the Router and is smart e...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/examples/06-routing/router_restore_scroll.rs
examples/06-routing/router_restore_scroll.rs
use std::rc::Rc; use dioxus::html::geometry::PixelsVector2D; use dioxus::prelude::*; #[derive(Clone, Routable, Debug, PartialEq)] enum Route { #[route("/")] Home {}, #[route("/blog/:id")] Blog { id: i32 }, } fn main() { dioxus::launch(App); } #[component] fn App() -> Element { use_context_pr...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/examples/06-routing/router.rs
examples/06-routing/router.rs
//! An advanced usage of the router with nested routes and redirects. //! //! Dioxus implements an enum-based router, which allows you to define your routes in a type-safe way. //! However, since we need to bake quite a bit of logic into the enum, we have to add some extra syntax. //! //! Note that you don't need to us...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/examples/06-routing/flat_router.rs
examples/06-routing/flat_router.rs
//! This example shows how to use the `Router` component to create a simple navigation system. //! The more complex router example uses all of the router features, while this simple example showcases //! just the `Layout` and `Route` features. //! //! Layouts let you wrap chunks of your app with a component. This is us...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/examples/06-routing/simple_router.rs
examples/06-routing/simple_router.rs
//! A simple example of a router with a few routes and a nav bar. use dioxus::prelude::*; fn main() { // launch the router, using our `Route` component as the generic type // This will automatically boot the app to "/" unless otherwise specified dioxus::launch(|| rsx! { Router::<Route> {} }); } /// By de...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/examples/06-routing/router_resource.rs
examples/06-routing/router_resource.rs
//! Example: Updating components with use_resource //! ----------------- //! //! This example shows how to use ReadSignal to make props reactive //! when linking to it from the same component, when using use_resource use dioxus::prelude::*; #[derive(Clone, Routable, Debug, PartialEq)] enum Route { #[route("/")] ...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/examples/06-routing/query_segment_search.rs
examples/06-routing/query_segment_search.rs
//! This example shows how to access and use query segments present in an url on the web. //! //! The enum router makes it easy to use your route as state in your app. This example shows how to use the router to encode search text into the url and decode it back into a string. //! //! Run this example on desktop with /...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/examples/06-routing/hash_fragment_state.rs
examples/06-routing/hash_fragment_state.rs
//! This example shows how to use the hash segment to store state in the url. //! //! You can set up two way data binding between the url hash and signals. //! //! Run this example on desktop with //! ```sh //! dx serve --example hash_fragment_state --features=ciborium,base64 //! ``` //! Or on web with //! ```sh //! ...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/examples/scripts/scrape_examples.rs
examples/scripts/scrape_examples.rs
use std::path::PathBuf; struct Example { name: String, path: PathBuf, } fn main() { let dir = PathBuf::from("/Users/jonathankelley/Development/dioxus/examples"); let out_file = PathBuf::from("/Users/jonathankelley/Development/dioxus/target/decl.toml"); let mut out_items = vec![]; // Iterate ...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/examples/08-apis/read_size.rs
examples/08-apis/read_size.rs
//! Read the size of elements using the MountedData struct. //! //! Whenever an Element is finally mounted to the Dom, its data is available to be read. //! These fields can typically only be read asynchronously, since various renderers need to release the main thread to //! perform layout and painting. use std::rc::R...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/examples/08-apis/multiwindow_with_tray_icon.rs
examples/08-apis/multiwindow_with_tray_icon.rs
//! Multiwindow with tray icon example //! //! This example shows how to implement a simple multiwindow application and tray icon using dioxus. //! This works by spawning a new window when the user clicks a button. We have to build a new virtualdom which has its //! own context, root elements, etc. //! //! This is usef...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/examples/08-apis/window_focus.rs
examples/08-apis/window_focus.rs
//! Listen for window focus events using a wry event handler //! //! This example shows how to use the use_wry_event_handler hook to listen for window focus events. //! We can intercept any Wry event, but in this case we're only interested in the WindowEvent::Focused event. //! //! This lets you do things like backgrou...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/examples/08-apis/shortcut.rs
examples/08-apis/shortcut.rs
//! Add global shortcuts to your app while a component is active //! //! This demo shows how to add a global shortcut to your app that toggles a signal. You could use this to implement //! a raycast-type app, or to add a global shortcut to your app that toggles a component on and off. //! //! These are *global* shortcu...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/examples/08-apis/title.rs
examples/08-apis/title.rs
//! This example shows how to set the title of the page or window with the Title component use dioxus::prelude::*; fn main() { dioxus::launch(app); } fn app() -> Element { let mut count = use_signal(|| 0); rsx! { div { // You can set the title of the page with the Title component ...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/examples/08-apis/multiwindow.rs
examples/08-apis/multiwindow.rs
//! Multiwindow example //! //! This example shows how to implement a simple multiwindow application using dioxus. //! This works by spawning a new window when the user clicks a button. We have to build a new virtualdom which has its //! own context, root elements, etc. use dioxus::prelude::*; fn main() { dioxus:...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/examples/08-apis/form.rs
examples/08-apis/form.rs
//! Forms //! //! Dioxus forms deviate slightly from html, automatically returning all named inputs //! in the "values" field. use dioxus::prelude::*; fn main() { dioxus::launch(app); } fn app() -> Element { let mut values = use_signal(Vec::new); let mut submitted_values = use_signal(Vec::new); rsx!...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/examples/08-apis/scroll_to_offset.rs
examples/08-apis/scroll_to_offset.rs
//! Scroll elements using their MountedData //! //! Dioxus exposes a few helpful APIs around elements (mimicking the DOM APIs) to allow you to interact with elements //! across the renderers. This includes scrolling, reading dimensions, and more. //! //! In this example we demonstrate how to scroll to a given y offset ...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/examples/08-apis/window_event.rs
examples/08-apis/window_event.rs
//! This example demonstrates how to handle window events and change window properties. //! //! We're able to do things like: //! - implement window dragging //! - toggle fullscreen //! - toggle always on top //! - toggle window decorations //! - change the window title //! //! The entire featuresuite of wry and tao is...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/examples/08-apis/window_zoom.rs
examples/08-apis/window_zoom.rs
//! Adjust the zoom of a desktop app //! //! This example shows how to adjust the zoom of a desktop app using the webview.zoom method. use dioxus::prelude::*; fn main() { dioxus::LaunchBuilder::desktop().launch(app); } fn app() -> Element { let mut level = use_signal(|| 1.0); rsx! { h1 { "Zoom l...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/examples/08-apis/file_upload.rs
examples/08-apis/file_upload.rs
//! This example shows how to use the `file` methods on FormEvent and DragEvent to handle file uploads and drops. //! //! Dioxus intercepts these events and provides a Rusty interface to the file data. Since we want this interface to //! be crossplatform, use dioxus::html::HasFileData; use dioxus::prelude::*; use diox...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/examples/08-apis/custom_menu.rs
examples/08-apis/custom_menu.rs
//! This example shows how to use a custom menu bar with Dioxus desktop. //! This example is not supported on the mobile or web renderers. use dioxus::desktop::{muda::*, use_muda_event_handler}; use dioxus::prelude::*; fn main() { // Create a menu bar that only contains the edit menu let menu = Menu::new(); ...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/examples/08-apis/on_resize.rs
examples/08-apis/on_resize.rs
//! Run a callback //! //! Whenever an Element is finally mounted to the Dom, its data is available to be read. //! These fields can typically only be read asynchronously, since various renderers need to release the main thread to //! perform layout and painting. use dioxus::prelude::*; use dioxus_elements::geometry::...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/examples/08-apis/drag_and_drop.rs
examples/08-apis/drag_and_drop.rs
//! This example shows how to implement a simple drag-and-drop kanban board using Dioxus. //! You can drag items between different categories and edit their contents. //! //! This example uses the `.data_transfer()` API to handle drag-and-drop events. When an item is dragged, //! its ID is stored in the data transfer o...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/examples/08-apis/wgpu_child_window.rs
examples/08-apis/wgpu_child_window.rs
//! Demonstrate how to use dioxus as a child window for use in alternative renderers like wgpu. //! //! The code here is borrowed from wry's example: //! https://github.com/tauri-apps/wry/blob/dev/examples/wgpu.rs //! //! To use this feature set `with_as_child_window()` on your desktop config which will then let you u...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/examples/08-apis/window_popup.rs
examples/08-apis/window_popup.rs
//! This example shows how to create a popup window and send data back to the parent window. //! Currently Dioxus doesn't support nested renderers, hence the need to create popups as separate windows. use dioxus::prelude::*; use std::rc::Rc; fn main() { dioxus::LaunchBuilder::desktop().launch(app); } fn app() ->...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/examples/08-apis/on_visible.rs
examples/08-apis/on_visible.rs
//! Port of the https://codepen.io/ryanfinni/pen/VwZeGxN example use dioxus::prelude::*; fn main() { dioxus::launch(app); } fn app() -> Element { let mut animated_classes = use_signal(|| ["animated-text", ""]); rsx! { Stylesheet { href: asset!("/examples/assets/visible.css") } div { ...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/examples/08-apis/eval.rs
examples/08-apis/eval.rs
//! This example shows how to use the `eval` function to run JavaScript code in the webview. //! //! Eval will only work with renderers that support javascript - so currently only the web and desktop/mobile renderers //! that use a webview. Native renderers will throw "unsupported" errors when calling `eval`. use asyn...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/examples/08-apis/overlay.rs
examples/08-apis/overlay.rs
//! This example demonstrates how to create an overlay window with dioxus. //! //! Basically, we just create a new window with a transparent background and no decorations, size it to the screen, and //! then we can draw whatever we want on it. In this case, we're drawing a simple overlay with a draggable header. //! //...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false