wlan_storage/
lib.rs

1// Copyright 2020 The Fuchsia Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5//! High level node abstraction on top of Fuchsia's Stash service.
6//! Allows to insert structured, hierarchical data into a Stash backed
7//! store.
8
9pub mod policy;
10mod stash_store;
11mod storage_store;
12
13#[cfg(test)]
14mod tests {
15    use rand::distr::{Alphanumeric, SampleString as _};
16    use rand::rng;
17    use wlan_storage_constants::{NetworkIdentifier, SecurityType, StashedSsid};
18
19    pub fn rand_string() -> String {
20        Alphanumeric.sample_string(&mut rng(), 20)
21    }
22
23    pub fn network_id(
24        ssid: impl Into<StashedSsid>,
25        security_type: SecurityType,
26    ) -> NetworkIdentifier {
27        NetworkIdentifier { ssid: ssid.into(), security_type }
28    }
29}