wlan_storage/
lib.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// Copyright 2020 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

//! High level node abstraction on top of Fuchsia's Stash service.
//! Allows to insert structured, hierarchical data into a Stash backed
//! store.

pub mod policy;
mod stash_store;
mod storage_store;

#[cfg(test)]
mod tests {
    use rand::distributions::{Alphanumeric, DistString as _};
    use rand::thread_rng;
    use wlan_storage_constants::{NetworkIdentifier, SecurityType, StashedSsid};

    pub fn rand_string() -> String {
        Alphanumeric.sample_string(&mut thread_rng(), 20)
    }

    pub fn network_id(
        ssid: impl Into<StashedSsid>,
        security_type: SecurityType,
    ) -> NetworkIdentifier {
        NetworkIdentifier { ssid: ssid.into(), security_type }
    }
}