Skip to main content

is_value_position

Function is_value_position 

pub fn is_value_position(text: &str, at: usize, len: usize) -> bool
Expand description

Whether text[at..at + len] stands where a value stands: at the start or end of the text, or between bytes that cannot be part of an identifier, and not as the scheme of a URL (postgres://…).

So a held secret that is also an ordinary word is replaced where it is a value (a DSN’s user and password, a bare value, a header value) and kept where it is an identifier (fn postgres_handler, my_postgres_pool).