libsignal_core_syft/
lib.rs

1//
2// Copyright 2023 Signal Messenger, LLC.
3// SPDX-License-Identifier: AGPL-3.0-only
4//
5
6mod address;
7// Not exporting the members because they have overly-generic names.
8pub mod curve;
9mod e164;
10mod version;
11
12pub use address::{
13    Aci, DeviceId, InvalidDeviceId, Pni, ProtocolAddress, ServiceId,
14    ServiceIdFixedWidthBinaryBytes, ServiceIdKind, WrongKindOfServiceIdError,
15};
16pub use e164::E164;
17pub use version::VERSION;
18
19/// Simple wrapper that invokes a lambda.
20///
21/// Once try-blocks are stabilized
22/// (<https://github.com/rust-lang/rust/issues/31436>), usages of this function
23/// can be removed and replaced with the new syntax.
24#[inline]
25#[track_caller]
26pub fn try_scoped<T, E>(f: impl FnOnce() -> Result<T, E>) -> Result<T, E> {
27    f()
28}