philbooth.gitlab.io
...Bom = "foo.txt".parse().unwrap(); match bom { Bom::Null => { // No BOM was detected } Bom::Bocu1 => { // BOCU-1 BOM was detected } Bom::Gb18030 => { // GB 18030 BOM was detected } Bom::Scsu => { // SCSU BOM was detected } Bom::UtfEbcdic => { // UTF-EBCDIC BOM was detected } Bom::Utf1 => { // UTF-1 BOM was detected } Bom::Utf7 => { // UTF...
Crate
v2.0.3
2023-11-13
lib.rs
...TlsStream<TcpStream>) { // ... } for stream in listener.incoming() { match stream { Ok(stream) => { let acceptor = acceptor.clone(); thread::spawn(move || { let stream = acceptor.accept(stream).unwrap(); handle_client(stream); }); } Err(e) => { /* connection failed */ } } } } Supported features This crate supports the following features out of the box: TLS/SSL client communication TLS/SSL server...
Crate
v0.2.18
2026-02-18
crates.io
...FluentLanguageLoader = fluent_language_loader!(); loader .load_languages(&Localizations, &[loader.fallback_language().clone()]) .unwrap(); assert_eq!( "Hello \u{2068}Bob 23\u{2069}!", // Compile time check for message id, and the `name` argument, // to ensure it matches what is specified in the `fallback_language`'s // fluent resource file. fl!(loader, "hello...
Crate
v0.10.1
2026-07-23
docs.rs
...formatting, filters, and output can be applied recursively to match increasingly specific kinds of logging. Fern provides a builder-based configuration backing for rust's standard log crate. //! With fern, we can: // Configure logger at runtime fern::Dispatch::new() // Perform allocation-free log formatting .format(|out, message, record| { out.finish...
Crate
v0.7.1
2024-12-15
crates.io
...causes the build to fail if a version of LLVM exactly matching the current crate version is not found. If enabled, linking crate version 150.1.0 against LLVM 16.0 (for example) would fail whereas it is normally permitted. This may be useful if there is known to be...
Crate
v231.0.0-rc2
2026-08-11
crates.io
...In these cases, we have done our best to add the new functionality in a way that matched the style of standard HTTP usage. The current version of the Amazon S3 API is 2006-03-01. Amazon S3 supports the REST API. Getting Started Examples are available for many services...
Crate
v1.143.0
2026-08-20
crates.io
...Example fn main() { match enable_ansi_support::enable_ansi_support() { Ok(()) => { // ANSI escape codes were successfully enabled, or this is a non-Windows platform. // Use your terminal color library of choice here. println!("\x1b[31mHello, world\x1b[0m"); } Err(_) => { // The operation was unsuccessful, typically because it's running on an...
Crate
v0.3.1
2026-04-14
crates.io
...Boundary.match will return true if a set of graphemes matches the boundary condition Boundary methods for start and len describe how enum variants consume letters when matched Pattern is reverted back to being an enum, but with a Custom variant that allowed you to pass your own fn (&[&str...
Crate
v0.11.0
2026-01-31
github.com
...Note that N is just a reasonable guess and is not guaranteed to match the actual cache line length of the machine the program is running on. The size of CachePadded<T> is the smallest multiple of N bytes large enough to accommodate a value of type T . The alignment...
Crate
v1.3.0
2023-05-12
docs.rs
...Example use quote::quote; use syn::Ident; use proc_macro2::Span; use proc_macro_crate::{crate_name, FoundCrate}; fn import_my_crate() { let found_crate = crate_name("my-crate").expect("my-crate is present in `Cargo.toml`"); match found_crate { FoundCrate::Itself => quote!( crate::Something ), FoundCrate::Name(name) => { let ident...
Crate
v3.5.0
2026-03-04
mattforni.github.io
...extern crate args; extern crate getopts; use getopts::Occur; use std::process::exit; use args::{Args,ArgsError}; use args::validations::{Order,OrderValidation}; const PROGRAM_DESC: &'static str = "Run this program"; const PROGRAM_NAME: &'static str = "program"; fn main() { match parse(&vec!("-i", "5")) { Ok(_) => println!("Successfully parsed args"), Err(error...
Crate
v2.2.0
2018-02-27
docs.rs
...u32 = from_value(Value::UInt(65536)); assert_eq!(via_test_protocol, via_bin_protocol); let unknown_val = // ... // Maybe it is a float? let unknown_val = match from_value_opt::<f64>(unknown_val) { Ok(float) => { println!("A float value: {}", float); return Ok(()); } Err(FromValueError(unknown_val)) => unknown_val, }; // Or a string...
Crate
v28.0.0
2026-03-17
crates.io
...http_match name: server-smoke-test target: 127.0.0.1:3000 expect: status: 200 text: 'Google' notify_groups: - infra_team Notes cargo requires a rust installation. License ~~ MIT License ~~ Copyright (c) 2020 Kenan Sulayman Permission is hereby granted, free of charge, to any person obtaining a copy of this...
Crate
v0.5.0
2022-05-07
docs.rs
...let types_from_metadata = frame_decode::helpers::type_registry_from_metadata(&metadata).unwrap(); historic_types_for_spec.prepend(types_from_metadata); for ext_hex in extrinsics_hex { let ext_bytes = hex::decode(ext_hex.trim_start_matches("0x")).unwrap(); // Decode the extrinsic, returning information about it: let ext_info = decode...
Crate
v0.18.1
2026-08-06
docs.rs
...Bumpalo has a matching allocator_api cargo feature to enable implementing Allocator and using Bump with std collections. Note that, as feature(allocator_api) is unstable and only in nightly Rust, Bumpalo's matching allocator_api cargo feature should be considered unstable, and will not follow the semver conventions that...
Crate
v3.20.3
2026-05-22
github.com
...We employ zbus-lockstep to match types against those defined in the AT-SPI2 protocol descriptions. Not all types can be validated (easily) with zbus_lockstep because types may not exist in the protocol descriptions, for example because they are deprecated (but still in use) or we have chosen a...
Crate
v0.30.0
2026-05-06
docs.rs
...On BSD distributions, versioned instances of libclang.so matching the pattern libclang.so.* (e.g., libclang.so.7.0 ) are also included. Note: On Linux distributions when the runtime features is enabled, versioned instances of libclang.so matching the pattern libclang.so.* (e.g., libclang.so.1 ) are also included...
Crate
v1.9.1
2026-07-29
crates.io
...To target wasm32-wasip1 (where reqwest does not compile) or otherwise supply your own HTTP client, build against the matching *-base feature instead: cargo build -p object_store --no-default-features --features aws-base --target wasm32-wasip1 See Disabling reqwest in the crate docs for full details. Related Apache Crates...
Crate
v0.14.1
2026-07-15
docs.rs
...On Unix platforms, this crate now uses libc, so that the implementation matches what's in std. Users wishing to use the rustix-based implementation can use the rustix-is-terminal crate instead. is-terminal is a simple utility that answers one question: Is this a terminal? A "terminal", also...
Crate
v0.4.17
2025-10-23
docs.rs
...let (result, nin, _) = rdr.read_field(bytes, &mut [0; 1024]); bytes = &bytes[nin..]; match result { ReadFieldResult::InputEmpty => {}, ReadFieldResult::OutputFull => panic!("field too large"), ReadFieldResult::Field { record_end } => { count_fields += 1; if record_end { count_records += 1; } } ReadFieldResult::End => break, } } assert_eq!(3, count_records); assert_eq!(9, count_fields); Example...
Crate
v0.1.13
2025-10-17