crates.io
...This means that you cannot directly match on an IValue to determine its type. Instead, an IValue offers several ways to get at the inner type: Destructuring using IValue::destructure[{_ref,_mut}]() These methods return wrapper enums which you can directly match on, so these methods are the most direct...
Crate
v0.1.7
2026-07-16
docs.rs
...std::fs::{symlink_file, symlink_dir} , matching symlink_auto or nothing. std::fs::{soft_link_file, soft_link_dir} , matching soft_link if it is undeprecated. But I don’t like the name “soft link,” anyway: no one calls them that, we all call them symlinks. Note that despite the...
Crate
v0.1.0
2017-01-27
magiclen.org
...In this crate, crc32 matches crc32b from mhash , and crc32mhash matches crc32 from mhash . crc32bzip2 crc32c crc32d crc32mpeg2 crc32posix crc32q crc32jamcrc crc32xfer crc40gsm crc64 crc64iso crc64we crc64jones For example: use crc_any::CRC; let mut crc64 = CRC::crc64(); crc64.update(b"hello"); After you get a CRC value, you can...
Crate
v3.0.1
2026-06-28
docs.rs
...extern crate unicode_normalization_alignments; use unicode_normalization_alignments::char::compose; use unicode_normalization_alignments::UnicodeNormalization; fn main() { assert_eq!(compose('A','\u{30a}'), Some('Å')); let s = "ÅΩ"; let c = s.nfc().map(|(c, diff)| { match diff { 0 => println!("Nothing changed here"), 1 => println!("New character"), _ => println!("{} characters were...
Crate
v0.1.12
2019-12-30
crates.io
...Currently a lot of documentation is rather terse, referring to the matching methods on the string types in the standard library is best in those cases. Feel free to contribute more exhaustive in-line docs.
Crate
v0.2.0
2020-10-10
docs.rs
...Example match rexif::parse_file(&file_name) { Ok(exif) => { println!("{} {} exif entries: {}", file_name, exif.mime, exif.entries.len()); for entry in &exif.entries { println!(" {}: {}", entry.tag, entry.value_more_readable); } }, Err(e) => { eprintln!("Error in {}: {} {}", &file_name, Error::description(&e), e.extra).unwrap(); } } The src/main.rs file is...
Crate
v0.7.5
2024-12-02
docs.rs
...ChannelBuilderError> { Ok(Channel { id: match self.id { Some(ref value) => Clone::clone(value), None => { return Err( Into::into( ::derive_builder::UninitializedFieldError::from("id"), ), ) } }, token: match self.token { Some(ref value) => Clone::clone(value), None => { return Err( Into::into( ::derive_builder::UninitializedFieldError::from("token"), ), ) } }, special_info: match self.special_info { Some...
Crate
v0.20.2
2024-10-08
malachite.rs
...The current floating-point string conversion functions are incomplete and will be changed in the future to match MPFR's behavior. Malachite is developed by Mikhail Hogrefe. Thanks to 43615, b4D8, Romain Billot, Maxim Biryukov, coolreader18, Dasaav-dsv, Duncan Freeman, florian1345, konstin, Rowan Hart, YunWon Jeong, Park Joon-Kyu, Antonio...
Crate
v0.10.0
2026-07-27
docs.rs
...fn main() { let client = client("localhost:18443", "user", "pass").expect("failed to create client"); let request = client.build_request("uptime", None); let response = client.send_request(request).expect("send_request failed"); // For other commands this would be a struct matching the returned json. let result: u64 = response.result().expect("response...
Crate
v0.20.1
2026-05-27
docs.rs
...use std::fs::File; use std::io::BufReader; use xml::reader::{EventReader, XmlEvent}; fn main() -> std::io::Result<()> { let file = File::open("file.xml")?; let file = BufReader::new(file); // Buffering is important for performance let parser = EventReader::new(file); let mut depth = 0; for e in parser { match e { Ok...
Crate
v1.4.0
2026-08-06
github.com
...use parity_tokio_ipc::Endpoint; use futures::stream::StreamExt; // For testing purposes only - instead, use a path to an actual socket or a pipe let addr = parity_tokio_ipc::dummy_endpoint(); let server = async move { Endpoint::new(addr) .incoming() .expect("Couldn't set up server") .for_each(|conn| async { match...
Crate
v0.9.0
2021-07-06
crates.io
...new(("sample.tao", 11..48)) .with_message(format!( "The values are outputs of this {} expression", "match".fg(out), )) .with_color(out), ) .with_note(format!( "Outputs of {} expressions must coerce to the same type", "match".fg(out) )) .finish() .print(("sample.tao", Source::from(include_str!("sample.tao")))) .unwrap(); } See examples/ for...
Crate
v0.6.0
2025-10-28
docs.rs
...expect("failed to execute process"); } } Simple Fork Example use fork::{fork, Fork, waitpid, WIFEXITED, WEXITSTATUS}; match fork() { Ok(Fork::Parent(child)) => { println!("Parent process, child PID: {}", child); // Wait for child and check exit status match waitpid(child) { Ok(status) => { if WIFEXITED(status) { println!("Child exited with code: {}", WEXITSTATUS(status)); } } Err...
Crate
v0.10.0
2026-07-18
crates.io
...mind the trailing newline! match rulelist("a = b / c\nc = *(d e)\n") { Ok(rules) => println!("{:#?}", rules), Err(error) => eprintln!("{}", error), } outputs [ Rule { name: "a", node: Alternatives( [ Rulename( "b", ), Rulename( "c", ), ], ), kind: Basic, }, Rule { name: "c", node: Repetition { repeat: Variable { min: None, max: None, }, node: Group( Concatenation( [ Rulename( "d", ), Rulename...
Crate
v0.13.0
2022-10-21
docs.rs
...Visitor>(&self, visitor: &mut V) -> ControlFlow<V::Break> { match self { Self::A() => {} Self::B(_1, _2) => { _1.visit(visitor)?; _2.visit(visitor)?; } Self::C { named } => { named.visit(visitor)?; } } ControlFlow::Continue(()) } } Some types may wish to call a corresponding method on the visitor: #[derive(Visit, VisitMut)] #[visit(with = "visit_expr")] enum...
Crate
v0.5.0
2026-02-10
docs.rs
...The "Type", "Subtype" and "BaseFont" tags // are straight out of the PDF spec. // // The dictionary macro is a helper that allows complex // key-value relationships to be represented in a simpler // visual manner, similar to a match statement. // A dictionary is implemented as an IndexMap of Vec<u8>, and Object...
Crate
v0.44.0
2026-07-10
crates.io
...impl MyBehavior for MyBehaviorEnum { fn my_trait_method(&self) { match self { MyImplementorA(inner) => inner.my_trait_method(), MyImplementorB(inner) => inner.my_trait_method(), } } } Additional trait methods would be expanded accordingly, and additional enum variants would correspond to additional match arms in each method definition. It's easy to see how...
Crate
v0.3.13
2024-03-28
crates.io
...proc_macro::TokenStream, ) -> proc_macro::TokenStream { let config = match from_tokenstream::<Config>(&TokenStream::from(attr)) { Ok(c) => c, Err(err) => return err.to_compile_error().into(), }; ... } See the serde documentation for the full range of controls that can be applied to types and their members. Error Handling Errors indicate the...
Crate
v0.3.0
2026-07-20
docs.rs
...FromRadix10>(text: &[u8]) -> Option<(&[u8], I)> { match I::from_radix_10(text) { (_, 0) => None, (n, used) => Some((&text[used..], n)), } } This crate has more to offer! Check out the full documentation at docs.rs .
Crate
v3.1.0
2026-06-25
github.com
...The object file is compiled by [this script] https://github.com/bytecodealliance/wit-bindgen/blob/main/ci/rebuild-libwit-bindgen-cabi.sh ) and is verified in repository continuous integration that the checked-in versions match what CI produces.
Crate
v0.44.0
2025-12-05