Skip to main content

finger_raw

Function finger_raw 

Source
pub fn finger_raw(
    query: &Query,
    timeout: Duration,
    max_response_size: u64,
) -> Result<Vec<u8>, FingerError>
Expand description

Execute a finger query over TCP, returning raw bytes.

Like finger, but returns the raw response bytes without UTF-8 decoding. The response is capped at max_response_size bytes. Useful for piping output to other tools or when the response contains non-UTF-8 data.

ยงExample

use std::time::Duration;
use digit::query::Query;
use digit::protocol::finger_raw;

let q = Query::parse(Some("user@example.com"), false, 79).unwrap();
let bytes = finger_raw(&q, Duration::from_secs(10), 1_048_576).unwrap();
std::io::Write::write_all(&mut std::io::stdout(), &bytes).unwrap();