pub struct Dict<K, V> {
pub(crate) items: BTreeMap<K, V>,
}
Expand description
Helper for formatting a dictionary.
use cargo_gazelle::{Dict, QuotedString, ToBazelDefinition};
let entry = (QuotedString::new("RUST_LOG"), QuotedString::new("INFO"));
let deps: Dict<QuotedString, QuotedString> = Dict::new(vec![entry]);
assert_eq!(deps.to_bazel_definition(), "{ \"RUST_LOG\": \"INFO\" }");
Fields§
§items: BTreeMap<K, V>
Implementations§
Trait Implementations§
Source§impl<K: ToBazelDefinition, V: ToBazelDefinition> ToBazelDefinition for Dict<K, V>
impl<K: ToBazelDefinition, V: ToBazelDefinition> ToBazelDefinition for Dict<K, V>
Auto Trait Implementations§
impl<K, V> Freeze for Dict<K, V>
impl<K, V> RefUnwindSafe for Dict<K, V>where
K: RefUnwindSafe,
V: RefUnwindSafe,
impl<K, V> Send for Dict<K, V>
impl<K, V> Sync for Dict<K, V>
impl<K, V> Unpin for Dict<K, V>
impl<K, V> UnwindSafe for Dict<K, V>where
K: RefUnwindSafe,
V: RefUnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more