durch.github.io
...String } let rsa_key = match RSAKey::from_pem("random_rsa_for_testing") { Ok(x) => x, Err(e) => panic!("{}", e) }; let jwt = Jwt::new(ExampleStruct{field: String::from("test")}, rsa_key, None); println!("{}", jwt); }
Crate
v0.9.0
2025-12-09
docs.rs
...Example let mut es = EventSource::get("http://localhost:8000/events"); while let Some(event) = es.next().await { match event { Ok(Event::Open) => println!("Connection Open!"), Ok(Event::Message(message)) => println!("Message: {:#?}", message), Err(err) => { println!("Error: {}", err); es.close(); } } } License: MIT OR Apache-2.0
Crate
v0.6.0
2024-03-29
crates.io
...Installation Select a version of kube along matching versions of k8s-openapi and schemars for Kubernetes structs and matching schemas. See also historical Kubernetes versions . [dependencies] kube = { version = "4.2.0", features = ["runtime", "derive"] } k8s-openapi = { version = "0.28.0", features = ["latest", "schemars"] } schemars = { version = "1" } See features for a...
Crate
v4.2.1
2026-11-24
docs.rs
...The version of prost used by the library is re-exported as tink_proto::prost , to allow library users to get a precise version match. Features The json feature enables serde_json based serialization of the structures. License Apache License, Version 2.0 Disclaimer This is not an officially supported...
Crate
v0.3.0
2024-11-28
crates.io
...Installation Select a version of kube along matching versions of k8s-openapi and schemars for Kubernetes structs and matching schemas. See also historical Kubernetes versions . [dependencies] kube = { version = "4.0.0", features = ["runtime", "derive"] } k8s-openapi = { version = "0.28.0", features = ["latest", "schemars"] } schemars = { version = "1" } See features for a...
Crate
v4.2.1
2026-11-24
crates.io
...Installation Select a version of kube along matching versions of k8s-openapi and schemars for Kubernetes structs and matching schemas. See also historical Kubernetes versions . [dependencies] kube = { version = "4.2.0", features = ["runtime", "derive"] } k8s-openapi = { version = "0.28.0", features = ["latest", "schemars"] } schemars = { version = "1" } See features for a...
Crate
v4.2.1
2026-11-24
docs.rs
...Install [dependencies] diff = "0.1" Example extern crate diff; fn main() { let left = "foo\nbar\nbaz\nquux"; let right = "foo\nbaz\nbar\nquux"; for diff in diff::lines(left, right) { match diff { diff::Result::Left(l) => println!("-{}", l), diff::Result::Both(l, _) => println!(" {}", l), diff::Result::Right(r) => println!("+{}", r...
Crate
v0.1.13
2022-06-29
github.com
...use system_shutdown::shutdown; fn main() { match shutdown() { Ok(_) => println!("Shutting down, bye!"), Err(error) => eprintln!("Failed to shut down: {}", error), } } In most of the systems it does not requires the user to be root/admin. Contributions Pull Requests are welcome! =) License system_shutdown is licensed under either of the...
Crate
v4.1.0
2026-01-17
docs.rs
...Lastly, Radium provides RadiumT type aliases matching all of the AtomicT type names in the standard library. Each of these aliases forwards to its atomic variant when it exists, and to Cell<T> when it does not. Your code can use these names to be portable across targets with varying...
Crate
v1.1.1
2025-07-09
substrate.dev
...Search for a matching entry that has matching key bits. Use the address in the entry to query the partial k and value from a value table. Confirm that k matches expected value. Hash index insertion If an insertion is attempted into a full index page a reindex is triggered...
Crate
v0.5.7
2026-10-06
docs.rs
...MacroArgs = match syn::parse(args) { Ok(v) => v, Err(e) => { return e.to_compile_error().into(); } }; let _input = syn::parse_macro_input!(input as ItemFn); // do things with `args` unimplemented!() } Consuming Code use your_crate::your_attr; #[your_attr(path = "hello", timeout_ms = 15)] fn do_stuff() { println!("Hello"); } Features...
Crate
v0.24.1
2026-08-20
github.com
...use x509_parser::prelude::*; static IGCA_DER: &[u8] = include_bytes!("../assets/IGC_A.der"); let res = X509Certificate::from_der(IGCA_DER); match res { Ok((rem, cert)) => { assert!(rem.is_empty()); // assert_eq!(cert.version(), X509Version::V3); }, _ => panic!("x509 parsing failed: {:?}", res), } To parse a CRL and print information about revoked...
Crate
v0.18.1
2026-02-05
datafusion.apache.org
...It handles schema differences in file scans by rewriting expressions to match the physical schema, including type casting, missing columns, and partition values. For detailed documentation, see the PhysicalExprAdapter trait documentation. Most projects should use the datafusion crate directly, which re-exports this module. If you are already using the...
Crate
v56.0.0
2026-11-24
gitlab.com
...Cursor Position Cursor {Up, Down, Forward, Backward} Cursor {Save, Restore} Erase Display Erase Line Set Graphics mode Set/Reset Text Mode Usage let text = "\x1b[31;1;4mHello World\x1b[0m"; for e in parse_ansi(text) { match e.kind() { ElementKind::Text => { println!("Got a text: {:?}", &text[e.range()],); } _ => { println...
Crate
v0.3.0
2025-01-30
docs.rs
...use konst::{ eq_str, option, result::unwrap_ctx, }; #[derive(Debug, PartialEq)] enum Direction { Forward, Backward, Left, Right, } impl Direction { const fn try_parse(input: &str) -> Result<Self, ParseDirectionError> { // As of Rust 1.65.0, string patterns don't work in const contexts match () { _ if eq_str(input, "forward") => Ok(Direction...
Crate
v0.3.17
2026-04-16
docs.rs
...Making API calls The following will execute a POST request to /_search?allow_no_indices=true with a JSON body of {"query":{"match_all":{}}} use elasticsearch::{Elasticsearch, Error, SearchParts}; use serde_json::{json, Value}; #[tokio::main] async fn main() -> Result<(), Box<dyn std::error::Error>> { let client = Elasticsearch::default(); // make...
Crate
v8.19.0-alpha.1
2025-08-08
docs.rs
...assert_eq!(a != b, true); assert_eq!(a.compare(&b), Cmp::Lt); assert_eq!(a.compare_to(&b, Cmp::Lt), true); // Or match the comparison operators match a.compare(b) { Cmp::Lt => println!("Version a is less than b"), Cmp::Eq => println!("Version a is equal to b"), Cmp::Gt...
Crate
v0.2.1
2025-10-31
crates.io
...TcpStream, ) -> Result<(), WebSocketError> { handshake(&mut socket).await?; let mut ws = WebSocket::after_handshake(socket); ws.set_writev(true); ws.set_auto_close(true); ws.set_auto_pong(true); loop { let frame = ws.read_frame().await?; match frame { OpCode::Close => break, OpCode::Text | OpCode::Binary => { let frame = Frame::new(true, frame...
Crate
v0.8.1
2026-01-01
docs.rs
...When searching for more than one byte, positions are considered a match if the byte at that position matches any of the bytes. The memmem sub-module provides forward and reverse substring search routines. In all such cases, routines operate on &[u8] without regard to encoding. This is exactly what...
Crate
v2.8.3
2026-07-08
docs.rs
...extern crate y4m; use std::io; let mut infh = io::stdin(); let mut outfh = io::stdout(); let mut dec = y4m::decode(&mut infh).unwrap(); let mut enc = y4m::encode(dec.get_width(), dec.get_height(), dec.get_framerate()) .with_colorspace(dec.get_colorspace()) .write_header(&mut outfh) .unwrap(); loop { match...
Crate
v0.8.0
2023-04-21