kpdb/types/binary_value.rs
1// Copyright (c) 2016-2017 Martijn Rijkeboer <mrr@sru-systems.com>
2//
3// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
4// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
5// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
6// option. This file may not be copied, modified, or distributed
7// except according to those terms.
8
9use super::binary_id::BinaryId;
10use secstr::SecStr;
11
12/// A value for entry's map with binaries.
13#[derive(Clone, Debug, PartialEq)]
14pub enum BinaryValue {
15 /// Plain binary value.
16 Plain(Vec<u8>),
17
18 /// Protected binary value.
19 Protected(SecStr),
20
21 /// Reference to an item in the global binaries map.
22 Ref(BinaryId),
23}