pub struct Record {
pub number: u32,
pub version: u32,
pub unknown3: u32,
pub unknown5: u32,
pub key_data: Vec<u8>,
pub attributes: Vec<Option<Value>>,
}Fields§
§number: u32Record number, unique within the table.
version: u32The database’s commit version at the moment the record was written.
macOS stamps both records of an added item with the same value, so the
highest record version in a file equals its
Keychain::commit_version.
unknown3: u32Purpose unknown. 0 in every observed record except symmetric-key
records, where macOS writes 4.
unknown5: u32Purpose unknown; 0 in every observed record.
key_data: Vec<u8>The record’s data: an SSGP blob for password items, a key blob for key
records, a DbBlob for the metadata record.
attributes: Vec<Option<Value>>Attribute values, in the relation’s schema order. None is an absent
value, written as a zero offset.
Implementations§
Source§impl Record
impl Record
pub fn attribute(&self, index: usize) -> Option<&Value>
Sourcepub fn set_attribute(&mut self, index: usize, value: Option<Value>)
pub fn set_attribute(&mut self, index: usize, value: Option<Value>)
Set or clear an attribute by its position in the relation.
Out-of-range positions are ignored rather than panicking: a record built against a shorter relation is a schema problem, not a caller error.