From 291a255da148b58ecb7d81619dfce29db696a83b Mon Sep 17 00:00:00 2001 From: bilelmoussaoui Date: Fri, 9 Feb 2024 10:19:01 +0000 Subject: [PATCH] deploy: a0d4dc7cda3936eabe02cb6edd740669f933143b --- help.html | 2 +- oo7/all.html | 2 +- oo7/dbus/api/index.html | 2 +- oo7/dbus/api/struct.Collection.html | 6 +- oo7/dbus/api/struct.Item.html | 8 +- oo7/dbus/api/struct.Properties.html | 14 +- oo7/dbus/api/struct.Secret.html | 6 +- oo7/dbus/api/struct.Service.html | 2 +- oo7/dbus/api/struct.Session.html | 6 +- oo7/dbus/api/trait.Unlockable.html | 4 +- oo7/dbus/constant.DEFAULT_COLLECTION.html | 2 +- oo7/dbus/constant.SESSION_COLLECTION.html | 2 +- oo7/dbus/enum.Error.html | 4 +- oo7/dbus/enum.ServiceError.html | 4 +- oo7/dbus/index.html | 2 +- oo7/dbus/struct.Collection.html | 2 +- oo7/dbus/struct.Item.html | 2 +- oo7/dbus/struct.Service.html | 2 +- oo7/enum.Error.html | 4 +- oo7/enum.Item.html | 2 +- oo7/enum.Keyring.html | 2 +- oo7/fn.is_sandboxed.html | 2 +- oo7/fn.migrate.html | 2 +- oo7/index.html | 2 +- oo7/portal/api/index.html | 2 +- oo7/portal/api/struct.AttributeValue.html | 148 ++++----- oo7/portal/api/struct.Keyring.html | 14 +- oo7/portal/enum.Error.html | 4 +- oo7/portal/enum.WeakKeyError.html | 4 +- oo7/portal/index.html | 2 +- oo7/portal/struct.InvalidItemError.html | 4 +- oo7/portal/struct.Item.html | 14 +- oo7/portal/struct.Keyring.html | 2 +- oo7/portal/struct.Secret.html | 282 +++++++++--------- oo7/struct.Key.html | 4 +- oo7/type.Result.html | 2 +- search-index.js | 2 +- settings.html | 2 +- src/oo7/crypto/mod.rs.html | 2 +- src/oo7/crypto/native.rs.html | 2 +- src/oo7/dbus/algorithm.rs.html | 2 +- src/oo7/dbus/api/collection.rs.html | 2 +- src/oo7/dbus/api/item.rs.html | 2 +- src/oo7/dbus/api/mod.rs.html | 2 +- src/oo7/dbus/api/prompt.rs.html | 2 +- src/oo7/dbus/api/properties.rs.html | 4 +- src/oo7/dbus/api/secret.rs.html | 2 +- src/oo7/dbus/api/service.rs.html | 8 +- src/oo7/dbus/api/session.rs.html | 2 +- src/oo7/dbus/collection.rs.html | 2 +- src/oo7/dbus/error.rs.html | 2 +- src/oo7/dbus/item.rs.html | 2 +- src/oo7/dbus/mod.rs.html | 2 +- src/oo7/dbus/service.rs.html | 2 +- src/oo7/error.rs.html | 2 +- src/oo7/helpers.rs.html | 2 +- src/oo7/key.rs.html | 2 +- src/oo7/keyring.rs.html | 2 +- src/oo7/lib.rs.html | 2 +- src/oo7/migration.rs.html | 2 +- src/oo7/portal/api/attribute_value.rs.html | 2 +- src/oo7/portal/api/encrypted_item.rs.html | 2 +- src/oo7/portal/api/mod.rs.html | 2 +- src/oo7/portal/error.rs.html | 2 +- src/oo7/portal/item.rs.html | 2 +- src/oo7/portal/mod.rs.html | 2 +- src/oo7/portal/secret.rs.html | 2 +- ...b8434.css => rustdoc-5bc39a1768837dd0.css} | 2 +- static.files/storage-4c98445ec4002617.js | 1 + static.files/storage-f2adc0d6ca4d09fb.js | 1 - trait.impl/core/clone/trait.Clone.js | 2 +- trait.impl/core/convert/trait.AsRef.js | 2 +- trait.impl/core/convert/trait.From.js | 2 +- trait.impl/core/error/trait.Error.js | 2 +- trait.impl/core/fmt/trait.Debug.js | 2 +- trait.impl/core/fmt/trait.Display.js | 2 +- trait.impl/core/marker/trait.Freeze.js | 2 +- trait.impl/core/marker/trait.Send.js | 2 +- trait.impl/core/marker/trait.Sync.js | 2 +- trait.impl/core/marker/trait.Unpin.js | 2 +- trait.impl/core/ops/drop/trait.Drop.js | 2 +- .../panic/unwind_safe/trait.RefUnwindSafe.js | 2 +- .../panic/unwind_safe/trait.UnwindSafe.js | 2 +- trait.impl/serde/de/trait.Deserialize.js | 2 +- trait.impl/serde/ser/trait.Serialize.js | 2 +- trait.impl/zeroize/trait.Zeroize.js | 2 +- trait.impl/zvariant/type/trait.Type.js | 2 +- type.impl/core/result/enum.Result.js | 2 +- 88 files changed, 337 insertions(+), 341 deletions(-) rename static.files/{rustdoc-b1a3e7f8283b8434.css => rustdoc-5bc39a1768837dd0.css} (90%) create mode 100644 static.files/storage-4c98445ec4002617.js delete mode 100644 static.files/storage-f2adc0d6ca4d09fb.js diff --git a/help.html b/help.html index f09dd1072..c757736d4 100644 --- a/help.html +++ b/help.html @@ -1,2 +1,2 @@ -Help +Help

Rustdoc help

Back
\ No newline at end of file diff --git a/oo7/all.html b/oo7/all.html index 005cecaa2..cf6479a8d 100644 --- a/oo7/all.html +++ b/oo7/all.html @@ -1,2 +1,2 @@ -List of all items in this crate +List of all items in this crate
\ No newline at end of file diff --git a/oo7/dbus/api/index.html b/oo7/dbus/api/index.html index b1a1de5a0..9fef817e2 100644 --- a/oo7/dbus/api/index.html +++ b/oo7/dbus/api/index.html @@ -1,4 +1,4 @@ -oo7::dbus::api - Rust +oo7::dbus::api - Rust

Module oo7::dbus::api

source ·
Available on crate feature unstable only.
Expand description

Barebone DBus API of the Secret Service specifications.

The API is not supposed to be used by the applications in general unless the wrapper API doesn’t provide functionality you need.

diff --git a/oo7/dbus/api/struct.Collection.html b/oo7/dbus/api/struct.Collection.html index 5815f44e7..adb5d7ef8 100644 --- a/oo7/dbus/api/struct.Collection.html +++ b/oo7/dbus/api/struct.Collection.html @@ -1,4 +1,4 @@ -Collection in oo7::dbus::api - Rust +Collection in oo7::dbus::api - Rust

Struct oo7::dbus::api::Collection

source ·
pub struct Collection<'a>(/* private fields */);
Available on crate feature unstable only.

Implementations§

source§

impl<'a> Collection<'a>

source

pub async fn new<P>( connection: &Connection, object_path: P @@ -19,8 +19,8 @@ attributes: &HashMap<&str, &str>, secret: &Secret<'_>, replace: bool -) -> Result<Item<'a>, Error>

Trait Implementations§

source§

impl<'a> Debug for Collection<'a>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'a> Serialize for Collection<'a>

source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where - S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl<'a> Type for Collection<'a>

source§

fn signature() -> Signature<'static>

Get the signature for the implementing type. Read more
source§

impl<'a> Unlockable for Collection<'a>

Auto Trait Implementations§

§

impl<'a> !RefUnwindSafe for Collection<'a>

§

impl<'a> Send for Collection<'a>

§

impl<'a> Sync for Collection<'a>

§

impl<'a> Unpin for Collection<'a>

§

impl<'a> !UnwindSafe for Collection<'a>

Blanket Implementations§

source§

impl<T> Any for T
where +) -> Result<Item<'a>, Error>

Trait Implementations§

source§

impl<'a> Debug for Collection<'a>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'a> Serialize for Collection<'a>

source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where + S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl<'a> Type for Collection<'a>

source§

fn signature() -> Signature<'static>

Get the signature for the implementing type. Read more
source§

impl<'a> Unlockable for Collection<'a>

Auto Trait Implementations§

§

impl<'a> !RefUnwindSafe for Collection<'a>

§

impl<'a> Send for Collection<'a>

§

impl<'a> Sync for Collection<'a>

§

impl<'a> Unpin for Collection<'a>

§

impl<'a> !UnwindSafe for Collection<'a>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> DynamicType for T
where diff --git a/oo7/dbus/api/struct.Item.html b/oo7/dbus/api/struct.Item.html index 3efc4a1e1..efc6a6b9e 100644 --- a/oo7/dbus/api/struct.Item.html +++ b/oo7/dbus/api/struct.Item.html @@ -1,4 +1,4 @@ -Item in oo7::dbus::api - Rust +Item in oo7::dbus::api - Rust

Struct oo7::dbus::api::Item

source ·
pub struct Item<'a>(/* private fields */);
Available on crate feature unstable only.

Implementations§

source§

impl<'a> Item<'a>

source

pub async fn new<P>( connection: &Connection, object_path: P @@ -10,9 +10,9 @@ ) -> Result<(), Error>

source

pub async fn delete(&self) -> Result<(), Error>

source

pub async fn secret(&self, session: &Session<'_>) -> Result<Secret<'_>, Error>

source

pub async fn set_secret(&self, secret: &Secret<'_>) -> Result<(), Error>

Trait Implementations§

source§

impl<'a> Debug for Item<'a>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'a> Hash for Item<'a>

source§

fn hash<H: Hasher>(&self, state: &mut H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl<'a> PartialEq for Item<'a>

source§

fn eq(&self, other: &Self) -> bool

This method tests for self and other values to be equal, and is used -by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl<'a> Serialize for Item<'a>

source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where - S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl<'a> Type for Item<'a>

source§

fn signature() -> Signature<'static>

Get the signature for the implementing type. Read more
source§

impl<'a> Eq for Item<'a>

source§

impl<'a> Unlockable for Item<'a>

Auto Trait Implementations§

§

impl<'a> !RefUnwindSafe for Item<'a>

§

impl<'a> Send for Item<'a>

§

impl<'a> Sync for Item<'a>

§

impl<'a> Unpin for Item<'a>

§

impl<'a> !UnwindSafe for Item<'a>

Blanket Implementations§

source§

impl<T> Any for T
where +by ==.

1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.

source§

impl<'a> Serialize for Item<'a>

source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where + S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl<'a> Type for Item<'a>

source§

fn signature() -> Signature<'static>

Get the signature for the implementing type. Read more
source§

impl<'a> Eq for Item<'a>

source§

impl<'a> Unlockable for Item<'a>

Auto Trait Implementations§

§

impl<'a> !RefUnwindSafe for Item<'a>

§

impl<'a> Send for Item<'a>

§

impl<'a> Sync for Item<'a>

§

impl<'a> Unpin for Item<'a>

§

impl<'a> !UnwindSafe for Item<'a>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> DynamicType for T
where diff --git a/oo7/dbus/api/struct.Properties.html b/oo7/dbus/api/struct.Properties.html index 0f5f4a7b2..57bff8d7a 100644 --- a/oo7/dbus/api/struct.Properties.html +++ b/oo7/dbus/api/struct.Properties.html @@ -1,11 +1,11 @@ -Properties in oo7::dbus::api - Rust -

Struct oo7::dbus::api::Properties

source ·
pub struct Properties { /* private fields */ }
Available on crate feature unstable only.

Implementations§

source§

impl Properties

source

pub fn for_item(label: &str, attributes: &HashMap<&str, &str>) -> Self

source

pub fn for_collection(label: &str) -> Self

source

pub fn label(&self) -> &str

source

pub fn attributes(&self) -> Option<&HashMap<String, String>>

Trait Implementations§

source§

impl Debug for Properties

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for Properties

source§

fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where - D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Serialize for Properties

source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where - S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl Type for Properties

source§

fn signature() -> Signature<'static>

Get the signature for the implementing type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where +Properties in oo7::dbus::api - Rust +

Struct oo7::dbus::api::Properties

source ·
pub struct Properties { /* private fields */ }
Available on crate feature unstable only.

Implementations§

source§

impl Properties

source

pub fn for_item(label: &str, attributes: &HashMap<&str, &str>) -> Self

source

pub fn for_collection(label: &str) -> Self

source

pub fn label(&self) -> &str

source

pub fn attributes(&self) -> Option<&HashMap<String, String>>

Trait Implementations§

source§

impl Debug for Properties

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for Properties

source§

fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where + D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Serialize for Properties

source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where + S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl Type for Properties

source§

fn signature() -> Signature<'static>

Get the signature for the implementing type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<'de, T> DynamicDeserialize<'de> for T
where - T: Type + Deserialize<'de> + ?Sized,

§

type Deserializer = PhantomData<T>

A DeserializeSeed implementation for this type.
§

fn deserializer_for_signature<S>( + T: Type + Deserialize<'de> + ?Sized,

§

type Deserializer = PhantomData<T>

A DeserializeSeed implementation for this type.
§

fn deserializer_for_signature<S>( signature: S ) -> Result<<T as DynamicDeserialize<'de>>::Deserializer, Error>
where S: TryInto<Signature<'de>>, @@ -23,5 +23,5 @@ V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a -[WithDispatch] wrapper. Read more
source§

impl<T> DeserializeOwned for T
where - T: for<'de> Deserialize<'de>,

\ No newline at end of file +[WithDispatch] wrapper. Read more

source§

impl<T> DeserializeOwned for T
where + T: for<'de> Deserialize<'de>,

\ No newline at end of file diff --git a/oo7/dbus/api/struct.Secret.html b/oo7/dbus/api/struct.Secret.html index 8367060fe..0ffbdb0b9 100644 --- a/oo7/dbus/api/struct.Secret.html +++ b/oo7/dbus/api/struct.Secret.html @@ -1,10 +1,10 @@ -Secret in oo7::dbus::api - Rust +Secret in oo7::dbus::api - Rust

Struct oo7::dbus::api::Secret

source ·
pub struct Secret<'a> { /* private fields */ }
Available on crate feature unstable only.

Implementations§

source§

impl<'a> Secret<'a>

source

pub fn session(&self) -> &Session<'_>

Session used to encode the secret

source

pub fn parameters(&self) -> &[u8]

Algorithm dependent parameters for secret value encoding

source

pub fn value(&self) -> &[u8]

Possibly encoded secret value

source

pub fn content_type(&self) -> &str

Content type of the secret

-

Trait Implementations§

source§

impl<'a> Debug for Secret<'a>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'a> Drop for Secret<'a>

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl<'a> Serialize for Secret<'a>

source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where - S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl<'a> Type for Secret<'a>

source§

fn signature() -> Signature<'static>

Get the signature for the implementing type. Read more
source§

impl<'a> Zeroize for Secret<'a>

source§

fn zeroize(&mut self)

Zero out this object from memory using Rust intrinsics which ensure the +

Trait Implementations§

source§

impl<'a> Debug for Secret<'a>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'a> Drop for Secret<'a>

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl<'a> Serialize for Secret<'a>

source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where + S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl<'a> Type for Secret<'a>

source§

fn signature() -> Signature<'static>

Get the signature for the implementing type. Read more
source§

impl<'a> Zeroize for Secret<'a>

source§

fn zeroize(&mut self)

Zero out this object from memory using Rust intrinsics which ensure the zeroization operation is not “optimized away” by the compiler.

Auto Trait Implementations§

§

impl<'a> !RefUnwindSafe for Secret<'a>

§

impl<'a> Send for Secret<'a>

§

impl<'a> Sync for Secret<'a>

§

impl<'a> Unpin for Secret<'a>

§

impl<'a> !UnwindSafe for Secret<'a>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where diff --git a/oo7/dbus/api/struct.Service.html b/oo7/dbus/api/struct.Service.html index 6292c20a3..a04c4cd4a 100644 --- a/oo7/dbus/api/struct.Service.html +++ b/oo7/dbus/api/struct.Service.html @@ -1,4 +1,4 @@ -Service in oo7::dbus::api - Rust +Service in oo7::dbus::api - Rust

Struct oo7::dbus::api::Service

source ·
pub struct Service<'a>(/* private fields */);
Available on crate feature unstable only.

Implementations§

source§

impl<'a> Service<'a>

source

pub async fn new(connection: &Connection) -> Result<Service<'a>, Error>

source

pub fn inner(&self) -> &Proxy<'_>

source

pub async fn receive_collection_created( &self ) -> Result<impl Stream<Item = Collection<'_>>, Error>

source

pub async fn receive_collection_deleted( diff --git a/oo7/dbus/api/struct.Session.html b/oo7/dbus/api/struct.Session.html index 8a69a5a54..a4da45ba8 100644 --- a/oo7/dbus/api/struct.Session.html +++ b/oo7/dbus/api/struct.Session.html @@ -1,11 +1,11 @@ -Session in oo7::dbus::api - Rust +Session in oo7::dbus::api - Rust

Struct oo7::dbus::api::Session

source ·
pub struct Session<'a>(/* private fields */);
Available on crate feature unstable only.

Implementations§

source§

impl<'a> Session<'a>

source

pub async fn new<P>( connection: &Connection, object_path: P ) -> Result<Session<'a>, Error>
where P: TryInto<ObjectPath<'a>>, - P::Error: Into<Error>,

source

pub fn inner(&self) -> &Proxy<'_>

source

pub async fn close(&self) -> Result<(), Error>

Trait Implementations§

source§

impl<'a> Debug for Session<'a>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'a> Serialize for Session<'a>

source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where - S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl<'a> Type for Session<'a>

source§

fn signature() -> Signature<'static>

Get the signature for the implementing type. Read more

Auto Trait Implementations§

§

impl<'a> !RefUnwindSafe for Session<'a>

§

impl<'a> Send for Session<'a>

§

impl<'a> Sync for Session<'a>

§

impl<'a> Unpin for Session<'a>

§

impl<'a> !UnwindSafe for Session<'a>

Blanket Implementations§

source§

impl<T> Any for T
where + P::Error: Into<Error>,

source

pub fn inner(&self) -> &Proxy<'_>

source

pub async fn close(&self) -> Result<(), Error>

Trait Implementations§

source§

impl<'a> Debug for Session<'a>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'a> Serialize for Session<'a>

source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where + S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl<'a> Type for Session<'a>

source§

fn signature() -> Signature<'static>

Get the signature for the implementing type. Read more

Auto Trait Implementations§

§

impl<'a> !RefUnwindSafe for Session<'a>

§

impl<'a> Send for Session<'a>

§

impl<'a> Sync for Session<'a>

§

impl<'a> Unpin for Session<'a>

§

impl<'a> !UnwindSafe for Session<'a>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> DynamicType for T
where diff --git a/oo7/dbus/api/trait.Unlockable.html b/oo7/dbus/api/trait.Unlockable.html index 1899b9b56..e8e1cffa2 100644 --- a/oo7/dbus/api/trait.Unlockable.html +++ b/oo7/dbus/api/trait.Unlockable.html @@ -1,4 +1,4 @@ -Unlockable in oo7::dbus::api - Rust -

Trait oo7::dbus::api::Unlockable

source ·
pub trait Unlockable: Serialize + Type { }
Available on crate feature unstable only.
Expand description

A common trait implemented by objects that can be +Unlockable in oo7::dbus::api - Rust

+

Trait oo7::dbus::api::Unlockable

source ·
pub trait Unlockable: Serialize + Type { }
Available on crate feature unstable only.
Expand description

A common trait implemented by objects that can be locked or unlocked. Like Collection or Item.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl Unlockable for &OwnedObjectPath

source§

impl Unlockable for OwnedObjectPath

source§

impl<'a> Unlockable for &ObjectPath<'a>

source§

impl<'a> Unlockable for ObjectPath<'a>

Implementors§

source§

impl<'a> Unlockable for Collection<'a>

source§

impl<'a> Unlockable for Item<'a>

\ No newline at end of file diff --git a/oo7/dbus/constant.DEFAULT_COLLECTION.html b/oo7/dbus/constant.DEFAULT_COLLECTION.html index 665829b0e..9c4f1f4e6 100644 --- a/oo7/dbus/constant.DEFAULT_COLLECTION.html +++ b/oo7/dbus/constant.DEFAULT_COLLECTION.html @@ -1,4 +1,4 @@ -DEFAULT_COLLECTION in oo7::dbus - Rust +DEFAULT_COLLECTION in oo7::dbus - Rust

Constant oo7::dbus::DEFAULT_COLLECTION

source ·
pub const DEFAULT_COLLECTION: &str = "default";
Expand description

The default collection alias.

In general, you are supposed to use Service::default_collection.

\ No newline at end of file diff --git a/oo7/dbus/constant.SESSION_COLLECTION.html b/oo7/dbus/constant.SESSION_COLLECTION.html index 54221f1dc..98ddab1af 100644 --- a/oo7/dbus/constant.SESSION_COLLECTION.html +++ b/oo7/dbus/constant.SESSION_COLLECTION.html @@ -1,4 +1,4 @@ -SESSION_COLLECTION in oo7::dbus - Rust +SESSION_COLLECTION in oo7::dbus - Rust

Constant oo7::dbus::SESSION_COLLECTION

source ·
pub const SESSION_COLLECTION: &str = "session";
Expand description

A session collection.

The collection is cleared when the user ends the session.

\ No newline at end of file diff --git a/oo7/dbus/enum.Error.html b/oo7/dbus/enum.Error.html index 78c27ec3c..f0b874619 100644 --- a/oo7/dbus/enum.Error.html +++ b/oo7/dbus/enum.Error.html @@ -1,4 +1,4 @@ -Error in oo7::dbus - Rust +Error in oo7::dbus - Rust

Enum oo7::dbus::Error

source ·
pub enum Error {
     Zbus(Error),
     Service(ServiceError),
@@ -13,7 +13,7 @@
 
§

Dismissed

The prompt request was dismissed.

§

NotFound(String)

The collection doesn’t exists

§

IO(Error)

Input/Output.

-

Trait Implementations§

source§

impl Debug for Error

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for Error

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for Error

1.30.0 · source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
source§

impl From<Error> for Error

source§

fn from(e: Error) -> Self

Converts to this type from the input type.
source§

impl From<Error> for Error

source§

fn from(e: Error) -> Self

Converts to this type from the input type.
source§

impl From<Error> for Error

source§

fn from(e: Error) -> Self

Converts to this type from the input type.
source§

impl From<Error> for Error

source§

fn from(e: Error) -> Self

Converts to this type from the input type.
source§

impl From<Error> for Error

source§

fn from(e: Error) -> Self

Converts to this type from the input type.
source§

impl From<ServiceError> for Error

source§

fn from(e: ServiceError) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl !RefUnwindSafe for Error

§

impl Send for Error

§

impl Sync for Error

§

impl Unpin for Error

§

impl !UnwindSafe for Error

Blanket Implementations§

source§

impl<T> Any for T
where +

Trait Implementations§

source§

impl Debug for Error

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for Error

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for Error

1.30.0 · source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
source§

impl From<Error> for Error

source§

fn from(e: Error) -> Self

Converts to this type from the input type.
source§

impl From<Error> for Error

source§

fn from(e: Error) -> Self

Converts to this type from the input type.
source§

impl From<Error> for Error

source§

fn from(e: Error) -> Self

Converts to this type from the input type.
source§

impl From<Error> for Error

source§

fn from(e: Error) -> Self

Converts to this type from the input type.
source§

impl From<Error> for Error

source§

fn from(e: Error) -> Self

Converts to this type from the input type.
source§

impl From<ServiceError> for Error

source§

fn from(e: ServiceError) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl !RefUnwindSafe for Error

§

impl Send for Error

§

impl Sync for Error

§

impl Unpin for Error

§

impl !UnwindSafe for Error

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

diff --git a/oo7/dbus/enum.ServiceError.html b/oo7/dbus/enum.ServiceError.html index 0c8e838cd..9a0e69382 100644 --- a/oo7/dbus/enum.ServiceError.html +++ b/oo7/dbus/enum.ServiceError.html @@ -1,4 +1,4 @@ -ServiceError in oo7::dbus - Rust +ServiceError in oo7::dbus - Rust

Enum oo7::dbus::ServiceError

source ·
pub enum ServiceError {
     ZBus(Error),
     IsLocked,
@@ -10,7 +10,7 @@
 
§

IsLocked

Collection/Item is locked.

§

NoSession

Session does not exist.

§

NoSuchObject

Collection/Item does not exist.

-

Trait Implementations§

source§

impl DBusError for ServiceError

source§

fn name(&self) -> ErrorName<'_>

source§

fn description(&self) -> Option<&str>

source§

fn create_reply(&self, call: &MessageHeader<'_>) -> Result<Message>

Generate an error reply message for the given method call.
source§

impl Debug for ServiceError

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for ServiceError

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for ServiceError

1.30.0 · source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
source§

impl From<Error> for ServiceError

source§

fn from(value: Error) -> ServiceError

Converts to this type from the input type.
source§

impl From<ServiceError> for Error

source§

fn from(e: ServiceError) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where +

Trait Implementations§

source§

impl DBusError for ServiceError

source§

fn name(&self) -> ErrorName<'_>

source§

fn description(&self) -> Option<&str>

source§

fn create_reply(&self, call: &MessageHeader<'_>) -> Result<Message>

Generate an error reply message for the given method call.
source§

impl Debug for ServiceError

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for ServiceError

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for ServiceError

1.30.0 · source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
source§

impl From<Error> for ServiceError

source§

fn from(value: Error) -> ServiceError

Converts to this type from the input type.
source§

impl From<ServiceError> for Error

source§

fn from(e: ServiceError) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

diff --git a/oo7/dbus/index.html b/oo7/dbus/index.html index 395fa5826..50c834627 100644 --- a/oo7/dbus/index.html +++ b/oo7/dbus/index.html @@ -1,4 +1,4 @@ -oo7::dbus - Rust +oo7::dbus - Rust

Module oo7::dbus

source ·
Expand description

A Secret Service implementation.

That is usually done with

diff --git a/oo7/dbus/struct.Collection.html b/oo7/dbus/struct.Collection.html index c385c4e2f..fe407fa70 100644 --- a/oo7/dbus/struct.Collection.html +++ b/oo7/dbus/struct.Collection.html @@ -1,4 +1,4 @@ -Collection in oo7::dbus - Rust +Collection in oo7::dbus - Rust

Struct oo7::dbus::Collection

source ·
pub struct Collection<'a> { /* private fields */ }
Expand description

A collection allows to store and retrieve items.

The collection can be either in a locked or unlocked state, use Collection::lock or Collection::unlock to lock or unlock it.

diff --git a/oo7/dbus/struct.Item.html b/oo7/dbus/struct.Item.html index d497ea39c..1ad7b2f86 100644 --- a/oo7/dbus/struct.Item.html +++ b/oo7/dbus/struct.Item.html @@ -1,4 +1,4 @@ -Item in oo7::dbus - Rust +Item in oo7::dbus - Rust

Struct oo7::dbus::Item

source ·
pub struct Item<'a> { /* private fields */ }
Expand description

A secret with a label and attributes to identify it.

An item might be locked or unlocked, use Item::lock or Item::unlock to lock or unlock it. Note that the Secret Service might not be able to diff --git a/oo7/dbus/struct.Service.html b/oo7/dbus/struct.Service.html index 46f387c09..6e3954313 100644 --- a/oo7/dbus/struct.Service.html +++ b/oo7/dbus/struct.Service.html @@ -1,4 +1,4 @@ -Service in oo7::dbus - Rust

+Service in oo7::dbus - Rust

Struct oo7::dbus::Service

source ·
pub struct Service<'a> { /* private fields */ }
Expand description

The entry point of communicating with a org.freedesktop.Secrets implementation.

It will automatically create a session for you and allow you to retrieve collections or create new ones.

diff --git a/oo7/enum.Error.html b/oo7/enum.Error.html index 82b1630ff..07dac756f 100644 --- a/oo7/enum.Error.html +++ b/oo7/enum.Error.html @@ -1,11 +1,11 @@ -Error in oo7 - Rust +Error in oo7 - Rust

Enum oo7::Error

source ·
pub enum Error {
     Portal(Error),
     DBus(Error),
 }
Expand description

The error type for oo7.

Variants§

§

Portal(Error)

File backend error.

§

DBus(Error)

Secret Service error.

-

Trait Implementations§

source§

impl Debug for Error

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for Error

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for Error

1.30.0 · source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
source§

impl From<Error> for Error

source§

fn from(e: Error) -> Self

Converts to this type from the input type.
source§

impl From<Error> for Error

source§

fn from(e: Error) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl !RefUnwindSafe for Error

§

impl Send for Error

§

impl Sync for Error

§

impl Unpin for Error

§

impl !UnwindSafe for Error

Blanket Implementations§

source§

impl<T> Any for T
where +

Trait Implementations§

source§

impl Debug for Error

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for Error

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for Error

1.30.0 · source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
source§

impl From<Error> for Error

source§

fn from(e: Error) -> Self

Converts to this type from the input type.
source§

impl From<Error> for Error

source§

fn from(e: Error) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl !RefUnwindSafe for Error

§

impl Send for Error

§

impl Sync for Error

§

impl Unpin for Error

§

impl !UnwindSafe for Error

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

diff --git a/oo7/enum.Item.html b/oo7/enum.Item.html index f3cc6e3ee..edee135ae 100644 --- a/oo7/enum.Item.html +++ b/oo7/enum.Item.html @@ -1,4 +1,4 @@ -Item in oo7 - Rust +Item in oo7 - Rust

Enum oo7::Item

source ·
pub enum Item {
     // some variants omitted
 }
Expand description

A generic secret with a label and attributes.

diff --git a/oo7/enum.Keyring.html b/oo7/enum.Keyring.html index e07cbe49a..d88fe32ef 100644 --- a/oo7/enum.Keyring.html +++ b/oo7/enum.Keyring.html @@ -1,4 +1,4 @@ -Keyring in oo7 - Rust +Keyring in oo7 - Rust

Enum oo7::Keyring

source ·
pub enum Keyring {
     // some variants omitted
 }
Expand description

A Secret Service or file backed keyring diff --git a/oo7/fn.is_sandboxed.html b/oo7/fn.is_sandboxed.html index ec6e6eb57..fd6bf593e 100644 --- a/oo7/fn.is_sandboxed.html +++ b/oo7/fn.is_sandboxed.html @@ -1,3 +1,3 @@ -is_sandboxed in oo7 - Rust

+is_sandboxed in oo7 - Rust

Function oo7::is_sandboxed

source ·
pub async fn is_sandboxed() -> bool
Expand description

Checks whether the application is sandboxed or not.

\ No newline at end of file diff --git a/oo7/fn.migrate.html b/oo7/fn.migrate.html index 7863d9829..ca479b9f9 100644 --- a/oo7/fn.migrate.html +++ b/oo7/fn.migrate.html @@ -1,4 +1,4 @@ -migrate in oo7 - Rust +migrate in oo7 - Rust

Function oo7::migrate

source ·
pub async fn migrate(
     attributes: Vec<HashMap<&str, &str>>,
     replace: bool
diff --git a/oo7/index.html b/oo7/index.html
index 02287728a..879066ddf 100644
--- a/oo7/index.html
+++ b/oo7/index.html
@@ -1,4 +1,4 @@
-oo7 - Rust
-
1.0.0 · source

pub fn is_empty(&self) -> bool

Returns true if self has a length of zero bytes.

+
1.0.0 · source

pub fn is_empty(&self) -> bool

Returns true if self has a length of zero bytes.

§Examples
let s = "";
 assert!(s.is_empty());
 
 let s = "not empty";
 assert!(!s.is_empty());
-
1.9.0 · source

pub fn is_char_boundary(&self, index: usize) -> bool

Checks that index-th byte is the first byte in a UTF-8 code point +

1.9.0 · source

pub fn is_char_boundary(&self, index: usize) -> bool

Checks that index-th byte is the first byte in a UTF-8 code point sequence or the end of the string.

The start and end of the string (when index == self.len()) are considered to be boundaries.

@@ -33,7 +33,7 @@
§Examples
// third byte of `老` assert!(!s.is_char_boundary(8));
-
source

pub fn floor_char_boundary(&self, index: usize) -> usize

🔬This is a nightly-only experimental API. (round_char_boundary)

Finds the closest x not exceeding index where is_char_boundary(x) is true.

+
source

pub fn floor_char_boundary(&self, index: usize) -> usize

🔬This is a nightly-only experimental API. (round_char_boundary)

Finds the closest x not exceeding index where is_char_boundary(x) is true.

This method can help you truncate a string so that it’s still valid UTF-8, but doesn’t exceed a given number of bytes. Note that this is done purely at the character level and can still visually split graphemes, even though the underlying characters aren’t @@ -48,7 +48,7 @@

§Examples
let closest = s.floor_char_boundary(13); assert_eq!(closest, 10); assert_eq!(&s[..closest], "❤️🧡");
-
source

pub fn ceil_char_boundary(&self, index: usize) -> usize

🔬This is a nightly-only experimental API. (round_char_boundary)

Finds the closest x not below index where is_char_boundary(x) is true.

+
source

pub fn ceil_char_boundary(&self, index: usize) -> usize

🔬This is a nightly-only experimental API. (round_char_boundary)

Finds the closest x not below index where is_char_boundary(x) is true.

If index is greater than the length of the string, this returns the length of the string.

This method is the natural complement to floor_char_boundary. See that method for more details.

@@ -61,12 +61,12 @@
§Examples
let closest = s.ceil_char_boundary(13); assert_eq!(closest, 14); assert_eq!(&s[..closest], "❤️🧡💛");
-
1.0.0 · source

pub fn as_bytes(&self) -> &[u8]

Converts a string slice to a byte slice. To convert the byte slice back +

1.0.0 · source

pub fn as_bytes(&self) -> &[u8]

Converts a string slice to a byte slice. To convert the byte slice back into a string slice, use the from_utf8 function.

§Examples
let bytes = "bors".as_bytes();
 assert_eq!(b"bors", bytes);
-
1.0.0 · source

pub fn as_ptr(&self) -> *const u8

Converts a string slice to a raw pointer.

+
1.0.0 · source

pub fn as_ptr(&self) -> *const u8

Converts a string slice to a raw pointer.

As string slices are a slice of bytes, the raw pointer points to a u8. This pointer will be pointing to the first byte of the string slice.

@@ -75,7 +75,7 @@
§Examples
§Examples
let s = "Hello";
 let ptr = s.as_ptr();
-
1.20.0 · source

pub fn get<I>(&self, i: I) -> Option<&<I as SliceIndex<str>>::Output>
where +

1.20.0 · source

pub fn get<I>(&self, i: I) -> Option<&<I as SliceIndex<str>>::Output>
where I: SliceIndex<str>,

Returns a subslice of str.

This is the non-panicking alternative to indexing the str. Returns None whenever equivalent indexing operation would panic.

@@ -90,7 +90,7 @@
§Examples
// out of bounds assert!(v.get(..42).is_none());
-
1.20.0 · source

pub unsafe fn get_unchecked<I>(&self, i: I) -> &<I as SliceIndex<str>>::Output
where +

1.20.0 · source

pub unsafe fn get_unchecked<I>(&self, i: I) -> &<I as SliceIndex<str>>::Output
where I: SliceIndex<str>,

Returns an unchecked subslice of str.

This is the unchecked alternative to indexing the str.

§Safety
@@ -110,7 +110,7 @@
§Examples
assert_eq!("∈", v.get_unchecked(4..7)); assert_eq!("🌏", v.get_unchecked(7..11)); }
-
1.0.0 · source

pub unsafe fn slice_unchecked(&self, begin: usize, end: usize) -> &str

👎Deprecated since 1.29.0: use get_unchecked(begin..end) instead

Creates a string slice from another string slice, bypassing safety +

1.0.0 · source

pub unsafe fn slice_unchecked(&self, begin: usize, end: usize) -> &str

👎Deprecated since 1.29.0: use get_unchecked(begin..end) instead

Creates a string slice from another string slice, bypassing safety checks.

This is generally not recommended, use with caution! For a safe alternative see str and Index.

@@ -138,7 +138,7 @@
§Examples
unsafe { assert_eq!("world", s.slice_unchecked(7, 12)); }
-
1.4.0 · source

pub fn split_at(&self, mid: usize) -> (&str, &str)

Divide one string slice into two at an index.

+
1.4.0 · source

pub fn split_at(&self, mid: usize) -> (&str, &str)

Divide one string slice into two at an index.

The argument, mid, should be a byte offset from the start of the string. It must also be on the boundary of a UTF-8 code point.

The two slices returned go from the start of the string slice to mid, @@ -156,7 +156,7 @@

§Examplesassert_eq!("Per", first); assert_eq!(" Martin-Löf", last);
-
source

pub fn split_at_checked(&self, mid: usize) -> Option<(&str, &str)>

🔬This is a nightly-only experimental API. (split_at_checked)

Divide one string slice into two at an index.

+
source

pub fn split_at_checked(&self, mid: usize) -> Option<(&str, &str)>

🔬This is a nightly-only experimental API. (split_at_checked)

Divide one string slice into two at an index.

The argument, mid, should be a valid byte offset from the start of the string. It must also be on the boundary of a UTF-8 code point. The method returns None if that’s not the case.

@@ -175,7 +175,7 @@
§Examplesassert_eq!(None, s.split_at_checked(13)); // Inside “ö” assert_eq!(None, s.split_at_checked(16)); // Beyond the string length
-
1.0.0 · source

pub fn chars(&self) -> Chars<'_>

Returns an iterator over the chars of a string slice.

+
1.0.0 · source

pub fn chars(&self) -> Chars<'_>

Returns an iterator over the chars of a string slice.

As a string slice consists of valid UTF-8, we can iterate through a string slice by char. This method returns such an iterator.

It’s important to remember that char represents a Unicode Scalar @@ -211,7 +211,7 @@

§Examplesassert_eq!(Some('\u{0306}'), chars.next()); assert_eq!(None, chars.next());
-
1.0.0 · source

pub fn char_indices(&self) -> CharIndices<'_>

Returns an iterator over the chars of a string slice, and their +

1.0.0 · source

pub fn char_indices(&self) -> CharIndices<'_>

Returns an iterator over the chars of a string slice, and their positions.

As a string slice consists of valid UTF-8, we can iterate through a string slice by char. This method returns an iterator of both @@ -251,7 +251,7 @@

§Examplesassert_eq!(Some((4, 's')), char_indices.next()); assert_eq!(None, char_indices.next());
-
1.0.0 · source

pub fn bytes(&self) -> Bytes<'_>

An iterator over the bytes of a string slice.

+
1.0.0 · source

pub fn bytes(&self) -> Bytes<'_>

An iterator over the bytes of a string slice.

As a string slice consists of a sequence of bytes, we can iterate through a string slice by byte. This method returns such an iterator.

§Examples
@@ -263,7 +263,7 @@
§Examplesassert_eq!(Some(b's'), bytes.next()); assert_eq!(None, bytes.next());
-
1.1.0 · source

pub fn split_whitespace(&self) -> SplitWhitespace<'_>

Splits a string slice by whitespace.

+
1.1.0 · source

pub fn split_whitespace(&self) -> SplitWhitespace<'_>

Splits a string slice by whitespace.

The iterator returned will return string slices that are sub-slices of the original string slice, separated by any amount of whitespace.

‘Whitespace’ is defined according to the terms of the Unicode Derived @@ -293,7 +293,7 @@

§Examples
assert_eq!("".split_whitespace().next(), None);
 assert_eq!("   ".split_whitespace().next(), None);
-
1.34.0 · source

pub fn split_ascii_whitespace(&self) -> SplitAsciiWhitespace<'_>

Splits a string slice by ASCII whitespace.

+
1.34.0 · source

pub fn split_ascii_whitespace(&self) -> SplitAsciiWhitespace<'_>

Splits a string slice by ASCII whitespace.

The iterator returned will return string slices that are sub-slices of the original string slice, separated by any amount of ASCII whitespace.

To split by Unicode Whitespace instead, use split_whitespace.

@@ -321,7 +321,7 @@
§Examples
assert_eq!("".split_ascii_whitespace().next(), None);
 assert_eq!("   ".split_ascii_whitespace().next(), None);
-

1.0.0 · source

pub fn lines(&self) -> Lines<'_>

An iterator over the lines of a string, as string slices.

+
1.0.0 · source

pub fn lines(&self) -> Lines<'_>

An iterator over the lines of a string, as string slices.

Lines are split at line endings that are either newlines (\n) or sequences of a carriage return followed by a line feed (\r\n).

Line terminators are not included in the lines returned by the iterator.

@@ -355,8 +355,8 @@
§Examplesassert_eq!(Some("baz"), lines.next()); assert_eq!(None, lines.next());
-

1.0.0 · source

pub fn lines_any(&self) -> LinesAny<'_>

👎Deprecated since 1.4.0: use lines() instead now

An iterator over the lines of a string.

-
1.8.0 · source

pub fn encode_utf16(&self) -> EncodeUtf16<'_>

Returns an iterator of u16 over the string encoded as UTF-16.

+
1.0.0 · source

pub fn lines_any(&self) -> LinesAny<'_>

👎Deprecated since 1.4.0: use lines() instead now

An iterator over the lines of a string.

+
1.8.0 · source

pub fn encode_utf16(&self) -> EncodeUtf16<'_>

Returns an iterator of u16 over the string encoded as UTF-16.

§Examples
let text = "Zażółć gęślą jaźń";
 
@@ -364,7 +364,7 @@ 
§Exampleslet utf16_len = text.encode_utf16().count(); assert!(utf16_len <= utf8_len);
-
1.0.0 · source

pub fn contains<'a, P>(&'a self, pat: P) -> bool
where +

1.0.0 · source

pub fn contains<'a, P>(&'a self, pat: P) -> bool
where P: Pattern<'a>,

Returns true if the given pattern matches a sub-slice of this string slice.

Returns false if it does not.

@@ -375,7 +375,7 @@
§Examplesassert!(bananas.contains("nana")); assert!(!bananas.contains("apples"));
-
1.0.0 · source

pub fn starts_with<'a, P>(&'a self, pat: P) -> bool
where +

1.0.0 · source

pub fn starts_with<'a, P>(&'a self, pat: P) -> bool
where P: Pattern<'a>,

Returns true if the given pattern matches a prefix of this string slice.

Returns false if it does not.

@@ -386,7 +386,7 @@
§Examplesassert!(bananas.starts_with("bana")); assert!(!bananas.starts_with("nana"));
-
1.0.0 · source

pub fn ends_with<'a, P>(&'a self, pat: P) -> bool
where +

1.0.0 · source

pub fn ends_with<'a, P>(&'a self, pat: P) -> bool
where P: Pattern<'a>, <P as Pattern<'a>>::Searcher: ReverseSearcher<'a>,

Returns true if the given pattern matches a suffix of this string slice.

@@ -398,7 +398,7 @@
§Examplesassert!(bananas.ends_with("anas")); assert!(!bananas.ends_with("nana"));
-
1.0.0 · source

pub fn find<'a, P>(&'a self, pat: P) -> Option<usize>
where +

1.0.0 · source

pub fn find<'a, P>(&'a self, pat: P) -> Option<usize>
where P: Pattern<'a>,

Returns the byte index of the first character of this string slice that matches the pattern.

Returns None if the pattern doesn’t match.

@@ -426,7 +426,7 @@
§Exampleslet x: &[_] = &['1', '2']; assert_eq!(s.find(x), None);
-
1.0.0 · source

pub fn rfind<'a, P>(&'a self, pat: P) -> Option<usize>
where +

1.0.0 · source

pub fn rfind<'a, P>(&'a self, pat: P) -> Option<usize>
where P: Pattern<'a>, <P as Pattern<'a>>::Searcher: ReverseSearcher<'a>,

Returns the byte index for the first character of the last match of the pattern in this string slice.

@@ -453,7 +453,7 @@
§Exampleslet x: &[_] = &['1', '2']; assert_eq!(s.rfind(x), None);
-
1.0.0 · source

pub fn split<'a, P>(&'a self, pat: P) -> Split<'a, P>
where +

1.0.0 · source

pub fn split<'a, P>(&'a self, pat: P) -> Split<'a, P>
where P: Pattern<'a>,

An iterator over substrings of this string slice, separated by characters matched by a pattern.

The pattern can be a &str, char, a slice of chars, or a @@ -527,7 +527,7 @@

§Examples
assert_eq!(d, &["a", "b", "c"]);

Use split_whitespace for this behavior.

-
1.51.0 · source

pub fn split_inclusive<'a, P>(&'a self, pat: P) -> SplitInclusive<'a, P>
where +

1.51.0 · source

pub fn split_inclusive<'a, P>(&'a self, pat: P) -> SplitInclusive<'a, P>
where P: Pattern<'a>,

An iterator over substrings of this string slice, separated by characters matched by a pattern. Differs from the iterator produced by split in that split_inclusive leaves the matched part as the @@ -545,7 +545,7 @@

§Examples
let v: Vec<&str> = "Mary had a little lamb\nlittle lamb\nlittle lamb.\n"
     .split_inclusive('\n').collect();
 assert_eq!(v, ["Mary had a little lamb\n", "little lamb\n", "little lamb.\n"]);
-
1.0.0 · source

pub fn rsplit<'a, P>(&'a self, pat: P) -> RSplit<'a, P>
where +

1.0.0 · source

pub fn rsplit<'a, P>(&'a self, pat: P) -> RSplit<'a, P>
where P: Pattern<'a>, <P as Pattern<'a>>::Searcher: ReverseSearcher<'a>,

An iterator over substrings of the given string slice, separated by characters matched by a pattern and yielded in reverse order.

@@ -574,7 +574,7 @@
§Examples
let v: Vec<&str> = "abc1defXghi".rsplit(|c| c == '1' || c == 'X').collect();
 assert_eq!(v, ["ghi", "def", "abc"]);
-
1.0.0 · source

pub fn split_terminator<'a, P>(&'a self, pat: P) -> SplitTerminator<'a, P>
where +

1.0.0 · source

pub fn split_terminator<'a, P>(&'a self, pat: P) -> SplitTerminator<'a, P>
where P: Pattern<'a>,

An iterator over substrings of the given string slice, separated by characters matched by a pattern.

The pattern can be a &str, char, a slice of chars, or a @@ -598,7 +598,7 @@

§Exampleslet v: Vec<&str> = "A.B:C.D".split_terminator(&['.', ':'][..]).collect(); assert_eq!(v, ["A", "B", "C", "D"]);
-
1.0.0 · source

pub fn rsplit_terminator<'a, P>(&'a self, pat: P) -> RSplitTerminator<'a, P>
where +

1.0.0 · source

pub fn rsplit_terminator<'a, P>(&'a self, pat: P) -> RSplitTerminator<'a, P>
where P: Pattern<'a>, <P as Pattern<'a>>::Searcher: ReverseSearcher<'a>,

An iterator over substrings of self, separated by characters matched by a pattern and yielded in reverse order.

@@ -623,7 +623,7 @@
§Exampleslet v: Vec<&str> = "A.B:C.D".rsplit_terminator(&['.', ':'][..]).collect(); assert_eq!(v, ["D", "C", "B", "A"]);
-
1.0.0 · source

pub fn splitn<'a, P>(&'a self, n: usize, pat: P) -> SplitN<'a, P>
where +

1.0.0 · source

pub fn splitn<'a, P>(&'a self, n: usize, pat: P) -> SplitN<'a, P>
where P: Pattern<'a>,

An iterator over substrings of the given string slice, separated by a pattern, restricted to returning at most n items.

If n substrings are returned, the last substring (the nth substring) @@ -653,7 +653,7 @@

§Examples
let v: Vec<&str> = "abc1defXghi".splitn(2, |c| c == '1' || c == 'X').collect();
 assert_eq!(v, ["abc", "defXghi"]);
-
1.0.0 · source

pub fn rsplitn<'a, P>(&'a self, n: usize, pat: P) -> RSplitN<'a, P>
where +

1.0.0 · source

pub fn rsplitn<'a, P>(&'a self, n: usize, pat: P) -> RSplitN<'a, P>
where P: Pattern<'a>, <P as Pattern<'a>>::Searcher: ReverseSearcher<'a>,

An iterator over substrings of this string slice, separated by a pattern, starting from the end of the string, restricted to returning @@ -681,7 +681,7 @@

§Examples
let v: Vec<&str> = "abc1defXghi".rsplitn(2, |c| c == '1' || c == 'X').collect();
 assert_eq!(v, ["ghi", "abc1def"]);
-
1.52.0 · source

pub fn split_once<'a, P>(&'a self, delimiter: P) -> Option<(&'a str, &'a str)>
where +

1.52.0 · source

pub fn split_once<'a, P>(&'a self, delimiter: P) -> Option<(&'a str, &'a str)>
where P: Pattern<'a>,

Splits the string on the first occurrence of the specified delimiter and returns prefix before delimiter and suffix after delimiter.

§Examples
@@ -689,7 +689,7 @@
§Examplesassert_eq!("cfg=".split_once('='), Some(("cfg", ""))); assert_eq!("cfg=foo".split_once('='), Some(("cfg", "foo"))); assert_eq!("cfg=foo=bar".split_once('='), Some(("cfg", "foo=bar")));
-
1.52.0 · source

pub fn rsplit_once<'a, P>(&'a self, delimiter: P) -> Option<(&'a str, &'a str)>
where +

1.52.0 · source

pub fn rsplit_once<'a, P>(&'a self, delimiter: P) -> Option<(&'a str, &'a str)>
where P: Pattern<'a>, <P as Pattern<'a>>::Searcher: ReverseSearcher<'a>,

Splits the string on the last occurrence of the specified delimiter and returns prefix before delimiter and suffix after delimiter.

@@ -697,7 +697,7 @@
§Examples
assert_eq!("cfg".rsplit_once('='), None);
 assert_eq!("cfg=foo".rsplit_once('='), Some(("cfg", "foo")));
 assert_eq!("cfg=foo=bar".rsplit_once('='), Some(("cfg=foo", "bar")));
-
1.2.0 · source

pub fn matches<'a, P>(&'a self, pat: P) -> Matches<'a, P>
where +

1.2.0 · source

pub fn matches<'a, P>(&'a self, pat: P) -> Matches<'a, P>
where P: Pattern<'a>,

An iterator over the disjoint matches of a pattern within the given string slice.

The pattern can be a &str, char, a slice of chars, or a @@ -714,7 +714,7 @@

§Exampleslet v: Vec<&str> = "1abc2abc3".matches(char::is_numeric).collect(); assert_eq!(v, ["1", "2", "3"]);
-
1.2.0 · source

pub fn rmatches<'a, P>(&'a self, pat: P) -> RMatches<'a, P>
where +

1.2.0 · source

pub fn rmatches<'a, P>(&'a self, pat: P) -> RMatches<'a, P>
where P: Pattern<'a>, <P as Pattern<'a>>::Searcher: ReverseSearcher<'a>,

An iterator over the disjoint matches of a pattern within this string slice, yielded in reverse order.

@@ -731,7 +731,7 @@
§Exampleslet v: Vec<&str> = "1abc2abc3".rmatches(char::is_numeric).collect(); assert_eq!(v, ["3", "2", "1"]);
-
1.5.0 · source

pub fn match_indices<'a, P>(&'a self, pat: P) -> MatchIndices<'a, P>
where +

1.5.0 · source

pub fn match_indices<'a, P>(&'a self, pat: P) -> MatchIndices<'a, P>
where P: Pattern<'a>,

An iterator over the disjoint matches of a pattern within this string slice as well as the index that the match starts at.

For matches of pat within self that overlap, only the indices @@ -753,7 +753,7 @@

§Exampleslet v: Vec<_> = "ababa".match_indices("aba").collect(); assert_eq!(v, [(0, "aba")]); // only the first `aba`
-
1.5.0 · source

pub fn rmatch_indices<'a, P>(&'a self, pat: P) -> RMatchIndices<'a, P>
where +

1.5.0 · source

pub fn rmatch_indices<'a, P>(&'a self, pat: P) -> RMatchIndices<'a, P>
where P: Pattern<'a>, <P as Pattern<'a>>::Searcher: ReverseSearcher<'a>,

An iterator over the disjoint matches of a pattern within self, yielded in reverse order along with the index of the match.

@@ -775,14 +775,14 @@
§Exampleslet v: Vec<_> = "ababa".rmatch_indices("aba").collect(); assert_eq!(v, [(2, "aba")]); // only the last `aba`
-
1.0.0 · source

pub fn trim(&self) -> &str

Returns a string slice with leading and trailing whitespace removed.

+
1.0.0 · source

pub fn trim(&self) -> &str

Returns a string slice with leading and trailing whitespace removed.

‘Whitespace’ is defined according to the terms of the Unicode Derived Core Property White_Space, which includes newlines.

§Examples
let s = "\n Hello\tworld\t\n";
 
 assert_eq!("Hello\tworld", s.trim());
-
1.30.0 · source

pub fn trim_start(&self) -> &str

Returns a string slice with leading whitespace removed.

+
1.30.0 · source

pub fn trim_start(&self) -> &str

Returns a string slice with leading whitespace removed.

‘Whitespace’ is defined according to the terms of the Unicode Derived Core Property White_Space, which includes newlines.

§Text directionality
@@ -802,7 +802,7 @@
§Exampleslet s = " עברית "; assert!(Some('ע') == s.trim_start().chars().next());
-
1.30.0 · source

pub fn trim_end(&self) -> &str

Returns a string slice with trailing whitespace removed.

+
1.30.0 · source

pub fn trim_end(&self) -> &str

Returns a string slice with trailing whitespace removed.

‘Whitespace’ is defined according to the terms of the Unicode Derived Core Property White_Space, which includes newlines.

§Text directionality
@@ -822,7 +822,7 @@
§Exampleslet s = " עברית "; assert!(Some('ת') == s.trim_end().chars().rev().next());
-
1.0.0 · source

pub fn trim_left(&self) -> &str

👎Deprecated since 1.33.0: superseded by trim_start

Returns a string slice with leading whitespace removed.

+
1.0.0 · source

pub fn trim_left(&self) -> &str

👎Deprecated since 1.33.0: superseded by trim_start

Returns a string slice with leading whitespace removed.

‘Whitespace’ is defined according to the terms of the Unicode Derived Core Property White_Space.

§Text directionality
@@ -843,7 +843,7 @@
§Exampleslet s = " עברית"; assert!(Some('ע') == s.trim_left().chars().next());
-
1.0.0 · source

pub fn trim_right(&self) -> &str

👎Deprecated since 1.33.0: superseded by trim_end

Returns a string slice with trailing whitespace removed.

+
1.0.0 · source

pub fn trim_right(&self) -> &str

👎Deprecated since 1.33.0: superseded by trim_end

Returns a string slice with trailing whitespace removed.

‘Whitespace’ is defined according to the terms of the Unicode Derived Core Property White_Space.

§Text directionality
@@ -864,7 +864,7 @@
§Exampleslet s = "עברית "; assert!(Some('ת') == s.trim_right().chars().rev().next());
-
1.0.0 · source

pub fn trim_matches<'a, P>(&'a self, pat: P) -> &'a str
where +

1.0.0 · source

pub fn trim_matches<'a, P>(&'a self, pat: P) -> &'a str
where P: Pattern<'a>, <P as Pattern<'a>>::Searcher: DoubleEndedSearcher<'a>,

Returns a string slice with all prefixes and suffixes that match a pattern repeatedly removed.

@@ -881,7 +881,7 @@
§ExamplesA more complex pattern, using a closure:

assert_eq!("1foo1barXX".trim_matches(|c| c == '1' || c == 'X'), "foo1bar");
-
1.30.0 · source

pub fn trim_start_matches<'a, P>(&'a self, pat: P) -> &'a str
where +

1.30.0 · source

pub fn trim_start_matches<'a, P>(&'a self, pat: P) -> &'a str
where P: Pattern<'a>,

Returns a string slice with all prefixes that match a pattern repeatedly removed.

The pattern can be a &str, char, a slice of chars, or a @@ -897,7 +897,7 @@

§Exampleslet x: &[_] = &['1', '2']; assert_eq!("12foo1bar12".trim_start_matches(x), "foo1bar12");
-
1.45.0 · source

pub fn strip_prefix<'a, P>(&'a self, prefix: P) -> Option<&'a str>
where +

1.45.0 · source

pub fn strip_prefix<'a, P>(&'a self, prefix: P) -> Option<&'a str>
where P: Pattern<'a>,

Returns a string slice with the prefix removed.

If the string starts with the pattern prefix, returns substring after the prefix, wrapped in Some. Unlike trim_start_matches, this method removes the prefix exactly once.

@@ -908,7 +908,7 @@
§Examples
assert_eq!("foo:bar".strip_prefix("foo:"), Some("bar"));
 assert_eq!("foo:bar".strip_prefix("bar"), None);
 assert_eq!("foofoo".strip_prefix("foo"), Some("foo"));
-
1.45.0 · source

pub fn strip_suffix<'a, P>(&'a self, suffix: P) -> Option<&'a str>
where +

1.45.0 · source

pub fn strip_suffix<'a, P>(&'a self, suffix: P) -> Option<&'a str>
where P: Pattern<'a>, <P as Pattern<'a>>::Searcher: ReverseSearcher<'a>,

Returns a string slice with the suffix removed.

If the string ends with the pattern suffix, returns the substring before the suffix, @@ -920,7 +920,7 @@

§Examples
assert_eq!("bar:foo".strip_suffix(":foo"), Some("bar"));
 assert_eq!("bar:foo".strip_suffix("bar"), None);
 assert_eq!("foofoo".strip_suffix("foo"), Some("foo"));
-
1.30.0 · source

pub fn trim_end_matches<'a, P>(&'a self, pat: P) -> &'a str
where +

1.30.0 · source

pub fn trim_end_matches<'a, P>(&'a self, pat: P) -> &'a str
where P: Pattern<'a>, <P as Pattern<'a>>::Searcher: ReverseSearcher<'a>,

Returns a string slice with all suffixes that match a pattern repeatedly removed.

@@ -942,7 +942,7 @@
§ExamplesA more complex pattern, using a closure:

assert_eq!("1fooX".trim_end_matches(|c| c == '1' || c == 'X'), "1foo");
-
1.0.0 · source

pub fn trim_left_matches<'a, P>(&'a self, pat: P) -> &'a str
where +

1.0.0 · source

pub fn trim_left_matches<'a, P>(&'a self, pat: P) -> &'a str
where P: Pattern<'a>,

👎Deprecated since 1.33.0: superseded by trim_start_matches

Returns a string slice with all prefixes that match a pattern repeatedly removed.

The pattern can be a &str, char, a slice of chars, or a @@ -958,7 +958,7 @@

§Exampleslet x: &[_] = &['1', '2']; assert_eq!("12foo1bar12".trim_left_matches(x), "foo1bar12");
-
1.0.0 · source

pub fn trim_right_matches<'a, P>(&'a self, pat: P) -> &'a str
where +

1.0.0 · source

pub fn trim_right_matches<'a, P>(&'a self, pat: P) -> &'a str
where P: Pattern<'a>, <P as Pattern<'a>>::Searcher: ReverseSearcher<'a>,

👎Deprecated since 1.33.0: superseded by trim_end_matches

Returns a string slice with all suffixes that match a pattern repeatedly removed.

@@ -980,7 +980,7 @@
§ExamplesA more complex pattern, using a closure:

assert_eq!("1fooX".trim_right_matches(|c| c == '1' || c == 'X'), "1foo");
-
1.0.0 · source

pub fn parse<F>(&self) -> Result<F, <F as FromStr>::Err>
where +

1.0.0 · source

pub fn parse<F>(&self) -> Result<F, <F as FromStr>::Err>
where F: FromStr,

Parses this string slice into another type.

Because parse is so general, it can cause problems with type inference. As such, parse is one of the few times you’ll see @@ -1007,23 +1007,23 @@

§Examples
let nope = "j".parse::<u32>();
 
 assert!(nope.is_err());
-
1.23.0 · source

pub fn is_ascii(&self) -> bool

Checks if all characters in this string are within the ASCII range.

+
1.23.0 · source

pub fn is_ascii(&self) -> bool

Checks if all characters in this string are within the ASCII range.

§Examples
let ascii = "hello!\n";
 let non_ascii = "Grüße, Jürgen ❤";
 
 assert!(ascii.is_ascii());
 assert!(!non_ascii.is_ascii());
-
source

pub fn as_ascii(&self) -> Option<&[AsciiChar]>

🔬This is a nightly-only experimental API. (ascii_char)

If this string slice is_ascii, returns it as a slice +

source

pub fn as_ascii(&self) -> Option<&[AsciiChar]>

🔬This is a nightly-only experimental API. (ascii_char)

If this string slice is_ascii, returns it as a slice of ASCII characters, otherwise returns None.

-
1.23.0 · source

pub fn eq_ignore_ascii_case(&self, other: &str) -> bool

Checks that two strings are an ASCII case-insensitive match.

+
1.23.0 · source

pub fn eq_ignore_ascii_case(&self, other: &str) -> bool

Checks that two strings are an ASCII case-insensitive match.

Same as to_ascii_lowercase(a) == to_ascii_lowercase(b), but without allocating and copying temporaries.

§Examples
assert!("Ferris".eq_ignore_ascii_case("FERRIS"));
 assert!("Ferrös".eq_ignore_ascii_case("FERRöS"));
 assert!(!"Ferrös".eq_ignore_ascii_case("FERRÖS"));
-
source

pub fn trim_ascii_start(&self) -> &str

🔬This is a nightly-only experimental API. (byte_slice_trim_ascii)

Returns a string slice with leading ASCII whitespace removed.

+
source

pub fn trim_ascii_start(&self) -> &str

🔬This is a nightly-only experimental API. (byte_slice_trim_ascii)

Returns a string slice with leading ASCII whitespace removed.

‘Whitespace’ refers to the definition used by u8::is_ascii_whitespace.

§Examples
@@ -1032,7 +1032,7 @@
§Examplesassert_eq!(" \t \u{3000}hello world\n".trim_ascii_start(), "\u{3000}hello world\n"); assert_eq!(" ".trim_ascii_start(), ""); assert_eq!("".trim_ascii_start(), "");
-
source

pub fn trim_ascii_end(&self) -> &str

🔬This is a nightly-only experimental API. (byte_slice_trim_ascii)

Returns a string slice with trailing ASCII whitespace removed.

+
source

pub fn trim_ascii_end(&self) -> &str

🔬This is a nightly-only experimental API. (byte_slice_trim_ascii)

Returns a string slice with trailing ASCII whitespace removed.

‘Whitespace’ refers to the definition used by u8::is_ascii_whitespace.

§Examples
@@ -1041,7 +1041,7 @@
§Examplesassert_eq!("\r hello world\u{3000}\n ".trim_ascii_end(), "\r hello world\u{3000}"); assert_eq!(" ".trim_ascii_end(), ""); assert_eq!("".trim_ascii_end(), "");
-
source

pub fn trim_ascii(&self) -> &str

🔬This is a nightly-only experimental API. (byte_slice_trim_ascii)

Returns a string slice with leading and trailing ASCII whitespace +

source

pub fn trim_ascii(&self) -> &str

🔬This is a nightly-only experimental API. (byte_slice_trim_ascii)

Returns a string slice with leading and trailing ASCII whitespace removed.

‘Whitespace’ refers to the definition used by u8::is_ascii_whitespace.

@@ -1051,7 +1051,7 @@
§Examplesassert_eq!("\r hello world\n ".trim_ascii(), "hello world"); assert_eq!(" ".trim_ascii(), ""); assert_eq!("".trim_ascii(), "");
-
1.34.0 · source

pub fn escape_debug(&self) -> EscapeDebug<'_>

Return an iterator that escapes each char in self with char::escape_debug.

+
1.34.0 · source

pub fn escape_debug(&self) -> EscapeDebug<'_>

Return an iterator that escapes each char in self with char::escape_debug.

Note: only extended grapheme codepoints that begin the string will be escaped.

§Examples
@@ -1070,7 +1070,7 @@
§ExamplesUsing to_string:

assert_eq!("❤\n!".escape_debug().to_string(), "❤\\n!");
-
1.34.0 · source

pub fn escape_default(&self) -> EscapeDefault<'_>

Return an iterator that escapes each char in self with char::escape_default.

+
1.34.0 · source

pub fn escape_default(&self) -> EscapeDefault<'_>

Return an iterator that escapes each char in self with char::escape_default.

§Examples

As an iterator:

@@ -1087,7 +1087,7 @@
§ExamplesUsing to_string:

assert_eq!("❤\n!".escape_default().to_string(), "\\u{2764}\\n!");
-
1.34.0 · source

pub fn escape_unicode(&self) -> EscapeUnicode<'_>

Return an iterator that escapes each char in self with char::escape_unicode.

+
1.34.0 · source

pub fn escape_unicode(&self) -> EscapeUnicode<'_>

Return an iterator that escapes each char in self with char::escape_unicode.

§Examples

As an iterator:

@@ -1104,7 +1104,7 @@
§ExamplesUsing to_string:

assert_eq!("❤\n!".escape_unicode().to_string(), "\\u{2764}\\u{a}\\u{21}");
-
1.0.0 · source

pub fn replace<'a, P>(&'a self, from: P, to: &str) -> String
where +

1.0.0 · source

pub fn replace<'a, P>(&'a self, from: P, to: &str) -> String
where P: Pattern<'a>,

Replaces all matches of a pattern with another string.

replace creates a new String, and copies the data from this string slice into it. While doing so, it attempts to find matches of a pattern. If it finds any, it @@ -1120,7 +1120,7 @@

§Examples
let s = "this is old";
 assert_eq!(s, s.replace("cookie monster", "little lamb"));
-
1.16.0 · source

pub fn replacen<'a, P>(&'a self, pat: P, to: &str, count: usize) -> String
where +

1.16.0 · source

pub fn replacen<'a, P>(&'a self, pat: P, to: &str, count: usize) -> String
where P: Pattern<'a>,

Replaces first N matches of a pattern with another string.

replacen creates a new String, and copies the data from this string slice into it. While doing so, it attempts to find matches of a pattern. If it finds any, it @@ -1136,7 +1136,7 @@

§Examples
let s = "this is old";
 assert_eq!(s, s.replacen("cookie monster", "little lamb", 10));
-
1.2.0 · source

pub fn to_lowercase(&self) -> String

Returns the lowercase equivalent of this string slice, as a new String.

+
1.2.0 · source

pub fn to_lowercase(&self) -> String

Returns the lowercase equivalent of this string slice, as a new String.

‘Lowercase’ is defined according to the terms of the Unicode Derived Core Property Lowercase.

Since some characters can expand into multiple characters when changing @@ -1163,7 +1163,7 @@

§Examples
let new_year = "农历新年";
 
 assert_eq!(new_year, new_year.to_lowercase());
-
1.2.0 · source

pub fn to_uppercase(&self) -> String

Returns the uppercase equivalent of this string slice, as a new String.

+
1.2.0 · source

pub fn to_uppercase(&self) -> String

Returns the uppercase equivalent of this string slice, as a new String.

‘Uppercase’ is defined according to the terms of the Unicode Derived Core Property Uppercase.

Since some characters can expand into multiple characters when changing @@ -1185,7 +1185,7 @@

§Examples
let s = "tschüß";
 
 assert_eq!("TSCHÜSS", s.to_uppercase());
-
1.16.0 · source

pub fn repeat(&self, n: usize) -> String

Creates a new String by repeating a string n times.

+
1.16.0 · source

pub fn repeat(&self, n: usize) -> String

Creates a new String by repeating a string n times.

§Panics

This function will panic if the capacity would overflow.

§Examples
@@ -1196,7 +1196,7 @@
§Examples
// this will panic at runtime
 let huge = "0123456789abcdef".repeat(usize::MAX);
-
1.23.0 · source

pub fn to_ascii_uppercase(&self) -> String

Returns a copy of this string where each character is mapped to its +

1.23.0 · source

pub fn to_ascii_uppercase(&self) -> String

Returns a copy of this string where each character is mapped to its ASCII upper case equivalent.

ASCII letters ‘a’ to ‘z’ are mapped to ‘A’ to ‘Z’, but non-ASCII letters are unchanged.

@@ -1207,7 +1207,7 @@
§Examples
let s = "Grüße, Jürgen ❤";
 
 assert_eq!("GRüßE, JüRGEN ❤", s.to_ascii_uppercase());
-
1.23.0 · source

pub fn to_ascii_lowercase(&self) -> String

Returns a copy of this string where each character is mapped to its +

1.23.0 · source

pub fn to_ascii_lowercase(&self) -> String

Returns a copy of this string where each character is mapped to its ASCII lower case equivalent.

ASCII letters ‘A’ to ‘Z’ are mapped to ‘a’ to ‘z’, but non-ASCII letters are unchanged.

@@ -1218,14 +1218,14 @@
§Examples
let s = "Grüße, Jürgen ❤";
 
 assert_eq!("grüße, jürgen ❤", s.to_ascii_lowercase());
-

Trait Implementations§

source§

impl AsRef<str> for AttributeValue

source§

fn as_ref(&self) -> &str

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl Clone for AttributeValue

source§

fn clone(&self) -> AttributeValue

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for AttributeValue

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Deref for AttributeValue

§

type Target = str

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl<'de> Deserialize<'de> for AttributeValue

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where - __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Drop for AttributeValue

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl<S: ToString> From<S> for AttributeValue

source§

fn from(value: S) -> Self

Converts to this type from the input type.
source§

impl Serialize for AttributeValue

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where - __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl Type for AttributeValue

source§

fn signature() -> Signature<'static>

Get the signature for the implementing type. Read more
source§

impl Zeroize for AttributeValue

source§

fn zeroize(&mut self)

Zero out this object from memory using Rust intrinsics which ensure the +

Trait Implementations§

source§

impl AsRef<str> for AttributeValue

source§

fn as_ref(&self) -> &str

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl Clone for AttributeValue

source§

fn clone(&self) -> AttributeValue

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for AttributeValue

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Deref for AttributeValue

§

type Target = str

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl<'de> Deserialize<'de> for AttributeValue

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where + __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Drop for AttributeValue

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl<S: ToString> From<S> for AttributeValue

source§

fn from(value: S) -> Self

Converts to this type from the input type.
source§

impl Serialize for AttributeValue

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where + __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl Type for AttributeValue

source§

fn signature() -> Signature<'static>

Get the signature for the implementing type. Read more
source§

impl Zeroize for AttributeValue

source§

fn zeroize(&mut self)

Zero out this object from memory using Rust intrinsics which ensure the zeroization operation is not “optimized away” by the compiler.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<'de, T> DynamicDeserialize<'de> for T
where - T: Type + Deserialize<'de> + ?Sized,

§

type Deserializer = PhantomData<T>

A DeserializeSeed implementation for this type.
§

fn deserializer_for_signature<S>( + T: Type + Deserialize<'de> + ?Sized,

§

type Deserializer = PhantomData<T>

A DeserializeSeed implementation for this type.
§

fn deserializer_for_signature<S>( signature: S ) -> Result<<T as DynamicDeserialize<'de>>::Deserializer, Error>
where S: TryInto<Signature<'de>>, @@ -1244,5 +1244,5 @@
§Examples

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a -[WithDispatch] wrapper. Read more
source§

impl<T> DeserializeOwned for T
where - T: for<'de> Deserialize<'de>,

\ No newline at end of file +[WithDispatch] wrapper. Read more
source§

impl<T> DeserializeOwned for T
where + T: for<'de> Deserialize<'de>,

\ No newline at end of file diff --git a/oo7/portal/api/struct.Keyring.html b/oo7/portal/api/struct.Keyring.html index bb6113503..8087c4282 100644 --- a/oo7/portal/api/struct.Keyring.html +++ b/oo7/portal/api/struct.Keyring.html @@ -1,4 +1,4 @@ -Keyring in oo7::portal::api - Rust +Keyring in oo7::portal::api - Rust

Struct oo7::portal::api::Keyring

source ·
pub struct Keyring { /* private fields */ }
Available on crate feature unstable only.
Expand description

Logical contents of a keyring file

Implementations§

source§

impl Keyring

source

pub fn key_strength(&self, secret: &[u8]) -> Result<(), WeakKeyError>

source

pub async fn dump( &mut self, @@ -17,13 +17,13 @@ &mut self, attributes: &HashMap<impl AsRef<str>, impl AsRef<str>>, key: &Key -) -> Result<(), Error>

source

pub fn default_path() -> Result<PathBuf, Error>

source

pub fn derive_key(&self, secret: &Secret) -> Key

Trait Implementations§

source§

impl Debug for Keyring

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for Keyring

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where - __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Serialize for Keyring

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where - __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl TryFrom<&[u8]> for Keyring

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(value: &[u8]) -> Result<Self, Error>

Performs the conversion.
source§

impl Type for Keyring

source§

fn signature() -> Signature<'static>

Get the signature for the implementing type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where +) -> Result<(), Error>

source

pub fn default_path() -> Result<PathBuf, Error>

source

pub fn derive_key(&self, secret: &Secret) -> Key

Trait Implementations§

source§

impl Debug for Keyring

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for Keyring

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where + __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Serialize for Keyring

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where + __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl TryFrom<&[u8]> for Keyring

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(value: &[u8]) -> Result<Self, Error>

Performs the conversion.
source§

impl Type for Keyring

source§

fn signature() -> Signature<'static>

Get the signature for the implementing type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<'de, T> DynamicDeserialize<'de> for T
where - T: Type + Deserialize<'de> + ?Sized,

§

type Deserializer = PhantomData<T>

A DeserializeSeed implementation for this type.
§

fn deserializer_for_signature<S>( + T: Type + Deserialize<'de> + ?Sized,

§

type Deserializer = PhantomData<T>

A DeserializeSeed implementation for this type.
§

fn deserializer_for_signature<S>( signature: S ) -> Result<<T as DynamicDeserialize<'de>>::Deserializer, Error>
where S: TryInto<Signature<'de>>, @@ -41,5 +41,5 @@ V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a -[WithDispatch] wrapper. Read more
source§

impl<T> DeserializeOwned for T
where - T: for<'de> Deserialize<'de>,

\ No newline at end of file +[WithDispatch] wrapper. Read more
source§

impl<T> DeserializeOwned for T
where + T: for<'de> Deserialize<'de>,

\ No newline at end of file diff --git a/oo7/portal/enum.Error.html b/oo7/portal/enum.Error.html index 1f0615c14..6cb12eb06 100644 --- a/oo7/portal/enum.Error.html +++ b/oo7/portal/enum.Error.html @@ -1,4 +1,4 @@ -Error in oo7::portal - Rust +Error in oo7::portal - Rust

Enum oo7::portal::Error

source ·
pub enum Error {
 
Show 16 variants FileHeaderMismatch(Option<String>), VersionMismatch(Option<Vec<u8>>), @@ -35,7 +35,7 @@ Can happen if the host has an old xdg-desktop-portal or no secret service is available to store the secret.

§

InvalidItemIndex(usize)

The addressed index does not exist.

-

Trait Implementations§

source§

impl Debug for Error

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for Error

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for Error

1.30.0 · source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
source§

impl From<Error> for Error

source§

fn from(value: Error) -> Self

Converts to this type from the input type.
source§

impl From<Error> for Error

source§

fn from(value: Error) -> Self

Converts to this type from the input type.
source§

impl From<Error> for Error

source§

fn from(e: Error) -> Self

Converts to this type from the input type.
source§

impl From<Error> for Error

source§

fn from(value: Error) -> Self

Converts to this type from the input type.
source§

impl From<WeakKeyError> for Error

source§

fn from(value: WeakKeyError) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl !RefUnwindSafe for Error

§

impl Send for Error

§

impl Sync for Error

§

impl Unpin for Error

§

impl !UnwindSafe for Error

Blanket Implementations§

source§

impl<T> Any for T
where +

Trait Implementations§

source§

impl Debug for Error

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for Error

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for Error

1.30.0 · source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
source§

impl From<Error> for Error

source§

fn from(value: Error) -> Self

Converts to this type from the input type.
source§

impl From<Error> for Error

source§

fn from(e: Error) -> Self

Converts to this type from the input type.
source§

impl From<Error> for Error

source§

fn from(value: Error) -> Self

Converts to this type from the input type.
source§

impl From<Error> for Error

source§

fn from(value: Error) -> Self

Converts to this type from the input type.
source§

impl From<WeakKeyError> for Error

source§

fn from(value: WeakKeyError) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl !RefUnwindSafe for Error

§

impl Send for Error

§

impl Sync for Error

§

impl Unpin for Error

§

impl !UnwindSafe for Error

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

diff --git a/oo7/portal/enum.WeakKeyError.html b/oo7/portal/enum.WeakKeyError.html index 96e1466b9..377cca188 100644 --- a/oo7/portal/enum.WeakKeyError.html +++ b/oo7/portal/enum.WeakKeyError.html @@ -1,4 +1,4 @@ -WeakKeyError in oo7::portal - Rust +WeakKeyError in oo7::portal - Rust

Enum oo7::portal::WeakKeyError

source ·
pub enum WeakKeyError {
     IterationCountTooLow(u32),
     SaltTooShort(usize),
@@ -11,7 +11,7 @@
 
§

StrengthUnknown

Should not occur

Used by dbus module that does not currently check key strength.

-

Trait Implementations§

source§

impl Clone for WeakKeyError

source§

fn clone(&self) -> WeakKeyError

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for WeakKeyError

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for WeakKeyError

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for WeakKeyError

1.30.0 · source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
source§

impl From<WeakKeyError> for Error

source§

fn from(value: WeakKeyError) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where +

Trait Implementations§

source§

impl Clone for WeakKeyError

source§

fn clone(&self) -> WeakKeyError

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for WeakKeyError

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for WeakKeyError

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for WeakKeyError

1.30.0 · source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
source§

impl From<WeakKeyError> for Error

source§

fn from(value: WeakKeyError) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

diff --git a/oo7/portal/index.html b/oo7/portal/index.html index 3b7dde91b..c34673789 100644 --- a/oo7/portal/index.html +++ b/oo7/portal/index.html @@ -1,4 +1,4 @@ -oo7::portal - Rust +oo7::portal - Rust

Module oo7::portal

source ·
Expand description

File backend implementation backed by the Secret portal.

use std::collections::HashMap;
diff --git a/oo7/portal/struct.InvalidItemError.html b/oo7/portal/struct.InvalidItemError.html
index d50352ef6..de72f2e06 100644
--- a/oo7/portal/struct.InvalidItemError.html
+++ b/oo7/portal/struct.InvalidItemError.html
@@ -1,7 +1,7 @@
-InvalidItemError in oo7::portal - Rust
+InvalidItemError in oo7::portal - Rust
     
pub struct InvalidItemError { /* private fields */ }
Expand description

All information that is available about an invalid (not decryptable) Item

-

Trait Implementations§

source§

impl Debug for InvalidItemError

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for InvalidItemError

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for InvalidItemError

1.30.0 · source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where +

Trait Implementations§

source§

impl Debug for InvalidItemError

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for InvalidItemError

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for InvalidItemError

1.30.0 · source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

diff --git a/oo7/portal/struct.Item.html b/oo7/portal/struct.Item.html index 8fe5b1240..03d0cae7b 100644 --- a/oo7/portal/struct.Item.html +++ b/oo7/portal/struct.Item.html @@ -1,4 +1,4 @@ -Item in oo7::portal - Rust +Item in oo7::portal - Rust

Struct oo7::portal::Item

source ·
pub struct Item { /* private fields */ }
Expand description

An item stored in the file backend.

Implementations§

source§

impl Item

source

pub fn attributes(&self) -> &HashMap<String, AttributeValue>

Retrieve the item attributes.

source

pub fn set_attributes(&mut self, attributes: HashMap<&str, &str>)

Update the item attributes.

@@ -8,14 +8,14 @@
source

pub fn set_secret(&mut self, secret: impl AsRef<[u8]>)

Store a new secret.

source

pub fn created(&self) -> Duration

The UNIX time when the item was created.

source

pub fn modified(&self) -> Duration

The UNIX time when the item was modified.

-

Trait Implementations§

source§

impl Clone for Item

source§

fn clone(&self) -> Item

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Item

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for Item

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where - __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Drop for Item

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl Serialize for Item

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where - __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl TryFrom<&[u8]> for Item

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(value: &[u8]) -> Result<Self, Error>

Performs the conversion.
source§

impl Type for Item

source§

fn signature() -> Signature<'static>

Get the signature for the implementing type. Read more
source§

impl Zeroize for Item

source§

fn zeroize(&mut self)

Zero out this object from memory using Rust intrinsics which ensure the +

Trait Implementations§

source§

impl Clone for Item

source§

fn clone(&self) -> Item

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Item

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for Item

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where + __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Drop for Item

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl Serialize for Item

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where + __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl TryFrom<&[u8]> for Item

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(value: &[u8]) -> Result<Self, Error>

Performs the conversion.
source§

impl Type for Item

source§

fn signature() -> Signature<'static>

Get the signature for the implementing type. Read more
source§

impl Zeroize for Item

source§

fn zeroize(&mut self)

Zero out this object from memory using Rust intrinsics which ensure the zeroization operation is not “optimized away” by the compiler.

Auto Trait Implementations§

§

impl RefUnwindSafe for Item

§

impl Send for Item

§

impl Sync for Item

§

impl Unpin for Item

§

impl UnwindSafe for Item

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<'de, T> DynamicDeserialize<'de> for T
where - T: Type + Deserialize<'de> + ?Sized,

§

type Deserializer = PhantomData<T>

A DeserializeSeed implementation for this type.
§

fn deserializer_for_signature<S>( + T: Type + Deserialize<'de> + ?Sized,

§

type Deserializer = PhantomData<T>

A DeserializeSeed implementation for this type.
§

fn deserializer_for_signature<S>( signature: S ) -> Result<<T as DynamicDeserialize<'de>>::Deserializer, Error>
where S: TryInto<Signature<'de>>, @@ -34,5 +34,5 @@ V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a -[WithDispatch] wrapper. Read more
source§

impl<T> DeserializeOwned for T
where - T: for<'de> Deserialize<'de>,

\ No newline at end of file +[WithDispatch] wrapper. Read more
source§

impl<T> DeserializeOwned for T
where + T: for<'de> Deserialize<'de>,

\ No newline at end of file diff --git a/oo7/portal/struct.Keyring.html b/oo7/portal/struct.Keyring.html index bfc72d4b7..fe80101cd 100644 --- a/oo7/portal/struct.Keyring.html +++ b/oo7/portal/struct.Keyring.html @@ -1,4 +1,4 @@ -Keyring in oo7::portal - Rust +Keyring in oo7::portal - Rust

Struct oo7::portal::Keyring

source ·
pub struct Keyring { /* private fields */ }
Expand description

File backed keyring.

Implementations§

source§

impl Keyring

source

pub async fn load_default() -> Result<Self, Error>

Load from default keyring file

source

pub async fn load(path: impl AsRef<Path>, secret: Secret) -> Result<Self, Error>

Load from a keyring file.

diff --git a/oo7/portal/struct.Secret.html b/oo7/portal/struct.Secret.html index 7ad915d28..995d34252 100644 --- a/oo7/portal/struct.Secret.html +++ b/oo7/portal/struct.Secret.html @@ -1,11 +1,11 @@ -Secret in oo7::portal - Rust +Secret in oo7::portal - Rust

Struct oo7::portal::Secret

source ·
pub struct Secret { /* private fields */ }
Expand description

Secret retrieved from the XDG secret portal.

This secret is generated by the portal once per app. It is provided such that apps can store encrypted data with a key based on this secret.

We use this secret to encrypt the app’s Keyring.

-

Methods from Deref<Target = [u8]>§

source

pub fn flatten(&self) -> &[T]

🔬This is a nightly-only experimental API. (slice_flatten)

Takes a &[[T; N]], and flattens it to a &[T].

+

Methods from Deref<Target = [u8]>§

source

pub fn flatten(&self) -> &[T]

🔬This is a nightly-only experimental API. (slice_flatten)

Takes a &[[T; N]], and flattens it to a &[T].

§Panics

This panics if the length of the resulting slice would overflow a usize.

This is only possible when flattening a slice of arrays of zero-sized @@ -26,70 +26,23 @@

§Examples
let empty_slice_of_arrays: &[[u32; 10]] = &[]; assert!(empty_slice_of_arrays.flatten().is_empty());
-
source

pub fn as_str(&self) -> &str

🔬This is a nightly-only experimental API. (ascii_char)

Views this slice of ASCII characters as a UTF-8 str.

-
source

pub fn as_bytes(&self) -> &[u8]

🔬This is a nightly-only experimental API. (ascii_char)

Views this slice of ASCII characters as a slice of u8 bytes.

-
1.23.0 · source

pub fn is_ascii(&self) -> bool

Checks if all bytes in this slice are within the ASCII range.

-
source

pub fn as_ascii(&self) -> Option<&[AsciiChar]>

🔬This is a nightly-only experimental API. (ascii_char)

If this slice is_ascii, returns it as a slice of -ASCII characters, otherwise returns None.

-
source

pub unsafe fn as_ascii_unchecked(&self) -> &[AsciiChar]

🔬This is a nightly-only experimental API. (ascii_char)

Converts this slice of bytes into a slice of ASCII characters, -without checking whether they’re valid.

-
§Safety
-

Every byte in the slice must be in 0..=127, or else this is UB.

-
1.23.0 · source

pub fn eq_ignore_ascii_case(&self, other: &[u8]) -> bool

Checks that two slices are an ASCII case-insensitive match.

-

Same as to_ascii_lowercase(a) == to_ascii_lowercase(b), -but without allocating and copying temporaries.

-
1.60.0 · source

pub fn escape_ascii(&self) -> EscapeAscii<'_>

Returns an iterator that produces an escaped version of this slice, -treating it as an ASCII string.

-
§Examples
-

-let s = b"0\t\r\n'\"\\\x9d";
-let escaped = s.escape_ascii().to_string();
-assert_eq!(escaped, "0\\t\\r\\n\\'\\\"\\\\\\x9d");
-
source

pub fn trim_ascii_start(&self) -> &[u8]

🔬This is a nightly-only experimental API. (byte_slice_trim_ascii)

Returns a byte slice with leading ASCII whitespace bytes removed.

-

‘Whitespace’ refers to the definition used by -u8::is_ascii_whitespace.

-
§Examples
-
#![feature(byte_slice_trim_ascii)]
-
-assert_eq!(b" \t hello world\n".trim_ascii_start(), b"hello world\n");
-assert_eq!(b"  ".trim_ascii_start(), b"");
-assert_eq!(b"".trim_ascii_start(), b"");
-
source

pub fn trim_ascii_end(&self) -> &[u8]

🔬This is a nightly-only experimental API. (byte_slice_trim_ascii)

Returns a byte slice with trailing ASCII whitespace bytes removed.

-

‘Whitespace’ refers to the definition used by -u8::is_ascii_whitespace.

-
§Examples
-
#![feature(byte_slice_trim_ascii)]
-
-assert_eq!(b"\r hello world\n ".trim_ascii_end(), b"\r hello world");
-assert_eq!(b"  ".trim_ascii_end(), b"");
-assert_eq!(b"".trim_ascii_end(), b"");
-
source

pub fn trim_ascii(&self) -> &[u8]

🔬This is a nightly-only experimental API. (byte_slice_trim_ascii)

Returns a byte slice with leading and trailing ASCII whitespace bytes -removed.

-

‘Whitespace’ refers to the definition used by -u8::is_ascii_whitespace.

-
§Examples
-
#![feature(byte_slice_trim_ascii)]
-
-assert_eq!(b"\r hello world\n ".trim_ascii(), b"hello world");
-assert_eq!(b"  ".trim_ascii(), b"");
-assert_eq!(b"".trim_ascii(), b"");
1.0.0 · source

pub fn len(&self) -> usize

Returns the number of elements in the slice.

-
§Examples
+
§Examples
let a = [1, 2, 3];
 assert_eq!(a.len(), 3);
1.0.0 · source

pub fn is_empty(&self) -> bool

Returns true if the slice has a length of 0.

-
§Examples
+
§Examples
let a = [1, 2, 3];
 assert!(!a.is_empty());
1.0.0 · source

pub fn first(&self) -> Option<&T>

Returns the first element of the slice, or None if it is empty.

-
§Examples
+
§Examples
let v = [10, 40, 30];
 assert_eq!(Some(&10), v.first());
 
 let w: &[i32] = &[];
 assert_eq!(None, w.first());
1.5.0 · source

pub fn split_first(&self) -> Option<(&T, &[T])>

Returns the first and all the rest of the elements of the slice, or None if it is empty.

-
§Examples
+
§Examples
let x = &[0, 1, 2];
 
 if let Some((first, elements)) = x.split_first() {
@@ -97,7 +50,7 @@ 
§Examples
assert_eq!(elements, &[1, 2]); }
1.5.0 · source

pub fn split_last(&self) -> Option<(&T, &[T])>

Returns the last and all the rest of the elements of the slice, or None if it is empty.

-
§Examples
+
§Examples
let x = &[0, 1, 2];
 
 if let Some((last, elements)) = x.split_last() {
@@ -105,15 +58,15 @@ 
§Examples
assert_eq!(elements, &[0, 1]); }
1.0.0 · source

pub fn last(&self) -> Option<&T>

Returns the last element of the slice, or None if it is empty.

-
§Examples
+
§Examples
let v = [10, 40, 30];
 assert_eq!(Some(&30), v.last());
 
 let w: &[i32] = &[];
 assert_eq!(None, w.last());
-
1.77.0 · source

pub fn first_chunk<const N: usize>(&self) -> Option<&[T; N]>

Return an array reference to the first N items in the slice.

+
1.78.0 · source

pub fn first_chunk<const N: usize>(&self) -> Option<&[T; N]>

Return an array reference to the first N items in the slice.

If the slice is not at least N in length, this will return None.

-
§Examples
+
§Examples
let u = [10, 40, 30];
 assert_eq!(Some(&[10, 40]), u.first_chunk::<2>());
 
@@ -122,9 +75,9 @@ 
§Exampleslet w: &[i32] = &[]; assert_eq!(Some(&[]), w.first_chunk::<0>());
-
1.77.0 · source

pub fn split_first_chunk<const N: usize>(&self) -> Option<(&[T; N], &[T])>

Return an array reference to the first N items in the slice and the remaining slice.

+
1.78.0 · source

pub fn split_first_chunk<const N: usize>(&self) -> Option<(&[T; N], &[T])>

Return an array reference to the first N items in the slice and the remaining slice.

If the slice is not at least N in length, this will return None.

-
§Examples
+
§Examples
let x = &[0, 1, 2];
 
 if let Some((first, elements)) = x.split_first_chunk::<2>() {
@@ -133,9 +86,9 @@ 
§Examplesassert_eq!(None, x.split_first_chunk::<4>());
-
1.77.0 · source

pub fn split_last_chunk<const N: usize>(&self) -> Option<(&[T], &[T; N])>

Return an array reference to the last N items in the slice and the remaining slice.

+
1.78.0 · source

pub fn split_last_chunk<const N: usize>(&self) -> Option<(&[T], &[T; N])>

Return an array reference to the last N items in the slice and the remaining slice.

If the slice is not at least N in length, this will return None.

-
§Examples
+
§Examples
let x = &[0, 1, 2];
 
 if let Some((elements, last)) = x.split_last_chunk::<2>() {
@@ -144,9 +97,9 @@ 
§Examplesassert_eq!(None, x.split_last_chunk::<4>());
-
1.77.0 · source

pub fn last_chunk<const N: usize>(&self) -> Option<&[T; N]>

Return an array reference to the last N items in the slice.

+
1.78.0 · source

pub fn last_chunk<const N: usize>(&self) -> Option<&[T; N]>

Return an array reference to the last N items in the slice.

If the slice is not at least N in length, this will return None.

-
§Examples
+
§Examples
let u = [10, 40, 30];
 assert_eq!(Some(&[40, 30]), u.last_chunk::<2>());
 
@@ -164,7 +117,7 @@ 
§ExamplesIf given a range, returns the subslice corresponding to that range, or None if out of bounds. -
§Examples
+
§Examples
let v = [10, 40, 30];
 assert_eq!(Some(&40), v.get(1));
 assert_eq!(Some(&[10, 40][..]), v.get(0..2));
@@ -177,14 +130,14 @@ 
§ExamplesSliceIndex<[T]>,

Returns a reference to an element or subslice, without doing bounds checking.

For a safe alternative see get.

-
§Safety
+
§Safety

Calling this method with an out-of-bounds index is undefined behavior even if the resulting reference is not used.

You can think of this like .get(index).unwrap_unchecked(). It’s UB to call .get_unchecked(len), even if you immediately convert to a pointer. And it’s UB to call .get_unchecked(..len + 1), .get_unchecked(..=len), or similar.

-
§Examples
+
§Examples
let x = &[1, 2, 4];
 
 unsafe {
@@ -198,7 +151,7 @@ 
§Examplesas_mut_ptr.

Modifying the container referenced by this slice may cause its buffer to be reallocated, which would also make any pointers to it invalid.

-
§Examples
+
§Examples
let x = &[1, 2, 4];
 let x_ptr = x.as_ptr();
 
@@ -229,7 +182,7 @@ 
§Examplesassert!(!a.as_ptr_range().contains(&y));
1.0.0 · source

pub fn iter(&self) -> Iter<'_, T>

Returns an iterator over the slice.

The iterator yields all items from start to end.

-
§Examples
+
§Examples
let x = &[1, 2, 4];
 let mut iterator = x.iter();
 
@@ -242,7 +195,7 @@ 
§Examplessize, the iterator returns no values.

§Panics

Panics if size is 0.

-
§Examples
+
§Examples
let slice = ['l', 'o', 'r', 'e', 'm'];
 let mut iter = slice.windows(3);
 assert_eq!(iter.next().unwrap(), &['l', 'o', 'r']);
@@ -277,7 +230,7 @@ 
§Examples
§Panics

Panics if chunk_size is 0.

-
§Examples
+
§Examples
let slice = ['l', 'o', 'r', 'e', 'm'];
 let mut iter = slice.chunks(2);
 assert_eq!(iter.next().unwrap(), &['l', 'o']);
@@ -295,7 +248,7 @@ 
§Examplesrchunks_exact for the same iterator but starting at the end of the slice.

§Panics

Panics if chunk_size is 0.

-
§Examples
+
§Examples
let slice = ['l', 'o', 'r', 'e', 'm'];
 let mut iter = slice.chunks_exact(2);
 assert_eq!(iter.next().unwrap(), &['l', 'o']);
@@ -304,13 +257,13 @@ 
§Examplesassert_eq!(iter.remainder(), &['m']);
source

pub unsafe fn as_chunks_unchecked<const N: usize>(&self) -> &[[T; N]]

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, assuming that there’s no remainder.

-
§Safety
+
§Safety

This may only be called when

  • The slice splits exactly into N-element chunks (aka self.len() % N == 0).
  • N != 0.
-
§Examples
+
§Examples
#![feature(slice_as_chunks)]
 let slice: &[char] = &['l', 'o', 'r', 'e', 'm', '!'];
 let chunks: &[[char; 1]] =
@@ -331,7 +284,7 @@ 
§Examples§Panics

Panics if N is 0. This check will most probably get changed to a compile time error before this method gets stabilized.

-
§Examples
+
§Examples
#![feature(slice_as_chunks)]
 let slice = ['l', 'o', 'r', 'e', 'm'];
 let (chunks, remainder) = slice.as_chunks();
@@ -352,7 +305,7 @@ 
§Examples§Panics

Panics if N is 0. This check will most probably get changed to a compile time error before this method gets stabilized.

-
§Examples
+
§Examples
#![feature(slice_as_chunks)]
 let slice = ['l', 'o', 'r', 'e', 'm'];
 let (remainder, chunks) = slice.as_rchunks();
@@ -367,7 +320,7 @@ 
§Examples§Panics

Panics if N is 0. This check will most probably get changed to a compile time error before this method gets stabilized.

-
§Examples
+
§Examples
#![feature(array_chunks)]
 let slice = ['l', 'o', 'r', 'e', 'm'];
 let mut iter = slice.array_chunks();
@@ -382,7 +335,7 @@ 
§Examples§Panics

Panics if N is 0. This check will most probably get changed to a compile time error before this method gets stabilized.

-
§Examples
+
§Examples
#![feature(array_windows)]
 let slice = [0, 1, 2, 3];
 let mut iter = slice.array_windows();
@@ -399,7 +352,7 @@ 
§Examples
§Panics

Panics if chunk_size is 0.

-
§Examples
+
§Examples
let slice = ['l', 'o', 'r', 'e', 'm'];
 let mut iter = slice.rchunks(2);
 assert_eq!(iter.next().unwrap(), &['e', 'm']);
@@ -418,25 +371,23 @@ 
§Examples
§Panics

Panics if chunk_size is 0.

-
§Examples
+
§Examples
let slice = ['l', 'o', 'r', 'e', 'm'];
 let mut iter = slice.rchunks_exact(2);
 assert_eq!(iter.next().unwrap(), &['e', 'm']);
 assert_eq!(iter.next().unwrap(), &['o', 'r']);
 assert!(iter.next().is_none());
 assert_eq!(iter.remainder(), &['l']);
-
source

pub fn group_by<F>(&self, pred: F) -> GroupBy<'_, T, F>
where - F: FnMut(&T, &T) -> bool,

🔬This is a nightly-only experimental API. (slice_group_by)

Returns an iterator over the slice producing non-overlapping runs +

1.78.0 · source

pub fn chunk_by<F>(&self, pred: F) -> ChunkBy<'_, T, F>
where + F: FnMut(&T, &T) -> bool,

Returns an iterator over the slice producing non-overlapping runs of elements using the predicate to separate them.

-

The predicate is called on two elements following themselves, -it means the predicate is called on slice[0] and slice[1] -then on slice[1] and slice[2] and so on.

-
§Examples
-
#![feature(slice_group_by)]
-
-let slice = &[1, 1, 1, 3, 3, 2, 2, 2];
+

The predicate is called for every pair of consecutive elements, +meaning that it is called on slice[0] and slice[1], +followed by slice[1] and slice[2], and so on.

+
§Examples
+
let slice = &[1, 1, 1, 3, 3, 2, 2, 2];
 
-let mut iter = slice.group_by(|a, b| a == b);
+let mut iter = slice.chunk_by(|a, b| a == b);
 
 assert_eq!(iter.next(), Some(&[1, 1, 1][..]));
 assert_eq!(iter.next(), Some(&[3, 3][..]));
@@ -444,24 +395,22 @@ 
§Examplesassert_eq!(iter.next(), None);

This method can be used to extract the sorted subslices:

-
#![feature(slice_group_by)]
-
-let slice = &[1, 1, 2, 3, 2, 3, 2, 3, 4];
+
let slice = &[1, 1, 2, 3, 2, 3, 2, 3, 4];
 
-let mut iter = slice.group_by(|a, b| a <= b);
+let mut iter = slice.chunk_by(|a, b| a <= b);
 
 assert_eq!(iter.next(), Some(&[1, 1, 2, 3][..]));
 assert_eq!(iter.next(), Some(&[2, 3][..]));
 assert_eq!(iter.next(), Some(&[2, 3, 4][..]));
 assert_eq!(iter.next(), None);
-
1.0.0 · source

pub fn split_at(&self, mid: usize) -> (&[T], &[T])

Divides one slice into two at an index.

+
1.0.0 · source

pub fn split_at(&self, mid: usize) -> (&[T], &[T])

Divides one slice into two at an index.

The first will contain all indices from [0, mid) (excluding the index mid itself) and the second will contain all indices from [mid, len) (excluding the index len itself).

§Panics

Panics if mid > len. For a non-panicking alternative see split_at_checked.

-
§Examples
+
§Examples
let v = [1, 2, 3, 4, 5, 6];
 
 {
@@ -481,16 +430,16 @@ 
§Examplesassert_eq!(left, [1, 2, 3, 4, 5, 6]); assert_eq!(right, []); }
-
source

pub unsafe fn split_at_unchecked(&self, mid: usize) -> (&[T], &[T])

🔬This is a nightly-only experimental API. (slice_split_at_unchecked)

Divides one slice into two at an index, without doing bounds checking.

+
source

pub unsafe fn split_at_unchecked(&self, mid: usize) -> (&[T], &[T])

🔬This is a nightly-only experimental API. (slice_split_at_unchecked)

Divides one slice into two at an index, without doing bounds checking.

The first will contain all indices from [0, mid) (excluding the index mid itself) and the second will contain all indices from [mid, len) (excluding the index len itself).

For a safe alternative see split_at.

-
§Safety
+
§Safety

Calling this method with an out-of-bounds index is undefined behavior even if the resulting reference is not used. The caller has to ensure that 0 <= mid <= self.len().

-
§Examples
+
§Examples
#![feature(slice_split_at_unchecked)]
 
 let v = [1, 2, 3, 4, 5, 6];
@@ -512,14 +461,14 @@ 
§Examplesassert_eq!(left, [1, 2, 3, 4, 5, 6]); assert_eq!(right, []); }
-
source

pub fn split_at_checked(&self, mid: usize) -> Option<(&[T], &[T])>

🔬This is a nightly-only experimental API. (split_at_checked)

Divides one slice into two at an index, returning None if the slice is +

source

pub fn split_at_checked(&self, mid: usize) -> Option<(&[T], &[T])>

🔬This is a nightly-only experimental API. (split_at_checked)

Divides one slice into two at an index, returning None if the slice is too short.

If mid ≤ len returns a pair of slices where the first will contain all indices from [0, mid) (excluding the index mid itself) and the second will contain all indices from [mid, len) (excluding the index len itself).

Otherwise, if mid > len, returns None.

-
§Examples
+
§Examples
#![feature(split_at_checked)]
 
 let v = [1, -2, 3, -4, 5, -6];
@@ -543,10 +492,10 @@ 
§Examplesassert_eq!(None, v.split_at_checked(7));
-
1.0.0 · source

pub fn split<F>(&self, pred: F) -> Split<'_, T, F>
where +

1.0.0 · source

pub fn split<F>(&self, pred: F) -> Split<'_, T, F>
where F: FnMut(&T) -> bool,

Returns an iterator over subslices separated by elements that match pred. The matched element is not contained in the subslices.

-
§Examples
+
§Examples
let slice = [10, 40, 33, 20];
 let mut iter = slice.split(|num| num % 3 == 0);
 
@@ -574,11 +523,11 @@ 
§Examplesassert_eq!(iter.next().unwrap(), &[]); assert_eq!(iter.next().unwrap(), &[20]); assert!(iter.next().is_none());
-
1.51.0 · source

pub fn split_inclusive<F>(&self, pred: F) -> SplitInclusive<'_, T, F>
where +

1.51.0 · source

pub fn split_inclusive<F>(&self, pred: F) -> SplitInclusive<'_, T, F>
where F: FnMut(&T) -> bool,

Returns an iterator over subslices separated by elements that match pred. The matched element is contained in the end of the previous subslice as a terminator.

-
§Examples
+
§Examples
let slice = [10, 40, 33, 20];
 let mut iter = slice.split_inclusive(|num| num % 3 == 0);
 
@@ -595,11 +544,11 @@ 
§Examplesassert_eq!(iter.next().unwrap(), &[3]); assert_eq!(iter.next().unwrap(), &[10, 40, 33]); assert!(iter.next().is_none());
-
1.27.0 · source

pub fn rsplit<F>(&self, pred: F) -> RSplit<'_, T, F>
where +

1.27.0 · source

pub fn rsplit<F>(&self, pred: F) -> RSplit<'_, T, F>
where F: FnMut(&T) -> bool,

Returns an iterator over subslices separated by elements that match pred, starting at the end of the slice and working backwards. The matched element is not contained in the subslices.

-
§Examples
+
§Examples
let slice = [11, 22, 33, 0, 44, 55];
 let mut iter = slice.rsplit(|num| *num == 0);
 
@@ -616,13 +565,13 @@ 
§Examplesassert_eq!(it.next().unwrap(), &[1, 1]); assert_eq!(it.next().unwrap(), &[]); assert_eq!(it.next(), None);
-
1.0.0 · source

pub fn splitn<F>(&self, n: usize, pred: F) -> SplitN<'_, T, F>
where +

1.0.0 · source

pub fn splitn<F>(&self, n: usize, pred: F) -> SplitN<'_, T, F>
where F: FnMut(&T) -> bool,

Returns an iterator over subslices separated by elements that match pred, limited to returning at most n items. The matched element is not contained in the subslices.

The last element returned, if any, will contain the remainder of the slice.

-
§Examples
+
§Examples

Print the slice split once by numbers divisible by 3 (i.e., [10, 40], [20, 60, 50]):

@@ -631,14 +580,14 @@
§Examplesfor group in v.splitn(2, |num| *num % 3 == 0) { println!("{group:?}"); }
-
1.0.0 · source

pub fn rsplitn<F>(&self, n: usize, pred: F) -> RSplitN<'_, T, F>
where +

1.0.0 · source

pub fn rsplitn<F>(&self, n: usize, pred: F) -> RSplitN<'_, T, F>
where F: FnMut(&T) -> bool,

Returns an iterator over subslices separated by elements that match pred limited to returning at most n items. This starts at the end of the slice and works backwards. The matched element is not contained in the subslices.

The last element returned, if any, will contain the remainder of the slice.

-
§Examples
+
§Examples

Print the slice split once, starting from the end, by numbers divisible by 3 (i.e., [50], [10, 40, 30, 20]):

@@ -647,13 +596,13 @@
§Examplesfor group in v.rsplitn(2, |num| *num % 3 == 0) { println!("{group:?}"); }
-
source

pub fn split_once<F>(&self, pred: F) -> Option<(&[T], &[T])>
where +

source

pub fn split_once<F>(&self, pred: F) -> Option<(&[T], &[T])>
where F: FnMut(&T) -> bool,

🔬This is a nightly-only experimental API. (slice_split_once)

Splits the slice on the first element that matches the specified predicate.

If any matching elements are present in the slice, returns the prefix before the match and suffix after. The matching element itself is not included. If no elements match, returns None.

-
§Examples
+
§Examples
#![feature(slice_split_once)]
 let s = [1, 2, 3, 2, 4];
 assert_eq!(s.split_once(|&x| x == 2), Some((
@@ -661,13 +610,13 @@ 
§Examples&[3, 2, 4][..] ))); assert_eq!(s.split_once(|&x| x == 0), None);
-
source

pub fn rsplit_once<F>(&self, pred: F) -> Option<(&[T], &[T])>
where +

source

pub fn rsplit_once<F>(&self, pred: F) -> Option<(&[T], &[T])>
where F: FnMut(&T) -> bool,

🔬This is a nightly-only experimental API. (slice_split_once)

Splits the slice on the last element that matches the specified predicate.

If any matching elements are present in the slice, returns the prefix before the match and suffix after. The matching element itself is not included. If no elements match, returns None.

-
§Examples
+
§Examples
#![feature(slice_split_once)]
 let s = [1, 2, 3, 2, 4];
 assert_eq!(s.rsplit_once(|&x| x == 2), Some((
@@ -675,11 +624,11 @@ 
§Examples&[4][..] ))); assert_eq!(s.rsplit_once(|&x| x == 0), None);
-
1.0.0 · source

pub fn contains(&self, x: &T) -> bool
where +

1.0.0 · source

pub fn contains(&self, x: &T) -> bool
where T: PartialEq,

Returns true if the slice contains an element with the given value.

This operation is O(n).

Note that if you have a sorted slice, binary_search may be faster.

-
§Examples
+
§Examples
let v = [10, 40, 30];
 assert!(v.contains(&30));
 assert!(!v.contains(&50));
@@ -690,9 +639,9 @@
§Examples
let v = [String::from("hello"), String::from("world")]; // slice of `String`
 assert!(v.iter().any(|e| e == "hello")); // search with `&str`
 assert!(!v.iter().any(|e| e == "hi"));
-
1.0.0 · source

pub fn starts_with(&self, needle: &[T]) -> bool
where +

1.0.0 · source

pub fn starts_with(&self, needle: &[T]) -> bool
where T: PartialEq,

Returns true if needle is a prefix of the slice.

-
§Examples
+
§Examples
let v = [10, 40, 30];
 assert!(v.starts_with(&[10]));
 assert!(v.starts_with(&[10, 40]));
@@ -704,9 +653,9 @@ 
§Examplesassert!(v.starts_with(&[])); let v: &[u8] = &[]; assert!(v.starts_with(&[]));
-
1.0.0 · source

pub fn ends_with(&self, needle: &[T]) -> bool
where +

1.0.0 · source

pub fn ends_with(&self, needle: &[T]) -> bool
where T: PartialEq,

Returns true if needle is a suffix of the slice.

-
§Examples
+
§Examples
let v = [10, 40, 30];
 assert!(v.ends_with(&[30]));
 assert!(v.ends_with(&[40, 30]));
@@ -718,13 +667,13 @@ 
§Examplesassert!(v.ends_with(&[])); let v: &[u8] = &[]; assert!(v.ends_with(&[]));
-
1.51.0 · source

pub fn strip_prefix<P>(&self, prefix: &P) -> Option<&[T]>
where +

1.51.0 · source

pub fn strip_prefix<P>(&self, prefix: &P) -> Option<&[T]>
where P: SlicePattern<Item = T> + ?Sized, T: PartialEq,

Returns a subslice with the prefix removed.

If the slice starts with prefix, returns the subslice after the prefix, wrapped in Some. If prefix is empty, simply returns the original slice.

If the slice does not start with prefix, returns None.

-
§Examples
+
§Examples
let v = &[10, 40, 30];
 assert_eq!(v.strip_prefix(&[10]), Some(&[40, 30][..]));
 assert_eq!(v.strip_prefix(&[10, 40]), Some(&[30][..]));
@@ -734,19 +683,19 @@ 
§Exampleslet prefix : &str = "he"; assert_eq!(b"hello".strip_prefix(prefix.as_bytes()), Some(b"llo".as_ref()));
-
1.51.0 · source

pub fn strip_suffix<P>(&self, suffix: &P) -> Option<&[T]>
where +

1.51.0 · source

pub fn strip_suffix<P>(&self, suffix: &P) -> Option<&[T]>
where P: SlicePattern<Item = T> + ?Sized, T: PartialEq,

Returns a subslice with the suffix removed.

If the slice ends with suffix, returns the subslice before the suffix, wrapped in Some. If suffix is empty, simply returns the original slice.

If the slice does not end with suffix, returns None.

-
§Examples
+
§Examples
let v = &[10, 40, 30];
 assert_eq!(v.strip_suffix(&[30]), Some(&[10, 40][..]));
 assert_eq!(v.strip_suffix(&[40, 30]), Some(&[10][..]));
 assert_eq!(v.strip_suffix(&[50]), None);
 assert_eq!(v.strip_suffix(&[50, 30]), None);
-

Binary searches this slice for a given element. If the slice is not sorted, the returned result is unspecified and meaningless.

@@ -758,7 +707,7 @@
§Examples

See also binary_search_by, binary_search_by_key, and partition_point.

-
§Examples
+
§Examples

Looks up a series of four elements. The first is found, with a uniquely determined position; the second and third are not found; the fourth could match any position in [1, 4].

@@ -799,7 +748,7 @@
§Examples// The above is equivalent to `let idx = s.binary_search(&num).unwrap_or_else(|x| x);` s.insert(idx, num); assert_eq!(s, [0, 1, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 42, 55]);
-
1.0.0 · source

pub fn binary_search_by<'a, F>(&'a self, f: F) -> Result<usize, usize>
where +

1.0.0 · source

pub fn binary_search_by<'a, F>(&'a self, f: F) -> Result<usize, usize>
where F: FnMut(&'a T) -> Ordering,

Binary searches this slice with a comparator function.

The comparator function should return an order code that indicates whether its argument is Less, Equal or Greater the desired @@ -815,7 +764,7 @@

§Examples

See also binary_search, binary_search_by_key, and partition_point.

-
§Examples
+
§Examples

Looks up a series of four elements. The first is found, with a uniquely determined position; the second and third are not found; the fourth could match any position in [1, 4].

@@ -831,7 +780,7 @@
§Exampleslet seek = 1; let r = s.binary_search_by(|probe| probe.cmp(&seek)); assert!(match r { Ok(1..=4) => true, _ => false, });
-
1.10.0 · source

pub fn binary_search_by_key<'a, B, F>( +

1.10.0 · source

pub fn binary_search_by_key<'a, B, F>( &'a self, b: &B, f: F @@ -850,7 +799,7 @@

§Examples

See also binary_search, binary_search_by, and partition_point.

-
§Examples
+
§Examples

Looks up a series of four elements in a slice of pairs sorted by their second elements. The first is found, with a uniquely determined position; the second and third are not found; the @@ -865,7 +814,7 @@

§Examplesassert_eq!(s.binary_search_by_key(&100, |&(a, b)| b), Err(13)); let r = s.binary_search_by_key(&1, |&(a, b)| b); assert!(match r { Ok(1..=4) => true, _ => false, }); -
1.30.0 · source

pub unsafe fn align_to<U>(&self) -> (&[T], &[U], &[T])

Transmute the slice to a slice of another type, ensuring alignment of the types is +

1.30.0 · source

pub unsafe fn align_to<U>(&self) -> (&[T], &[U], &[T])

Transmute the slice to a slice of another type, ensuring alignment of the types is maintained.

This method splits the slice into three distinct slices: prefix, correctly aligned middle slice of a new type, and the suffix slice. How exactly the slice is split up is not @@ -875,10 +824,10 @@

§Exampleswill return a maximal middle part.

This method has no purpose when either input element T or output element U are zero-sized and will return the original slice without splitting anything.

-
§Safety
+
§Safety

This method is essentially a transmute with respect to the elements in the returned middle slice, so all the usual caveats pertaining to transmute::<T, U> also apply here.

-
§Examples
+
§Examples

Basic usage:

unsafe {
@@ -888,7 +837,7 @@ 
§Examples}
-
source

pub fn as_simd<const LANES: usize>(&self) -> (&[T], &[Simd<T, LANES>], &[T])
where +

source

pub fn as_simd<const LANES: usize>(&self) -> (&[T], &[Simd<T, LANES>], &[T])

🔬This is a nightly-only experimental API. (portable_simd)

Split a slice into a prefix, a middle of aligned SIMD types, and a suffix.

@@ -911,7 +860,7 @@
§Panics
supported. It’s possible that, in the future, those restrictions might be lifted in a way that would make it possible to see panics from this method for something like LANES == 3.

-
§Examples
+
§Examples
#![feature(portable_simd)]
 use core::simd::prelude::*;
 
@@ -938,14 +887,14 @@ 
§Exampleslet numbers: Vec<f32> = (1..101).map(|x| x as _).collect(); assert_eq!(basic_simd_sum(&numbers[1..99]), 4949.0);
-
source

pub fn is_sorted(&self) -> bool
where +

source

pub fn is_sorted(&self) -> bool
where T: PartialOrd,

🔬This is a nightly-only experimental API. (is_sorted)

Checks if the elements of this slice are sorted.

That is, for each element a and its following element b, a <= b must hold. If the slice yields exactly zero or one element, true is returned.

Note that if Self::Item is only PartialOrd, but not Ord, the above definition implies that this function returns false if any two consecutive items are not comparable.

-
§Examples
+
§Examples
#![feature(is_sorted)]
 let empty: [i32; 0] = [];
 
@@ -954,11 +903,11 @@ 
§Examplesassert!([0].is_sorted()); assert!(empty.is_sorted()); assert!(![0.0, 1.0, f32::NAN].is_sorted());
-
source

pub fn is_sorted_by<'a, F>(&'a self, compare: F) -> bool
where +

source

pub fn is_sorted_by<'a, F>(&'a self, compare: F) -> bool
where F: FnMut(&'a T, &'a T) -> bool,

🔬This is a nightly-only experimental API. (is_sorted)

Checks if the elements of this slice are sorted using the given comparator function.

Instead of using PartialOrd::partial_cmp, this function uses the given compare function to determine whether two elements are to be considered in sorted order.

-
§Examples
+
§Examples
#![feature(is_sorted)]
 
 assert!([1, 2, 2, 9].is_sorted_by(|a, b| a <= b));
@@ -970,18 +919,18 @@ 
§Exampleslet empty: [i32; 0] = []; assert!(empty.is_sorted_by(|a, b| false)); assert!(empty.is_sorted_by(|a, b| true));
-
source

pub fn is_sorted_by_key<'a, F, K>(&'a self, f: F) -> bool
where +

source

pub fn is_sorted_by_key<'a, F, K>(&'a self, f: F) -> bool
where F: FnMut(&'a T) -> K, K: PartialOrd,

🔬This is a nightly-only experimental API. (is_sorted)

Checks if the elements of this slice are sorted using the given key extraction function.

Instead of comparing the slice’s elements directly, this function compares the keys of the elements, as determined by f. Apart from that, it’s equivalent to is_sorted; see its documentation for more information.

-
§Examples
+
§Examples
#![feature(is_sorted)]
 
 assert!(["c", "bb", "aaa"].is_sorted_by_key(|s| s.len()));
 assert!(![-2i32, -1, 0, 3].is_sorted_by_key(|n| n.abs()));
-
1.52.0 · source

pub fn partition_point<P>(&self, pred: P) -> usize
where +

1.52.0 · source

pub fn partition_point<P>(&self, pred: P) -> usize
where P: FnMut(&T) -> bool,

Returns the index of the partition point according to the given predicate (the index of the first element of the second partition).

The slice is assumed to be partitioned according to the given predicate. @@ -992,7 +941,7 @@

§ExamplesIf this slice is not partitioned, the returned result is unspecified and meaningless, as this method performs a kind of binary search.

See also binary_search, binary_search_by, and binary_search_by_key.

-
§Examples
+
§Examples
let v = [1, 2, 3, 3, 5, 6, 7];
 let i = v.partition_point(|&x| x < 5);
 
@@ -1014,6 +963,53 @@ 
§Exampleslet idx = s.partition_point(|&x| x < num); s.insert(idx, num); assert_eq!(s, [0, 1, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 42, 55]);
+
1.23.0 · source

pub fn is_ascii(&self) -> bool

Checks if all bytes in this slice are within the ASCII range.

+
source

pub fn as_ascii(&self) -> Option<&[AsciiChar]>

🔬This is a nightly-only experimental API. (ascii_char)

If this slice is_ascii, returns it as a slice of +ASCII characters, otherwise returns None.

+
source

pub unsafe fn as_ascii_unchecked(&self) -> &[AsciiChar]

🔬This is a nightly-only experimental API. (ascii_char)

Converts this slice of bytes into a slice of ASCII characters, +without checking whether they’re valid.

+
§Safety
+

Every byte in the slice must be in 0..=127, or else this is UB.

+
1.23.0 · source

pub fn eq_ignore_ascii_case(&self, other: &[u8]) -> bool

Checks that two slices are an ASCII case-insensitive match.

+

Same as to_ascii_lowercase(a) == to_ascii_lowercase(b), +but without allocating and copying temporaries.

+
1.60.0 · source

pub fn escape_ascii(&self) -> EscapeAscii<'_>

Returns an iterator that produces an escaped version of this slice, +treating it as an ASCII string.

+
§Examples
+

+let s = b"0\t\r\n'\"\\\x9d";
+let escaped = s.escape_ascii().to_string();
+assert_eq!(escaped, "0\\t\\r\\n\\'\\\"\\\\\\x9d");
+
source

pub fn trim_ascii_start(&self) -> &[u8]

🔬This is a nightly-only experimental API. (byte_slice_trim_ascii)

Returns a byte slice with leading ASCII whitespace bytes removed.

+

‘Whitespace’ refers to the definition used by +u8::is_ascii_whitespace.

+
§Examples
+
#![feature(byte_slice_trim_ascii)]
+
+assert_eq!(b" \t hello world\n".trim_ascii_start(), b"hello world\n");
+assert_eq!(b"  ".trim_ascii_start(), b"");
+assert_eq!(b"".trim_ascii_start(), b"");
+
source

pub fn trim_ascii_end(&self) -> &[u8]

🔬This is a nightly-only experimental API. (byte_slice_trim_ascii)

Returns a byte slice with trailing ASCII whitespace bytes removed.

+

‘Whitespace’ refers to the definition used by +u8::is_ascii_whitespace.

+
§Examples
+
#![feature(byte_slice_trim_ascii)]
+
+assert_eq!(b"\r hello world\n ".trim_ascii_end(), b"\r hello world");
+assert_eq!(b"  ".trim_ascii_end(), b"");
+assert_eq!(b"".trim_ascii_end(), b"");
+
source

pub fn trim_ascii(&self) -> &[u8]

🔬This is a nightly-only experimental API. (byte_slice_trim_ascii)

Returns a byte slice with leading and trailing ASCII whitespace bytes +removed.

+

‘Whitespace’ refers to the definition used by +u8::is_ascii_whitespace.

+
§Examples
+
#![feature(byte_slice_trim_ascii)]
+
+assert_eq!(b"\r hello world\n ".trim_ascii(), b"hello world");
+assert_eq!(b"  ".trim_ascii(), b"");
+assert_eq!(b"".trim_ascii(), b"");
+
source

pub fn as_str(&self) -> &str

🔬This is a nightly-only experimental API. (ascii_char)

Views this slice of ASCII characters as a UTF-8 str.

+
source

pub fn as_bytes(&self) -> &[u8]

🔬This is a nightly-only experimental API. (ascii_char)

Views this slice of ASCII characters as a slice of u8 bytes.

1.23.0 · source

pub fn to_ascii_uppercase(&self) -> Vec<u8>

Returns a vector containing a copy of this slice where each byte is mapped to its ASCII upper case equivalent.

ASCII letters ‘a’ to ‘z’ are mapped to ‘A’ to ‘Z’, diff --git a/oo7/struct.Key.html b/oo7/struct.Key.html index c5e933837..b8eebe8a6 100644 --- a/oo7/struct.Key.html +++ b/oo7/struct.Key.html @@ -1,6 +1,6 @@ -Key in oo7 - Rust

+Key in oo7 - Rust

Struct oo7::Key

source ·
pub struct Key { /* private fields */ }
Available on crate feature unstable only.
Expand description

A key.

-

Trait Implementations§

source§

impl AsMut<[u8]> for Key

source§

fn as_mut(&mut self) -> &mut [u8]

Converts this type into a mutable reference of the (usually inferred) input type.
source§

impl AsRef<[u8]> for Key

source§

fn as_ref(&self) -> &[u8]

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl Debug for Key

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Drop for Key

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl From<&Key> for Value<'_>

source§

fn from(key: &Key) -> Self

Converts to this type from the input type.
source§

impl From<OwnedValue> for Key

source§

fn from(value: OwnedValue) -> Self

Converts to this type from the input type.
source§

impl Zeroize for Key

source§

fn zeroize(&mut self)

Zero out this object from memory using Rust intrinsics which ensure the +

Trait Implementations§

source§

impl AsMut<[u8]> for Key

source§

fn as_mut(&mut self) -> &mut [u8]

Converts this type into a mutable reference of the (usually inferred) input type.
source§

impl AsRef<[u8]> for Key

source§

fn as_ref(&self) -> &[u8]

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl Debug for Key

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Drop for Key

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl From<&Key> for Value<'_>

source§

fn from(key: &Key) -> Self

Converts to this type from the input type.
source§

impl From<OwnedValue> for Key

source§

fn from(value: OwnedValue) -> Self

Converts to this type from the input type.
source§

impl Zeroize for Key

source§

fn zeroize(&mut self)

Zero out this object from memory using Rust intrinsics which ensure the zeroization operation is not “optimized away” by the compiler.

Auto Trait Implementations§

§

impl RefUnwindSafe for Key

§

impl Send for Key

§

impl Sync for Key

§

impl Unpin for Key

§

impl UnwindSafe for Key

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where diff --git a/oo7/type.Result.html b/oo7/type.Result.html index 70f382920..7bdbde5b0 100644 --- a/oo7/type.Result.html +++ b/oo7/type.Result.html @@ -1,4 +1,4 @@ -Result in oo7 - Rust +Result in oo7 - Rust

Type Alias oo7::Result

source ·
pub type Result<T> = Result<T, Error>;
Expand description

Alias for std::result::Result with the error type Error.

Aliased Type§

enum Result<T> {
     Ok(T),
diff --git a/search-index.js b/search-index.js
index 1497e246b..deee202b1 100644
--- a/search-index.js
+++ b/search-index.js
@@ -1,5 +1,5 @@
 var searchIndex = new Map(JSON.parse('[\
-["oo7",{"doc":"OO7","t":"PPGGFGPPINNNNNNNNNNNNNCNNNNNNNNNNNNNNNNNNNNNNHNNNNHNNCNNNNNNNNNNNNNNNNNNNNNNNNENFSPPGPPFPPPSFPGPPCNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNFFFFFFKNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNPGPPPFPPFPFPPPPPPPPPFPPPPGCNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNFFNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN","n":["DBus","Err","Error","Item","Key","Keyring","Ok","Portal","Result","as_mut","as_ref","attributes","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","create_item","created","dbus","delete","delete","drop","encode_hex","encode_hex_upper","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","into","into","into","into","is_locked","is_sandboxed","items","label","lock","lock","migrate","modified","new","portal","search_items","secret","set_attributes","set_label","set_secret","to_string","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","unlock","unlock","vzip","vzip","vzip","vzip","zbus","zeroize","Collection","DEFAULT_COLLECTION","Deleted","Dismissed","Error","IO","IsLocked","Item","NoSession","NoSuchObject","NotFound","SESSION_COLLECTION","Service","Service","ServiceError","ZBus","Zbus","api","attributes","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","collections","create_collection","create_item","create_reply","created","created","default_collection","delete","delete","description","encrypted","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","from","from","from","into","into","into","into","into","is_locked","is_locked","items","label","label","lock","lock","modified","modified","name","new","path","plain","receive_item_changed","receive_item_created","receive_item_deleted","search_items","secret","set_attributes","set_label","set_label","set_secret","to_string","to_string","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","unlock","unlock","vzip","vzip","vzip","vzip","vzip","with_alias","with_label","Collection","Item","Properties","Secret","Service","Session","Unlockable","attributes","attributes","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","close","collections","content_type","create_collection","create_item","created","created","delete","delete","deserialize","deserializer_for_signature","drop","dynamic_signature","dynamic_signature","dynamic_signature","dynamic_signature","dynamic_signature","dynamic_signature","eq","fmt","fmt","fmt","fmt","fmt","fmt","for_collection","for_item","from","from","from","from","from","from","hash","inner","inner","inner","inner","into","into","into","into","into","into","is_locked","is_locked","items","label","label","label","lock","modified","modified","new","new","new","new","open_session","parameters","read_alias","receive_collection_changed","receive_collection_created","receive_collection_deleted","receive_item_changed","receive_item_created","receive_item_deleted","search_items","search_items","secret","secrets","serialize","serialize","serialize","serialize","serialize","session","set_alias","set_attributes","set_label","set_label","set_secret","signature","signature","signature","signature","signature","signature","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","unlock","value","vzip","vzip","vzip","vzip","vzip","vzip","zeroize","CancelledPortalRequest","Error","FileHeaderMismatch","GVariantDeserialization","HashedAttributeMac","InvalidItemError","InvalidItemIndex","Io","Item","IterationCountTooLow","Keyring","MacError","NoData","NoDataDir","NoParentDir","PasswordTooShort","PortalBus","PortalNotAvailable","SaltSizeMismatch","SaltTooShort","Secret","StrengthUnknown","TargetFileChanged","VersionMismatch","WeakKey","WeakKeyError","api","attributes","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","clone","clone","clone_into","clone_into","create_item","created","delete","delete_item_index","deref","deserialize","deserializer_for_signature","drop","drop","dynamic_signature","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","from","from","from","into","into","into","into","into","into","items","label","load","load_default","lookup_item","modified","n_items","replace_item_index","search_items","secret","serialize","set_attributes","set_label","set_secret","signature","to_owned","to_owned","to_string","to_string","to_string","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","vzip","vzip","vzip","vzip","vzip","vzip","write","zeroize","zeroize","AttributeValue","Keyring","as_ref","borrow","borrow","borrow_mut","borrow_mut","clone","clone_into","default_path","deref","derive_key","deserialize","deserialize","deserializer_for_signature","deserializer_for_signature","drop","dump","dynamic_signature","dynamic_signature","fmt","fmt","from","from","from","from","into","into","key_strength","lookup_item","remove_items","search_items","serialize","serialize","signature","signature","to_owned","try_from","try_from","try_from","try_into","try_into","type_id","type_id","vzip","vzip","zeroize"],"q":[[0,"oo7"],[80,"oo7::dbus"],[191,"oo7::dbus::api"],[326,"oo7::portal"],[454,"oo7::portal::api"],[501,"alloc::string"],[502,"std::collections::hash::map"],[503,"core::convert"],[504,"core::time"],[505,"core::iter::traits::collect"],[506,"core::fmt"],[507,"core::fmt"],[508,"alloc::vec"],[509,"zeroize"],[510,"core::result"],[511,"core::any"],[512,"core::option"],[513,"zbus::message_header"],[514,"zbus::message"],[515,"zbus::error"],[516,"zbus::error"],[517,"zvariant::error"],[518,"zbus::fdo"],[519,"zbus_names::error_name"],[520,"zvariant::object_path"],[521,"futures_core::stream"],[522,"zvariant::object_path"],[523,"zvariant::signature"],[524,"core::convert"],[525,"zbus::proxy"],[526,"zbus::connection"],[527,"serde::ser"],[528,"std::path"],[529,"alloc::string"]],"d":["Secret Service error.","Contains the error value","The error type for oo7.","A generic secret with a label and attributes.","A key.","A Secret Service or file backed keyring implementation.","Contains the success value","File backend error.","Alias for std::result::Result with the error type Error.","","","Retrieve the item attributes.","","","","","","","","","Create a new item.","The UNIX time when the item was created.","A Secret Service implementation.","Remove items that matches the attributes.","Delete the item.","","","","","","","","","","","Returns the argument unchanged.","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Whether the item is locked or not","Checks whether the application is sandboxed or not.","Retrieve all the items.","The item label.","Lock the used collection if using the Secret service.","Lock the item","Helper to migrate your secrets from the host Secret Service","The UNIX time when the item was modified.","Create a new instance of the Keyring.","File backend implementation backed by the Secret portal.","Find items based on their attributes.","Retrieves the stored secret.","Sets the item attributes.","Sets the item label.","Sets a new secret.","","","","","","","","","","","","","","Unlock the used collection if using the Secret service.","Unlock the item","","","","","","","A collection allows to store and retrieve items.","The default collection alias.","The item/collection was removed.","The prompt request was dismissed.","DBus backend specific errors.","Input/Output.","Collection/Item is locked.","A secret with a label and attributes to identify it.","Session does not exist.","Collection/Item does not exist.","The collection doesn’t exists","A session collection.","The entry point of communicating with a …","A service error.","DBus Secret Service specific errors. …","ZBus specific error.","Something went wrong on the wire.","Barebone DBus API of the Secret Service specifications.","Retrieve the item attributes.","","","","","","","","","","","Get a list of all the available collections.","Create a new collection.","Create a new item on the collection","","The UNIX time when the item was created.","The UNIX time when the collection was created.","Retrieve the default collection.","Delete the item.","Delete the collection.","","Create a new instance of the Service with encrypted …","","","","","","","","Returns the argument unchanged.","","Returns the argument unchanged.","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Get whether the item is locked.","Get whether the collection is locked.","Retrieve the list of available Item in the collection.","The item label.","The collection label.","Lock the item.","Lock the collection.","The UNIX time when the item was modified.","The UNIX time when the collection was modified.","","Create a new instance of the Service, an encrypted …","Returns item path","Create a new instance of the Service with plain algorithm.","Stream yielding when existing items get changed","Stream yielding when new items get created","Stream yielding when existing items get deleted","Search for items based on their attributes.","Retrieve the currently stored secret.","Update the item attributes.","Set the item label.","Set the collection label.","Modify the stored secret on the item.","","","","","","","","","","","","","","","","","","Unlock the item.","Unlock the collection.","","","","","","Find a collection with it alias.","Find a collection with it label.","","","","","","","A common trait implemented by objects that can be locked …","","","","","","","","","","","","","","","","","Content type of the secret","","","","","","","","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","","","","","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","","","","","","","","","","","","","","","Algorithm dependent parameters for secret value encoding","","","","","","","","","","","","","","","","","Session used to encode the secret","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Possibly encoded secret value","","","","","","","","Portal request has been cancelled.","File backend specific errors.","File header does not match FILE_HEADER.","Bytes don’t have the expected GVariant format.","Failure to validate the attributes.","All information that is available about an invalid (not …","The addressed index does not exist.","Input/Output.","An item stored in the file backend.","Avoid attack on existing files","File backed keyring.","Unexpected MAC digest value.","No data behind header and version bytes.","XDG_DATA_HOME required for reading from default location.","No Parent directory.","Just not secure enough to store password","Portal DBus communication error.","If the portal is not available on the host. Can happen if …","Mismatch between array length and length explicitly stored …","Avoid attack on existing files","Secret retrieved from the XDG secret portal.","Should not occur","Target file has changed.","Version bytes do not match MAJOR_VERSION or MINOR_VERSION.","Key for some reason too weak to trust it for writing","Details about why an encryption key is consider too weak …","GNOME Keyring file format low level API.","Retrieve the item attributes.","","","","","","","","","","","","","","","","","Create a new item","The UNIX time when the item was created.","Delete an item.","Deletes item at the given index.","","","","","","","","","","","","","","","","Returns the argument unchanged.","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","Returns the argument unchanged.","Returns the argument unchanged.","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Retrieve the list of available Items.","The item label.","Load from a keyring file.","Load from default keyring file","Find the first item matching the attributes.","The UNIX time when the item was modified.","Retrieve the number of items","Replaces item at the given index.","Search items matching the attributes.","Retrieve the currently stored secret.","","Update the item attributes.","Set the item label.","Store a new secret.","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Write the changes to the keyring file.","","","An encrypted attribute value.","Logical contents of a keyring file","","","","","","","","","","","","","","","","Write to a keyring file","","","","","Returns the argument unchanged.","","","Returns the argument unchanged.","Calls U::from(self).","Calls U::from(self).","","","","","","","","","","","","","","","","","","",""],"i":[16,7,0,0,0,0,7,16,0,1,1,4,16,1,8,4,16,1,8,4,8,4,0,8,4,1,1,1,16,16,1,8,4,16,16,16,1,1,8,4,16,1,8,4,4,0,8,4,8,4,0,4,8,0,8,4,4,4,4,16,16,1,8,4,16,1,8,4,16,1,8,4,8,4,16,1,8,4,0,1,0,0,19,19,0,19,30,0,30,30,19,0,0,19,0,30,19,0,26,26,30,19,27,28,26,30,19,27,28,27,27,28,30,26,28,27,26,28,30,27,26,30,30,19,19,27,28,26,30,30,19,19,19,19,19,19,27,28,26,30,19,27,28,26,28,28,26,28,26,28,26,28,30,27,26,27,28,28,28,28,26,26,26,28,26,30,19,26,30,19,27,28,26,30,19,27,28,26,30,19,27,28,26,28,26,30,19,27,28,27,27,0,0,0,0,0,0,0,43,44,47,43,44,48,46,45,47,43,44,48,46,45,45,46,48,46,47,47,43,47,43,44,44,48,47,43,44,48,46,45,43,47,43,44,48,46,45,44,44,47,43,44,48,46,45,43,47,43,46,45,47,43,44,48,46,45,47,43,47,47,43,44,46,47,43,47,43,46,45,46,48,46,46,46,46,47,47,47,47,46,43,46,47,43,44,48,45,48,46,43,47,43,43,47,43,44,48,46,45,47,43,44,48,46,45,47,43,44,48,46,45,47,43,44,48,46,45,46,48,47,43,44,48,46,45,48,20,0,20,20,20,0,20,20,0,60,0,20,20,20,20,60,20,20,20,60,0,60,20,20,20,0,0,58,20,64,60,58,63,61,20,64,60,58,63,61,60,58,60,58,61,58,61,61,63,58,58,58,63,58,20,20,64,64,60,60,58,63,61,20,20,20,20,20,64,60,58,63,63,61,20,64,60,58,63,61,61,58,61,61,61,58,61,61,61,58,58,58,58,58,58,60,58,20,64,60,20,64,60,58,58,63,61,20,64,60,58,63,61,20,64,60,58,63,61,20,64,60,58,63,61,61,58,63,0,0,59,59,68,59,68,59,59,68,59,68,59,68,59,68,59,68,59,68,59,68,59,59,59,68,59,68,68,68,68,68,59,68,59,68,59,59,68,68,59,68,59,68,59,68,59],"f":"`````````{b{{f{d}}}}0{h{{n{{l{jj}}}}}}{ce{}{}}0000000{{A`Ab{l{AbAb}}cAd}{{n{Af}}}{{Ah{{f{d}}}}}}{h{{n{Aj}}}}`{{A`{l{AbAb}}}{{n{Af}}}}{h{{n{Af}}}}{bAf}{ce{}{{An{Al}}}}0{{B`Bb}Bd}0{{bBb}Bd}{{A`Bb}Bd}{{hBb}Bd}{BfB`}{BhB`}{cc{}}{Bjb}111>>>>{h{{n{Ad}}}}{{}Ad}{A`{{n{{Bl{h}}}}}}{h{{n{j}}}}{A`{{n{Af}}}}?{{{Bl{{l{AbAb}}}}Ad}{{n{Af}}}}{h{{n{Aj}}}}{{}{{n{A`}}}}`{{A`{l{AbAb}}}{{n{{Bl{h}}}}}}{h{{n{{Bn{{Bl{d}}}}}}}}{{h{l{AbAb}}}{{n{Af}}}}{{hAb}{{n{Af}}}}{{hc}{{n{Af}}}{{Ah{{f{d}}}}}}{cj{}}{c{{C`{e}}}{}{}}0000000{cCb{}}000;{h{{n{Af}}}}{ce{}{}}000`{bAf}``````````````````{Cd{{C`{{l{jj}}Bf}}}}2222222222{Cf{{C`{{Bl{Ch}}Bf}}}}{{CfAb{Cj{Ab}}}{{C`{ChBf}}}}{{ChAb{l{AbAb}}cAdAb}{{C`{CdBf}}}{{Ah{{f{d}}}}}}{{ClCn}{{Db{D`}}}}{Cd{{C`{AjBf}}}}{Ch{{C`{AjBf}}}}{Cf{{C`{ChBf}}}}{Cd{{C`{AfBf}}}}{Ch{{C`{AfBf}}}}{Cl{{Cj{Ab}}}}{{}{{C`{CfBf}}}}{{CdBb}Bd}{{ClBb}Bd}0{{BfBb}Bd}0{{CfBb}Bd}{{ChBb}Bd}{cc{}}{DdCl}1{DfBf}{DhBf}{ClBf}{DjBf}{DdBf}666{ce{}{}}0000{Cd{{C`{AdBf}}}}{Ch{{C`{AdBf}}}}{Ch{{C`{{Bl{Cd}}Bf}}}}{Cd{{C`{jBf}}}}{Ch{{C`{jBf}}}}{Cd{{C`{AfBf}}}}{Ch{{C`{AfBf}}}}{Cd{{C`{AjBf}}}}{Ch{{C`{AjBf}}}}{ClDl}{{}{{C`{CfBf}}}}{CdDn}1{Ch{{C`{{`{{Eb{}{{E`{Cd}}}}}}Bf}}}}0{Ch{{C`{{`{{Eb{}{{E`{Ed}}}}}}Bf}}}}{{Ch{l{AbAb}}}{{C`{{Bl{Cd}}Bf}}}}{Cd{{C`{{Bn{{Bl{d}}}}Bf}}}}{{Cd{l{AbAb}}}{{C`{AfBf}}}}{{CdAb}{{C`{AfBf}}}}{{ChAb}{{C`{AfBf}}}}{{CdcAb}{{C`{AfBf}}}{{Ah{{f{d}}}}}}{cj{}}0{c{{C`{e}}}{}{}}000000000{cCb{}}0000{Cd{{C`{AfBf}}}}{Ch{{C`{AfBf}}}}{ce{}{}}0000{{CfAb}{{C`{{Cj{Ch}}Bf}}}}0```````{Ef{{C`{{l{jj}}Bf}}}}{Eh{{Cj{{l{jj}}}}}}333333333333{Ej{{C`{AfBf}}}}{El{{C`{{Bl{En}}Bf}}}}{F`Ab}{{ElAb{Cj{Ab}}}{{C`{EnBf}}}}{{EnAb{l{AbAb}}F`Ad}{{C`{EfBf}}}}{En{{C`{AjBf}}}}{Ef{{C`{AjBf}}}}{En{{C`{AfBf}}}}{Ef{{C`{AfBf}}}}{c{{C`{Eh}}}Fb}{c{{C`{Dh}}}{{Ff{Fd}}}}{F`Af}{cFd{}}00000{{EfEf}Ad}{{EnBb}Bd}{{EfBb}Bd}{{EhBb}Bd}{{F`Bb}Bd}{{ElBb}Bd}{{EjBb}Bd}{AbEh}{{Ab{l{AbAb}}}Eh}{cc{}}00000{{Efc}AfFh}{EnFj}{EfFj}{ElFj}{EjFj}{ce{}{}}00000{En{{C`{AdBf}}}}{Ef{{C`{AdBf}}}}{En{{C`{{Bl{Ef}}Bf}}}}{En{{C`{jBf}}}}{Ef{{C`{jBf}}}}{EhAb}{{El{f{c}}}{{C`{{Bl{Ed}}Bf}}}Fl}{En{{C`{AjBf}}}}{Ef{{C`{AjBf}}}}{{Fnc}{{C`{EnBf}}}{{Ff{Dn}}}}{{Fnc}{{C`{EfBf}}}{{Ff{Dn}}}}{Fn{{C`{ElBf}}}}{{Fnc}{{C`{EjBf}}}{{Ff{Dn}}}}{{El{Cj{b}}}{{C`{{G`{{Cj{b}}Ej}}Bf}}}}{F`{{f{d}}}}{{ElAb}{{C`{{Cj{En}}Bf}}}}{El{{C`{{`{{Eb{}{{E`{En}}}}}}Bf}}}}00{En{{C`{{`{{Eb{}{{E`{Ef}}}}}}Bf}}}}0{En{{C`{{`{{Eb{}{{E`{Ed}}}}}}Bf}}}}{{En{l{AbAb}}}{{C`{{Bl{Ef}}Bf}}}}{{El{l{AbAb}}}{{C`{{G`{{Bl{Ef}}{Bl{Ef}}}}Bf}}}}{{EfEj}{{C`{F`Bf}}}}{{El{f{Ef}}Ej}{{C`{{l{EfF`}}Bf}}}}{{Enc}C`Gb}{{Efc}C`Gb}{{Ehc}C`Gb}{{F`c}C`Gb}{{Ejc}C`Gb}{F`Ej}{{ElAbEn}{{C`{AfBf}}}}{{Ef{l{AbAb}}}{{C`{AfBf}}}}{{EnAb}{{C`{AfBf}}}}{{EfAb}{{C`{AfBf}}}}{{EfF`}{{C`{AfBf}}}}{{}Fd}00000{c{{C`{e}}}{}{}}00000000000{cCb{}}00000{{El{f{c}}}{{C`{{Bl{Ed}}Bf}}}Fl}{F`{{f{d}}}}{ce{}{}}00000{F`Af}```````````````````````````{Gd{{l{jGf}}}}222222222222{GhGh}{GdGd}{{ce}Af{}{}}0{{GjAb{l{AbAb}}cAd}{{C`{AfBh}}}{{Ah{{f{d}}}}}}{GdAj}{{Gj{l{AbAb}}}{{C`{AfBh}}}}{{GjGl}{{C`{AfBh}}}}{Gnc{}}{c{{C`{Gd}}}Fb}{c{{C`{Dh}}}{{Ff{Fd}}}}{GdAf}{GnAf}{cFd{}}{{BhBb}Bd}0{{H`Bb}Bd}0{{GhBb}Bd}0{{GdBb}Bd}{{GnBb}Bd}{{GjBb}Bd}{cc{}}{DfBh}{DdBh}{DhBh}{GhBh}444{{{Bl{d}}}Gn}55{ce{}{}}00000{Gj{{Bl{{C`{GdH`}}}}}}{GdAb}{{cGn}{{C`{GjBh}}}{{Ah{Hb}}}}{{}{{C`{GjBh}}}}{{Gj{l{AbAb}}}{{C`{{Cj{Gd}}Bh}}}}{GdAj}{GjGl}{{GjGlGd}{{C`{AfBh}}}}{{Gj{l{AbAb}}}{{C`{{Bl{Gd}}Bh}}}}{Gd{{Bn{{Bl{d}}}}}}{{Gdc}C`Gb}{{Gd{l{AbAb}}}Af}{{Gdc}AfHd}{{Gdc}Af{{Ah{{f{d}}}}}}{{}Fd}??{cj{}}00{c{{C`{e}}}{}{}}000{{{f{d}}}{{C`{GdBh}}}}11111111{cCb{}}00000{ce{}{}}00000{Gj{{C`{AfBh}}}}{GdAf}{GnAf}``{GfAb}4444{GfGf}{{ce}Af{}{}}{{}{{C`{HfBh}}}}{Gfc{}}{{HhGn}b}{c{{C`{Gf}}}Fb}{c{{C`{Hh}}}Fb}{c{{C`{Dh}}}{{Ff{Fd}}}}0{GfAf}{{Hhc{Cj{Hj}}}{{C`{AfBh}}}{{Ah{Hb}}}}{cFd{}}0{{GfBb}Bd}{{HhBb}Bd}{cc{}}{cGfHd}{Hlc{}}2{ce{}{}}0{{Hh{f{d}}}{{C`{AfGh}}}}{{Hh{l{ce}}b}{{C`{{Cj{Gd}}Bh}}}{{Ah{Ab}}}{{Ah{Ab}}}}{{Hh{l{ce}}b}{{C`{AfBh}}}{{Ah{Ab}}}{{Ah{Ab}}}}{{Hh{l{ce}}b}{{C`{{Bl{Gd}}Bh}}}{{Ah{Ab}}}{{Ah{Ab}}}}{{Gfc}C`Gb}{{Hhc}C`Gb}{{}Fd}07{c{{C`{e}}}{}{}}0{{{f{d}}}{{C`{HhBh}}}}11{cCb{}}0::{GfAf}","c":[],"p":[[5,"Key",0],[1,"u8"],[1,"slice"],[6,"Item",0],[5,"String",501],[5,"HashMap",502],[8,"Result",0],[6,"Keyring",0],[1,"str"],[1,"bool"],[1,"unit"],[10,"AsRef",503],[5,"Duration",504],[1,"char"],[10,"FromIterator",505],[6,"Error",0],[5,"Formatter",506],[8,"Result",506],[6,"Error",80],[6,"Error",326],[5,"OwnedValue",507],[5,"Vec",508],[5,"Zeroizing",509],[6,"Result",510],[5,"TypeId",511],[5,"Item",80],[5,"Service",80],[5,"Collection",80],[6,"Option",512],[6,"ServiceError",80],[5,"MessageHeader",513],[5,"Message",514],[8,"Result",515],[6,"Error",515],[5,"Error",516],[6,"Error",517],[6,"Error",518],[5,"ErrorName",519],[5,"ObjectPath",520],[17,"Item"],[10,"Stream",521],[5,"OwnedObjectPath",520],[5,"Item",191],[5,"Properties",191],[5,"Session",191],[5,"Service",191],[5,"Collection",191],[5,"Secret",191],[10,"Deserializer",522],[5,"Signature",523],[10,"TryInto",503],[10,"Hasher",524],[5,"Proxy",525],[10,"Unlockable",191],[5,"Connection",526],[1,"tuple"],[10,"Serializer",527],[5,"Item",326],[5,"AttributeValue",454],[6,"WeakKeyError",326],[5,"Keyring",326],[1,"usize"],[5,"Secret",326],[5,"InvalidItemError",326],[5,"Path",528],[10,"ToString",501],[5,"PathBuf",528],[5,"Keyring",454],[5,"SystemTime",529],[1,"never"]],"b":[[28,"impl-Debug-for-Error"],[29,"impl-Display-for-Error"],[33,"impl-From%3CError%3E-for-Error"],[34,"impl-From%3CError%3E-for-Error"],[121,"impl-Debug-for-ServiceError"],[122,"impl-Display-for-ServiceError"],[123,"impl-Debug-for-Error"],[124,"impl-Display-for-Error"],[130,"impl-From%3CError%3E-for-Error"],[131,"impl-From%3CError%3E-for-Error"],[132,"impl-From%3CServiceError%3E-for-Error"],[133,"impl-From%3CError%3E-for-Error"],[134,"impl-From%3CError%3E-for-Error"],[380,"impl-Display-for-Error"],[381,"impl-Debug-for-Error"],[382,"impl-Debug-for-InvalidItemError"],[383,"impl-Display-for-InvalidItemError"],[384,"impl-Display-for-WeakKeyError"],[385,"impl-Debug-for-WeakKeyError"],[390,"impl-From%3CError%3E-for-Error"],[391,"impl-From%3CError%3E-for-Error"],[392,"impl-From%3CError%3E-for-Error"],[393,"impl-From%3CWeakKeyError%3E-for-Error"]],"a":{"collectionchanged":[272],"collectioncreated":[273],"collectiondeleted":[274],"createcollection":[215],"createitem":[216],"getsecret":[280],"getsecrets":[281],"itemchanged":[275],"itemcreated":[276],"itemdeleted":[277],"locked":[144,256,257],"opensession":[269],"org.freedesktop.secret.collection":[191],"org.freedesktop.secret.item":[192],"org.freedesktop.secret.session":[196],"org.freedesktop.secrets":[195],"readalias":[271],"searchitems":[278,279],"setalias":[288],"setsecret":[164,292]}}]\
+["oo7",{"doc":"OO7","t":"PPGGFGPPINNNNNNNNNNNNNCNNNNNNNNNNNNNNNNNNNNNNHNNNNHNNCNNNNNNNNNNNNNNNNNNNNNNNNENFSPPGPPFPPPSFPGPPCNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNFFFFFFKNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNPGPPPFPPFPFPPPPPPPPPFPPPPGCNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNFFNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN","n":["DBus","Err","Error","Item","Key","Keyring","Ok","Portal","Result","as_mut","as_ref","attributes","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","create_item","created","dbus","delete","delete","drop","encode_hex","encode_hex_upper","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","into","into","into","into","is_locked","is_sandboxed","items","label","lock","lock","migrate","modified","new","portal","search_items","secret","set_attributes","set_label","set_secret","to_string","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","unlock","unlock","vzip","vzip","vzip","vzip","zbus","zeroize","Collection","DEFAULT_COLLECTION","Deleted","Dismissed","Error","IO","IsLocked","Item","NoSession","NoSuchObject","NotFound","SESSION_COLLECTION","Service","Service","ServiceError","ZBus","Zbus","api","attributes","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","collections","create_collection","create_item","create_reply","created","created","default_collection","delete","delete","description","encrypted","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","from","from","from","into","into","into","into","into","is_locked","is_locked","items","label","label","lock","lock","modified","modified","name","new","path","plain","receive_item_changed","receive_item_created","receive_item_deleted","search_items","secret","set_attributes","set_label","set_label","set_secret","to_string","to_string","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","unlock","unlock","vzip","vzip","vzip","vzip","vzip","with_alias","with_label","Collection","Item","Properties","Secret","Service","Session","Unlockable","attributes","attributes","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","close","collections","content_type","create_collection","create_item","created","created","delete","delete","deserialize","deserializer_for_signature","drop","dynamic_signature","dynamic_signature","dynamic_signature","dynamic_signature","dynamic_signature","dynamic_signature","eq","fmt","fmt","fmt","fmt","fmt","fmt","for_collection","for_item","from","from","from","from","from","from","hash","inner","inner","inner","inner","into","into","into","into","into","into","is_locked","is_locked","items","label","label","label","lock","modified","modified","new","new","new","new","open_session","parameters","read_alias","receive_collection_changed","receive_collection_created","receive_collection_deleted","receive_item_changed","receive_item_created","receive_item_deleted","search_items","search_items","secret","secrets","serialize","serialize","serialize","serialize","serialize","session","set_alias","set_attributes","set_label","set_label","set_secret","signature","signature","signature","signature","signature","signature","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","unlock","value","vzip","vzip","vzip","vzip","vzip","vzip","zeroize","CancelledPortalRequest","Error","FileHeaderMismatch","GVariantDeserialization","HashedAttributeMac","InvalidItemError","InvalidItemIndex","Io","Item","IterationCountTooLow","Keyring","MacError","NoData","NoDataDir","NoParentDir","PasswordTooShort","PortalBus","PortalNotAvailable","SaltSizeMismatch","SaltTooShort","Secret","StrengthUnknown","TargetFileChanged","VersionMismatch","WeakKey","WeakKeyError","api","attributes","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","clone","clone","clone_into","clone_into","create_item","created","delete","delete_item_index","deref","deserialize","deserializer_for_signature","drop","drop","dynamic_signature","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","from","from","from","into","into","into","into","into","into","items","label","load","load_default","lookup_item","modified","n_items","replace_item_index","search_items","secret","serialize","set_attributes","set_label","set_secret","signature","to_owned","to_owned","to_string","to_string","to_string","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","vzip","vzip","vzip","vzip","vzip","vzip","write","zeroize","zeroize","AttributeValue","Keyring","as_ref","borrow","borrow","borrow_mut","borrow_mut","clone","clone_into","default_path","deref","derive_key","deserialize","deserialize","deserializer_for_signature","deserializer_for_signature","drop","dump","dynamic_signature","dynamic_signature","fmt","fmt","from","from","from","from","into","into","key_strength","lookup_item","remove_items","search_items","serialize","serialize","signature","signature","to_owned","try_from","try_from","try_from","try_into","try_into","type_id","type_id","vzip","vzip","zeroize"],"q":[[0,"oo7"],[80,"oo7::dbus"],[191,"oo7::dbus::api"],[326,"oo7::portal"],[454,"oo7::portal::api"],[501,"alloc::string"],[502,"std::collections::hash::map"],[503,"core::convert"],[504,"core::time"],[505,"core::iter::traits::collect"],[506,"core::fmt"],[507,"core::fmt"],[508,"alloc::vec"],[509,"zeroize"],[510,"core::result"],[511,"core::any"],[512,"core::option"],[513,"zbus::message_header"],[514,"zbus::message"],[515,"zbus::error"],[516,"zbus::error"],[517,"zbus::fdo"],[518,"zvariant::error"],[519,"zbus_names::error_name"],[520,"zvariant::object_path"],[521,"futures_core::stream"],[522,"zvariant::object_path"],[523,"zvariant::signature"],[524,"core::convert"],[525,"zbus::proxy"],[526,"zbus::connection"],[527,"serde::ser"],[528,"std::path"],[529,"alloc::string"]],"d":["Secret Service error.","Contains the error value","The error type for oo7.","A generic secret with a label and attributes.","A key.","A Secret Service or file backed keyring implementation.","Contains the success value","File backend error.","Alias for std::result::Result with the error type Error.","","","Retrieve the item attributes.","","","","","","","","","Create a new item.","The UNIX time when the item was created.","A Secret Service implementation.","Remove items that matches the attributes.","Delete the item.","","","","","","","","","","","Returns the argument unchanged.","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Whether the item is locked or not","Checks whether the application is sandboxed or not.","Retrieve all the items.","The item label.","Lock the used collection if using the Secret service.","Lock the item","Helper to migrate your secrets from the host Secret Service","The UNIX time when the item was modified.","Create a new instance of the Keyring.","File backend implementation backed by the Secret portal.","Find items based on their attributes.","Retrieves the stored secret.","Sets the item attributes.","Sets the item label.","Sets a new secret.","","","","","","","","","","","","","","Unlock the used collection if using the Secret service.","Unlock the item","","","","","","","A collection allows to store and retrieve items.","The default collection alias.","The item/collection was removed.","The prompt request was dismissed.","DBus backend specific errors.","Input/Output.","Collection/Item is locked.","A secret with a label and attributes to identify it.","Session does not exist.","Collection/Item does not exist.","The collection doesn’t exists","A session collection.","The entry point of communicating with a …","A service error.","DBus Secret Service specific errors. …","ZBus specific error.","Something went wrong on the wire.","Barebone DBus API of the Secret Service specifications.","Retrieve the item attributes.","","","","","","","","","","","Get a list of all the available collections.","Create a new collection.","Create a new item on the collection","","The UNIX time when the item was created.","The UNIX time when the collection was created.","Retrieve the default collection.","Delete the item.","Delete the collection.","","Create a new instance of the Service with encrypted …","","","","","","","","Returns the argument unchanged.","","Returns the argument unchanged.","","","","Returns the argument unchanged.","","","Returns the argument unchanged.","Returns the argument unchanged.","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Get whether the item is locked.","Get whether the collection is locked.","Retrieve the list of available Item in the collection.","The item label.","The collection label.","Lock the item.","Lock the collection.","The UNIX time when the item was modified.","The UNIX time when the collection was modified.","","Create a new instance of the Service, an encrypted …","Returns item path","Create a new instance of the Service with plain algorithm.","Stream yielding when existing items get changed","Stream yielding when new items get created","Stream yielding when existing items get deleted","Search for items based on their attributes.","Retrieve the currently stored secret.","Update the item attributes.","Set the item label.","Set the collection label.","Modify the stored secret on the item.","","","","","","","","","","","","","","","","","","Unlock the item.","Unlock the collection.","","","","","","Find a collection with it alias.","Find a collection with it label.","","","","","","","A common trait implemented by objects that can be locked …","","","","","","","","","","","","","","","","","Content type of the secret","","","","","","","","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","","","","","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","","","","","","","","","","","","","","","Algorithm dependent parameters for secret value encoding","","","","","","","","","","","","","","","","","Session used to encode the secret","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Possibly encoded secret value","","","","","","","","Portal request has been cancelled.","File backend specific errors.","File header does not match FILE_HEADER.","Bytes don’t have the expected GVariant format.","Failure to validate the attributes.","All information that is available about an invalid (not …","The addressed index does not exist.","Input/Output.","An item stored in the file backend.","Avoid attack on existing files","File backed keyring.","Unexpected MAC digest value.","No data behind header and version bytes.","XDG_DATA_HOME required for reading from default location.","No Parent directory.","Just not secure enough to store password","Portal DBus communication error.","If the portal is not available on the host. Can happen if …","Mismatch between array length and length explicitly stored …","Avoid attack on existing files","Secret retrieved from the XDG secret portal.","Should not occur","Target file has changed.","Version bytes do not match MAJOR_VERSION or MINOR_VERSION.","Key for some reason too weak to trust it for writing","Details about why an encryption key is consider too weak …","GNOME Keyring file format low level API.","Retrieve the item attributes.","","","","","","","","","","","","","","","","","Create a new item","The UNIX time when the item was created.","Delete an item.","Deletes item at the given index.","","","","","","","","","","","","","","","","Returns the argument unchanged.","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","Returns the argument unchanged.","Returns the argument unchanged.","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Retrieve the list of available Items.","The item label.","Load from a keyring file.","Load from default keyring file","Find the first item matching the attributes.","The UNIX time when the item was modified.","Retrieve the number of items","Replaces item at the given index.","Search items matching the attributes.","Retrieve the currently stored secret.","","Update the item attributes.","Set the item label.","Store a new secret.","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Write the changes to the keyring file.","","","An encrypted attribute value.","Logical contents of a keyring file","","","","","","","","","","","","","","","","Write to a keyring file","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Calls U::from(self).","Calls U::from(self).","","","","","","","","","","","","","","","","","","",""],"i":[16,7,0,0,0,0,7,16,0,1,1,4,16,1,8,4,16,1,8,4,8,4,0,8,4,1,1,1,16,16,1,8,4,16,16,16,1,1,8,4,16,1,8,4,4,0,8,4,8,4,0,4,8,0,8,4,4,4,4,16,16,1,8,4,16,1,8,4,16,1,8,4,8,4,16,1,8,4,0,1,0,0,19,19,0,19,30,0,30,30,19,0,0,19,0,30,19,0,26,26,30,19,27,28,26,30,19,27,28,27,27,28,30,26,28,27,26,28,30,27,26,30,30,19,19,27,28,26,30,30,19,19,19,19,19,19,27,28,26,30,19,27,28,26,28,28,26,28,26,28,26,28,30,27,26,27,28,28,28,28,26,26,26,28,26,30,19,26,30,19,27,28,26,30,19,27,28,26,30,19,27,28,26,28,26,30,19,27,28,27,27,0,0,0,0,0,0,0,43,44,47,43,44,48,46,45,47,43,44,48,46,45,45,46,48,46,47,47,43,47,43,44,44,48,47,43,44,48,46,45,43,47,43,44,48,46,45,44,44,47,43,44,48,46,45,43,47,43,46,45,47,43,44,48,46,45,47,43,47,47,43,44,46,47,43,47,43,46,45,46,48,46,46,46,46,47,47,47,47,46,43,46,47,43,44,48,45,48,46,43,47,43,43,47,43,44,48,46,45,47,43,44,48,46,45,47,43,44,48,46,45,47,43,44,48,46,45,46,48,47,43,44,48,46,45,48,20,0,20,20,20,0,20,20,0,60,0,20,20,20,20,60,20,20,20,60,0,60,20,20,20,0,0,58,20,64,60,58,63,61,20,64,60,58,63,61,60,58,60,58,61,58,61,61,63,58,58,58,63,58,20,20,64,64,60,60,58,63,61,20,20,20,20,20,64,60,58,63,63,61,20,64,60,58,63,61,61,58,61,61,61,58,61,61,61,58,58,58,58,58,58,60,58,20,64,60,20,64,60,58,58,63,61,20,64,60,58,63,61,20,64,60,58,63,61,20,64,60,58,63,61,61,58,63,0,0,59,59,68,59,68,59,59,68,59,68,59,68,59,68,59,68,59,68,59,68,59,59,59,68,59,68,68,68,68,68,59,68,59,68,59,59,68,68,59,68,59,68,59,68,59],"f":"`````````{b{{f{d}}}}0{h{{n{{l{jj}}}}}}{ce{}{}}0000000{{A`Ab{l{AbAb}}cAd}{{n{Af}}}{{Ah{{f{d}}}}}}{h{{n{Aj}}}}`{{A`{l{AbAb}}}{{n{Af}}}}{h{{n{Af}}}}{bAf}{ce{}{{An{Al}}}}0{{B`Bb}Bd}0{{bBb}Bd}{{A`Bb}Bd}{{hBb}Bd}{BfB`}{BhB`}{cc{}}{Bjb}111>>>>{h{{n{Ad}}}}{{}Ad}{A`{{n{{Bl{h}}}}}}{h{{n{j}}}}{A`{{n{Af}}}}?{{{Bl{{l{AbAb}}}}Ad}{{n{Af}}}}{h{{n{Aj}}}}{{}{{n{A`}}}}`{{A`{l{AbAb}}}{{n{{Bl{h}}}}}}{h{{n{{Bn{{Bl{d}}}}}}}}{{h{l{AbAb}}}{{n{Af}}}}{{hAb}{{n{Af}}}}{{hc}{{n{Af}}}{{Ah{{f{d}}}}}}{cj{}}{c{{C`{e}}}{}{}}0000000{cCb{}}000;{h{{n{Af}}}}{ce{}{}}000`{bAf}``````````````````{Cd{{C`{{l{jj}}Bf}}}}2222222222{Cf{{C`{{Bl{Ch}}Bf}}}}{{CfAb{Cj{Ab}}}{{C`{ChBf}}}}{{ChAb{l{AbAb}}cAdAb}{{C`{CdBf}}}{{Ah{{f{d}}}}}}{{ClCn}{{Db{D`}}}}{Cd{{C`{AjBf}}}}{Ch{{C`{AjBf}}}}{Cf{{C`{ChBf}}}}{Cd{{C`{AfBf}}}}{Ch{{C`{AfBf}}}}{Cl{{Cj{Ab}}}}{{}{{C`{CfBf}}}}{{CdBb}Bd}{{ClBb}Bd}0{{BfBb}Bd}0{{CfBb}Bd}{{ChBb}Bd}{cc{}}{DdCl}1{DfBf}{DhBf}{DjBf}4{DdBf}{ClBf}66{ce{}{}}0000{Cd{{C`{AdBf}}}}{Ch{{C`{AdBf}}}}{Ch{{C`{{Bl{Cd}}Bf}}}}{Cd{{C`{jBf}}}}{Ch{{C`{jBf}}}}{Cd{{C`{AfBf}}}}{Ch{{C`{AfBf}}}}{Cd{{C`{AjBf}}}}{Ch{{C`{AjBf}}}}{ClDl}{{}{{C`{CfBf}}}}{CdDn}1{Ch{{C`{{`{{Eb{}{{E`{Cd}}}}}}Bf}}}}0{Ch{{C`{{`{{Eb{}{{E`{Ed}}}}}}Bf}}}}{{Ch{l{AbAb}}}{{C`{{Bl{Cd}}Bf}}}}{Cd{{C`{{Bn{{Bl{d}}}}Bf}}}}{{Cd{l{AbAb}}}{{C`{AfBf}}}}{{CdAb}{{C`{AfBf}}}}{{ChAb}{{C`{AfBf}}}}{{CdcAb}{{C`{AfBf}}}{{Ah{{f{d}}}}}}{cj{}}0{c{{C`{e}}}{}{}}000000000{cCb{}}0000{Cd{{C`{AfBf}}}}{Ch{{C`{AfBf}}}}{ce{}{}}0000{{CfAb}{{C`{{Cj{Ch}}Bf}}}}0```````{Ef{{C`{{l{jj}}Bf}}}}{Eh{{Cj{{l{jj}}}}}}333333333333{Ej{{C`{AfBf}}}}{El{{C`{{Bl{En}}Bf}}}}{F`Ab}{{ElAb{Cj{Ab}}}{{C`{EnBf}}}}{{EnAb{l{AbAb}}F`Ad}{{C`{EfBf}}}}{En{{C`{AjBf}}}}{Ef{{C`{AjBf}}}}{En{{C`{AfBf}}}}{Ef{{C`{AfBf}}}}{c{{C`{Eh}}}Fb}{c{{C`{Dj}}}{{Ff{Fd}}}}{F`Af}{cFd{}}00000{{EfEf}Ad}{{EnBb}Bd}{{EfBb}Bd}{{EhBb}Bd}{{F`Bb}Bd}{{ElBb}Bd}{{EjBb}Bd}{AbEh}{{Ab{l{AbAb}}}Eh}{cc{}}00000{{Efc}AfFh}{EnFj}{EfFj}{ElFj}{EjFj}{ce{}{}}00000{En{{C`{AdBf}}}}{Ef{{C`{AdBf}}}}{En{{C`{{Bl{Ef}}Bf}}}}{En{{C`{jBf}}}}{Ef{{C`{jBf}}}}{EhAb}{{El{f{c}}}{{C`{{Bl{Ed}}Bf}}}Fl}{En{{C`{AjBf}}}}{Ef{{C`{AjBf}}}}{{Fnc}{{C`{EnBf}}}{{Ff{Dn}}}}{{Fnc}{{C`{EfBf}}}{{Ff{Dn}}}}{Fn{{C`{ElBf}}}}{{Fnc}{{C`{EjBf}}}{{Ff{Dn}}}}{{El{Cj{b}}}{{C`{{G`{{Cj{b}}Ej}}Bf}}}}{F`{{f{d}}}}{{ElAb}{{C`{{Cj{En}}Bf}}}}{El{{C`{{`{{Eb{}{{E`{En}}}}}}Bf}}}}00{En{{C`{{`{{Eb{}{{E`{Ef}}}}}}Bf}}}}0{En{{C`{{`{{Eb{}{{E`{Ed}}}}}}Bf}}}}{{En{l{AbAb}}}{{C`{{Bl{Ef}}Bf}}}}{{El{l{AbAb}}}{{C`{{G`{{Bl{Ef}}{Bl{Ef}}}}Bf}}}}{{EfEj}{{C`{F`Bf}}}}{{El{f{Ef}}Ej}{{C`{{l{EfF`}}Bf}}}}{{Enc}C`Gb}{{Efc}C`Gb}{{Ehc}C`Gb}{{F`c}C`Gb}{{Ejc}C`Gb}{F`Ej}{{ElAbEn}{{C`{AfBf}}}}{{Ef{l{AbAb}}}{{C`{AfBf}}}}{{EnAb}{{C`{AfBf}}}}{{EfAb}{{C`{AfBf}}}}{{EfF`}{{C`{AfBf}}}}{{}Fd}00000{c{{C`{e}}}{}{}}00000000000{cCb{}}00000{{El{f{c}}}{{C`{{Bl{Ed}}Bf}}}Fl}{F`{{f{d}}}}{ce{}{}}00000{F`Af}```````````````````````````{Gd{{l{jGf}}}}222222222222{GhGh}{GdGd}{{ce}Af{}{}}0{{GjAb{l{AbAb}}cAd}{{C`{AfBh}}}{{Ah{{f{d}}}}}}{GdAj}{{Gj{l{AbAb}}}{{C`{AfBh}}}}{{GjGl}{{C`{AfBh}}}}{Gnc{}}{c{{C`{Gd}}}Fb}{c{{C`{Dj}}}{{Ff{Fd}}}}{GdAf}{GnAf}{cFd{}}{{BhBb}Bd}0{{H`Bb}Bd}0{{GhBb}Bd}0{{GdBb}Bd}{{GnBb}Bd}{{GjBb}Bd}{cc{}}{DdBh}{DjBh}{DfBh}{GhBh}444{{{Bl{d}}}Gn}55{ce{}{}}00000{Gj{{Bl{{C`{GdH`}}}}}}{GdAb}{{cGn}{{C`{GjBh}}}{{Ah{Hb}}}}{{}{{C`{GjBh}}}}{{Gj{l{AbAb}}}{{C`{{Cj{Gd}}Bh}}}}{GdAj}{GjGl}{{GjGlGd}{{C`{AfBh}}}}{{Gj{l{AbAb}}}{{C`{{Bl{Gd}}Bh}}}}{Gd{{Bn{{Bl{d}}}}}}{{Gdc}C`Gb}{{Gd{l{AbAb}}}Af}{{Gdc}AfHd}{{Gdc}Af{{Ah{{f{d}}}}}}{{}Fd}??{cj{}}00{c{{C`{e}}}{}{}}000{{{f{d}}}{{C`{GdBh}}}}11111111{cCb{}}00000{ce{}{}}00000{Gj{{C`{AfBh}}}}{GdAf}{GnAf}``{GfAb}4444{GfGf}{{ce}Af{}{}}{{}{{C`{HfBh}}}}{Gfc{}}{{HhGn}b}{c{{C`{Gf}}}Fb}{c{{C`{Hh}}}Fb}{c{{C`{Dj}}}{{Ff{Fd}}}}0{GfAf}{{Hhc{Cj{Hj}}}{{C`{AfBh}}}{{Ah{Hb}}}}{cFd{}}0{{GfBb}Bd}{{HhBb}Bd}{Hlc{}}{cGfHd}{cc{}}0{ce{}{}}0{{Hh{f{d}}}{{C`{AfGh}}}}{{Hh{l{ce}}b}{{C`{{Cj{Gd}}Bh}}}{{Ah{Ab}}}{{Ah{Ab}}}}{{Hh{l{ce}}b}{{C`{AfBh}}}{{Ah{Ab}}}{{Ah{Ab}}}}{{Hh{l{ce}}b}{{C`{{Bl{Gd}}Bh}}}{{Ah{Ab}}}{{Ah{Ab}}}}{{Gfc}C`Gb}{{Hhc}C`Gb}{{}Fd}07{c{{C`{e}}}{}{}}{{{f{d}}}{{C`{HhBh}}}}111{cCb{}}0::{GfAf}","c":[],"p":[[5,"Key",0],[1,"u8"],[1,"slice"],[6,"Item",0],[5,"String",501],[5,"HashMap",502],[8,"Result",0],[6,"Keyring",0],[1,"str"],[1,"bool"],[1,"unit"],[10,"AsRef",503],[5,"Duration",504],[1,"char"],[10,"FromIterator",505],[6,"Error",0],[5,"Formatter",506],[8,"Result",506],[6,"Error",80],[6,"Error",326],[5,"OwnedValue",507],[5,"Vec",508],[5,"Zeroizing",509],[6,"Result",510],[5,"TypeId",511],[5,"Item",80],[5,"Service",80],[5,"Collection",80],[6,"Option",512],[6,"ServiceError",80],[5,"MessageHeader",513],[5,"Message",514],[8,"Result",515],[6,"Error",515],[5,"Error",516],[6,"Error",517],[6,"Error",518],[5,"ErrorName",519],[5,"ObjectPath",520],[17,"Item"],[10,"Stream",521],[5,"OwnedObjectPath",520],[5,"Item",191],[5,"Properties",191],[5,"Session",191],[5,"Service",191],[5,"Collection",191],[5,"Secret",191],[10,"Deserializer",522],[5,"Signature",523],[10,"TryInto",503],[10,"Hasher",524],[5,"Proxy",525],[10,"Unlockable",191],[5,"Connection",526],[1,"tuple"],[10,"Serializer",527],[5,"Item",326],[5,"AttributeValue",454],[6,"WeakKeyError",326],[5,"Keyring",326],[1,"usize"],[5,"Secret",326],[5,"InvalidItemError",326],[5,"Path",528],[10,"ToString",501],[5,"PathBuf",528],[5,"Keyring",454],[5,"SystemTime",529],[1,"never"]],"b":[[28,"impl-Display-for-Error"],[29,"impl-Debug-for-Error"],[33,"impl-From%3CError%3E-for-Error"],[34,"impl-From%3CError%3E-for-Error"],[121,"impl-Display-for-ServiceError"],[122,"impl-Debug-for-ServiceError"],[123,"impl-Debug-for-Error"],[124,"impl-Display-for-Error"],[130,"impl-From%3CError%3E-for-Error"],[131,"impl-From%3CError%3E-for-Error"],[132,"impl-From%3CError%3E-for-Error"],[134,"impl-From%3CError%3E-for-Error"],[135,"impl-From%3CServiceError%3E-for-Error"],[380,"impl-Display-for-Error"],[381,"impl-Debug-for-Error"],[382,"impl-Debug-for-InvalidItemError"],[383,"impl-Display-for-InvalidItemError"],[384,"impl-Debug-for-WeakKeyError"],[385,"impl-Display-for-WeakKeyError"],[390,"impl-From%3CError%3E-for-Error"],[391,"impl-From%3CError%3E-for-Error"],[392,"impl-From%3CError%3E-for-Error"],[393,"impl-From%3CWeakKeyError%3E-for-Error"]],"a":{"collectionchanged":[272],"collectioncreated":[273],"collectiondeleted":[274],"createcollection":[215],"createitem":[216],"getsecret":[280],"getsecrets":[281],"itemchanged":[275],"itemcreated":[276],"itemdeleted":[277],"locked":[144,256,257],"opensession":[269],"org.freedesktop.secret.collection":[191],"org.freedesktop.secret.item":[192],"org.freedesktop.secret.session":[196],"org.freedesktop.secrets":[195],"readalias":[271],"searchitems":[278,279],"setalias":[288],"setsecret":[164,292]}}]\
 ]'));
 if (typeof exports !== 'undefined') exports.searchIndex = searchIndex;
 else if (window.initSearch) window.initSearch(searchIndex);
diff --git a/settings.html b/settings.html
index 92d608b7e..50a5e6455 100644
--- a/settings.html
+++ b/settings.html
@@ -1,2 +1,2 @@
-Settings
+Settings
     

Rustdoc settings

Back
\ No newline at end of file diff --git a/src/oo7/crypto/mod.rs.html b/src/oo7/crypto/mod.rs.html index 859c5e6d6..4f1c818e8 100644 --- a/src/oo7/crypto/mod.rs.html +++ b/src/oo7/crypto/mod.rs.html @@ -1,4 +1,4 @@ -mod.rs - source

1.0.0 (const: 1.48.0) · source

pub const fn is_ok(&self) -> bool

Returns true if the result is Ok.

\n
§Examples
\n
let x: Result<i32, &str> = Ok(-3);\nassert_eq!(x.is_ok(), true);\n\nlet x: Result<i32, &str> = Err(\"Some error message\");\nassert_eq!(x.is_ok(), false);
\n
1.70.0 · source

pub fn is_ok_and(self, f: impl FnOnce(T) -> bool) -> bool

Returns true if the result is Ok and the value inside of it matches a predicate.

\n
§Examples
\n
let x: Result<u32, &str> = Ok(2);\nassert_eq!(x.is_ok_and(|x| x > 1), true);\n\nlet x: Result<u32, &str> = Ok(0);\nassert_eq!(x.is_ok_and(|x| x > 1), false);\n\nlet x: Result<u32, &str> = Err(\"hey\");\nassert_eq!(x.is_ok_and(|x| x > 1), false);
\n
1.0.0 (const: 1.48.0) · source

pub const fn is_err(&self) -> bool

Returns true if the result is Err.

\n
§Examples
\n
let x: Result<i32, &str> = Ok(-3);\nassert_eq!(x.is_err(), false);\n\nlet x: Result<i32, &str> = Err(\"Some error message\");\nassert_eq!(x.is_err(), true);
\n
1.70.0 · source

pub fn is_err_and(self, f: impl FnOnce(E) -> bool) -> bool

Returns true if the result is Err and the value inside of it matches a predicate.

\n
§Examples
\n
use std::io::{Error, ErrorKind};\n\nlet x: Result<u32, Error> = Err(Error::new(ErrorKind::NotFound, \"!\"));\nassert_eq!(x.is_err_and(|x| x.kind() == ErrorKind::NotFound), true);\n\nlet x: Result<u32, Error> = Err(Error::new(ErrorKind::PermissionDenied, \"!\"));\nassert_eq!(x.is_err_and(|x| x.kind() == ErrorKind::NotFound), false);\n\nlet x: Result<u32, Error> = Ok(123);\nassert_eq!(x.is_err_and(|x| x.kind() == ErrorKind::NotFound), false);
\n
1.0.0 · source

pub fn ok(self) -> Option<T>

Converts from Result<T, E> to Option<T>.

\n

Converts self into an Option<T>, consuming self,\nand discarding the error, if any.

\n
§Examples
\n
let x: Result<u32, &str> = Ok(2);\nassert_eq!(x.ok(), Some(2));\n\nlet x: Result<u32, &str> = Err(\"Nothing here\");\nassert_eq!(x.ok(), None);
\n
1.0.0 · source

pub fn err(self) -> Option<E>

Converts from Result<T, E> to Option<E>.

\n

Converts self into an Option<E>, consuming self,\nand discarding the success value, if any.

\n
§Examples
\n
let x: Result<u32, &str> = Ok(2);\nassert_eq!(x.err(), None);\n\nlet x: Result<u32, &str> = Err(\"Nothing here\");\nassert_eq!(x.err(), Some(\"Nothing here\"));
\n
1.0.0 (const: 1.48.0) · source

pub const fn as_ref(&self) -> Result<&T, &E>

Converts from &Result<T, E> to Result<&T, &E>.

\n

Produces a new Result, containing a reference\ninto the original, leaving the original in place.

\n
§Examples
\n
let x: Result<u32, &str> = Ok(2);\nassert_eq!(x.as_ref(), Ok(&2));\n\nlet x: Result<u32, &str> = Err(\"Error\");\nassert_eq!(x.as_ref(), Err(&\"Error\"));
\n
1.0.0 (const: unstable) · source

pub fn as_mut(&mut self) -> Result<&mut T, &mut E>

Converts from &mut Result<T, E> to Result<&mut T, &mut E>.

\n
§Examples
\n
fn mutate(r: &mut Result<i32, i32>) {\n    match r.as_mut() {\n        Ok(v) => *v = 42,\n        Err(e) => *e = 0,\n    }\n}\n\nlet mut x: Result<i32, i32> = Ok(2);\nmutate(&mut x);\nassert_eq!(x.unwrap(), 42);\n\nlet mut x: Result<i32, i32> = Err(13);\nmutate(&mut x);\nassert_eq!(x.unwrap_err(), 0);
\n
1.0.0 · source

pub fn map<U, F>(self, op: F) -> Result<U, E>
where\n F: FnOnce(T) -> U,

Maps a Result<T, E> to Result<U, E> by applying a function to a\ncontained Ok value, leaving an Err value untouched.

\n

This function can be used to compose the results of two functions.

\n
§Examples
\n

Print the numbers on each line of a string multiplied by two.

\n\n
let line = \"1\\n2\\n3\\n4\\n\";\n\nfor num in line.lines() {\n    match num.parse::<i32>().map(|i| i * 2) {\n        Ok(n) => println!(\"{n}\"),\n        Err(..) => {}\n    }\n}
\n
1.41.0 · source

pub fn map_or<U, F>(self, default: U, f: F) -> U
where\n F: FnOnce(T) -> U,

Returns the provided default (if Err), or\napplies a function to the contained value (if Ok).

\n

Arguments passed to map_or are eagerly evaluated; if you are passing\nthe result of a function call, it is recommended to use map_or_else,\nwhich is lazily evaluated.

\n
§Examples
\n
let x: Result<_, &str> = Ok(\"foo\");\nassert_eq!(x.map_or(42, |v| v.len()), 3);\n\nlet x: Result<&str, _> = Err(\"bar\");\nassert_eq!(x.map_or(42, |v| v.len()), 42);
\n
1.41.0 · source

pub fn map_or_else<U, D, F>(self, default: D, f: F) -> U
where\n D: FnOnce(E) -> U,\n F: FnOnce(T) -> U,

Maps a Result<T, E> to U by applying fallback function default to\na contained Err value, or function f to a contained Ok value.

\n

This function can be used to unpack a successful result\nwhile handling an error.

\n
§Examples
\n
let k = 21;\n\nlet x : Result<_, &str> = Ok(\"foo\");\nassert_eq!(x.map_or_else(|e| k * 2, |v| v.len()), 3);\n\nlet x : Result<&str, _> = Err(\"bar\");\nassert_eq!(x.map_or_else(|e| k * 2, |v| v.len()), 42);
\n
1.0.0 · source

pub fn map_err<F, O>(self, op: O) -> Result<T, F>
where\n O: FnOnce(E) -> F,

Maps a Result<T, E> to Result<T, F> by applying a function to a\ncontained Err value, leaving an Ok value untouched.

\n

This function can be used to pass through a successful result while handling\nan error.

\n
§Examples
\n
fn stringify(x: u32) -> String { format!(\"error code: {x}\") }\n\nlet x: Result<u32, u32> = Ok(2);\nassert_eq!(x.map_err(stringify), Ok(2));\n\nlet x: Result<u32, u32> = Err(13);\nassert_eq!(x.map_err(stringify), Err(\"error code: 13\".to_string()));
\n
1.76.0 · source

pub fn inspect<F>(self, f: F) -> Result<T, E>
where\n F: FnOnce(&T),

Calls the provided closure with a reference to the contained value (if Ok).

\n
§Examples
\n
let x: u8 = \"4\"\n    .parse::<u8>()\n    .inspect(|x| println!(\"original: {x}\"))\n    .map(|x| x.pow(3))\n    .expect(\"failed to parse number\");
\n
1.76.0 · source

pub fn inspect_err<F>(self, f: F) -> Result<T, E>
where\n F: FnOnce(&E),

Calls the provided closure with a reference to the contained error (if Err).

\n
§Examples
\n
use std::{fs, io};\n\nfn read() -> io::Result<String> {\n    fs::read_to_string(\"address.txt\")\n        .inspect_err(|e| eprintln!(\"failed to read file: {e}\"))\n}
\n
1.47.0 · source

pub fn as_deref(&self) -> Result<&<T as Deref>::Target, &E>
where\n T: Deref,

Converts from Result<T, E> (or &Result<T, E>) to Result<&<T as Deref>::Target, &E>.

\n

Coerces the Ok variant of the original Result via Deref\nand returns the new Result.

\n
§Examples
\n
let x: Result<String, u32> = Ok(\"hello\".to_string());\nlet y: Result<&str, &u32> = Ok(\"hello\");\nassert_eq!(x.as_deref(), y);\n\nlet x: Result<String, u32> = Err(42);\nlet y: Result<&str, &u32> = Err(&42);\nassert_eq!(x.as_deref(), y);
\n
1.47.0 · source

pub fn as_deref_mut(&mut self) -> Result<&mut <T as Deref>::Target, &mut E>
where\n T: DerefMut,

Converts from Result<T, E> (or &mut Result<T, E>) to Result<&mut <T as DerefMut>::Target, &mut E>.

\n

Coerces the Ok variant of the original Result via DerefMut\nand returns the new Result.

\n
§Examples
\n
let mut s = \"HELLO\".to_string();\nlet mut x: Result<String, u32> = Ok(\"hello\".to_string());\nlet y: Result<&mut str, &mut u32> = Ok(&mut s);\nassert_eq!(x.as_deref_mut().map(|x| { x.make_ascii_uppercase(); x }), y);\n\nlet mut i = 42;\nlet mut x: Result<String, u32> = Err(42);\nlet y: Result<&mut str, &mut u32> = Err(&mut i);\nassert_eq!(x.as_deref_mut().map(|x| { x.make_ascii_uppercase(); x }), y);
\n
1.0.0 · source

pub fn iter(&self) -> Iter<'_, T>

Returns an iterator over the possibly contained value.

\n

The iterator yields one value if the result is Result::Ok, otherwise none.

\n
§Examples
\n
let x: Result<u32, &str> = Ok(7);\nassert_eq!(x.iter().next(), Some(&7));\n\nlet x: Result<u32, &str> = Err(\"nothing!\");\nassert_eq!(x.iter().next(), None);
\n
1.0.0 · source

pub fn iter_mut(&mut self) -> IterMut<'_, T>

Returns a mutable iterator over the possibly contained value.

\n

The iterator yields one value if the result is Result::Ok, otherwise none.

\n
§Examples
\n
let mut x: Result<u32, &str> = Ok(7);\nmatch x.iter_mut().next() {\n    Some(v) => *v = 40,\n    None => {},\n}\nassert_eq!(x, Ok(40));\n\nlet mut x: Result<u32, &str> = Err(\"nothing!\");\nassert_eq!(x.iter_mut().next(), None);
\n
1.4.0 · source

pub fn expect(self, msg: &str) -> T
where\n E: Debug,

Returns the contained Ok value, consuming the self value.

\n

Because this function may panic, its use is generally discouraged.\nInstead, prefer to use pattern matching and handle the Err\ncase explicitly, or call unwrap_or, unwrap_or_else, or\nunwrap_or_default.

\n
§Panics
\n

Panics if the value is an Err, with a panic message including the\npassed message, and the content of the Err.

\n
§Examples
\n
let x: Result<u32, &str> = Err(\"emergency failure\");\nx.expect(\"Testing expect\"); // panics with `Testing expect: emergency failure`
\n
§Recommended Message Style
\n

We recommend that expect messages are used to describe the reason you\nexpect the Result should be Ok.

\n\n
let path = std::env::var(\"IMPORTANT_PATH\")\n    .expect(\"env variable `IMPORTANT_PATH` should be set by `wrapper_script.sh`\");
\n

Hint: If you’re having trouble remembering how to phrase expect\nerror messages remember to focus on the word “should” as in “env\nvariable should be set by blah” or “the given binary should be available\nand executable by the current user”.

\n

For more detail on expect message styles and the reasoning behind our recommendation please\nrefer to the section on “Common Message\nStyles” in the\nstd::error module docs.

\n
1.0.0 · source

pub fn unwrap(self) -> T
where\n E: Debug,

Returns the contained Ok value, consuming the self value.

\n

Because this function may panic, its use is generally discouraged.\nInstead, prefer to use pattern matching and handle the Err\ncase explicitly, or call unwrap_or, unwrap_or_else, or\nunwrap_or_default.

\n
§Panics
\n

Panics if the value is an Err, with a panic message provided by the\nErr’s value.

\n
§Examples
\n

Basic usage:

\n\n
let x: Result<u32, &str> = Ok(2);\nassert_eq!(x.unwrap(), 2);
\n\n
let x: Result<u32, &str> = Err(\"emergency failure\");\nx.unwrap(); // panics with `emergency failure`
\n
1.16.0 · source

pub fn unwrap_or_default(self) -> T
where\n T: Default,

Returns the contained Ok value or a default

\n

Consumes the self argument then, if Ok, returns the contained\nvalue, otherwise if Err, returns the default value for that\ntype.

\n
§Examples
\n

Converts a string to an integer, turning poorly-formed strings\ninto 0 (the default value for integers). parse converts\na string to any other type that implements FromStr, returning an\nErr on error.

\n\n
let good_year_from_input = \"1909\";\nlet bad_year_from_input = \"190blarg\";\nlet good_year = good_year_from_input.parse().unwrap_or_default();\nlet bad_year = bad_year_from_input.parse().unwrap_or_default();\n\nassert_eq!(1909, good_year);\nassert_eq!(0, bad_year);
\n
1.17.0 · source

pub fn expect_err(self, msg: &str) -> E
where\n T: Debug,

Returns the contained Err value, consuming the self value.

\n
§Panics
\n

Panics if the value is an Ok, with a panic message including the\npassed message, and the content of the Ok.

\n
§Examples
\n
let x: Result<u32, &str> = Ok(10);\nx.expect_err(\"Testing expect_err\"); // panics with `Testing expect_err: 10`
\n
1.0.0 · source

pub fn unwrap_err(self) -> E
where\n T: Debug,

Returns the contained Err value, consuming the self value.

\n
§Panics
\n

Panics if the value is an Ok, with a custom panic message provided\nby the Ok’s value.

\n
§Examples
\n
let x: Result<u32, &str> = Ok(2);\nx.unwrap_err(); // panics with `2`
\n\n
let x: Result<u32, &str> = Err(\"emergency failure\");\nassert_eq!(x.unwrap_err(), \"emergency failure\");
\n
source

pub fn into_ok(self) -> T
where\n E: Into<!>,

🔬This is a nightly-only experimental API. (unwrap_infallible)

Returns the contained Ok value, but never panics.

\n

Unlike unwrap, this method is known to never panic on the\nresult types it is implemented for. Therefore, it can be used\ninstead of unwrap as a maintainability safeguard that will fail\nto compile if the error type of the Result is later changed\nto an error that can actually occur.

\n
§Examples
\n
\nfn only_good_news() -> Result<String, !> {\n    Ok(\"this is fine\".into())\n}\n\nlet s: String = only_good_news().into_ok();\nprintln!(\"{s}\");
\n
source

pub fn into_err(self) -> E
where\n T: Into<!>,

🔬This is a nightly-only experimental API. (unwrap_infallible)

Returns the contained Err value, but never panics.

\n

Unlike unwrap_err, this method is known to never panic on the\nresult types it is implemented for. Therefore, it can be used\ninstead of unwrap_err as a maintainability safeguard that will fail\nto compile if the ok type of the Result is later changed\nto a type that can actually occur.

\n
§Examples
\n
\nfn only_bad_news() -> Result<!, String> {\n    Err(\"Oops, it failed\".into())\n}\n\nlet error: String = only_bad_news().into_err();\nprintln!(\"{error}\");
\n
1.0.0 · source

pub fn and<U>(self, res: Result<U, E>) -> Result<U, E>

Returns res if the result is Ok, otherwise returns the Err value of self.

\n

Arguments passed to and are eagerly evaluated; if you are passing the\nresult of a function call, it is recommended to use and_then, which is\nlazily evaluated.

\n
§Examples
\n
let x: Result<u32, &str> = Ok(2);\nlet y: Result<&str, &str> = Err(\"late error\");\nassert_eq!(x.and(y), Err(\"late error\"));\n\nlet x: Result<u32, &str> = Err(\"early error\");\nlet y: Result<&str, &str> = Ok(\"foo\");\nassert_eq!(x.and(y), Err(\"early error\"));\n\nlet x: Result<u32, &str> = Err(\"not a 2\");\nlet y: Result<&str, &str> = Err(\"late error\");\nassert_eq!(x.and(y), Err(\"not a 2\"));\n\nlet x: Result<u32, &str> = Ok(2);\nlet y: Result<&str, &str> = Ok(\"different result type\");\nassert_eq!(x.and(y), Ok(\"different result type\"));
\n
1.0.0 · source

pub fn and_then<U, F>(self, op: F) -> Result<U, E>
where\n F: FnOnce(T) -> Result<U, E>,

Calls op if the result is Ok, otherwise returns the Err value of self.

\n

This function can be used for control flow based on Result values.

\n
§Examples
\n
fn sq_then_to_string(x: u32) -> Result<String, &'static str> {\n    x.checked_mul(x).map(|sq| sq.to_string()).ok_or(\"overflowed\")\n}\n\nassert_eq!(Ok(2).and_then(sq_then_to_string), Ok(4.to_string()));\nassert_eq!(Ok(1_000_000).and_then(sq_then_to_string), Err(\"overflowed\"));\nassert_eq!(Err(\"not a number\").and_then(sq_then_to_string), Err(\"not a number\"));
\n

Often used to chain fallible operations that may return Err.

\n\n
use std::{io::ErrorKind, path::Path};\n\n// Note: on Windows \"/\" maps to \"C:\\\"\nlet root_modified_time = Path::new(\"/\").metadata().and_then(|md| md.modified());\nassert!(root_modified_time.is_ok());\n\nlet should_fail = Path::new(\"/bad/path\").metadata().and_then(|md| md.modified());\nassert!(should_fail.is_err());\nassert_eq!(should_fail.unwrap_err().kind(), ErrorKind::NotFound);
\n
1.0.0 · source

pub fn or<F>(self, res: Result<T, F>) -> Result<T, F>

Returns res if the result is Err, otherwise returns the Ok value of self.

\n

Arguments passed to or are eagerly evaluated; if you are passing the\nresult of a function call, it is recommended to use or_else, which is\nlazily evaluated.

\n
§Examples
\n
let x: Result<u32, &str> = Ok(2);\nlet y: Result<u32, &str> = Err(\"late error\");\nassert_eq!(x.or(y), Ok(2));\n\nlet x: Result<u32, &str> = Err(\"early error\");\nlet y: Result<u32, &str> = Ok(2);\nassert_eq!(x.or(y), Ok(2));\n\nlet x: Result<u32, &str> = Err(\"not a 2\");\nlet y: Result<u32, &str> = Err(\"late error\");\nassert_eq!(x.or(y), Err(\"late error\"));\n\nlet x: Result<u32, &str> = Ok(2);\nlet y: Result<u32, &str> = Ok(100);\nassert_eq!(x.or(y), Ok(2));
\n
1.0.0 · source

pub fn or_else<F, O>(self, op: O) -> Result<T, F>
where\n O: FnOnce(E) -> Result<T, F>,

Calls op if the result is Err, otherwise returns the Ok value of self.

\n

This function can be used for control flow based on result values.

\n
§Examples
\n
fn sq(x: u32) -> Result<u32, u32> { Ok(x * x) }\nfn err(x: u32) -> Result<u32, u32> { Err(x) }\n\nassert_eq!(Ok(2).or_else(sq).or_else(sq), Ok(2));\nassert_eq!(Ok(2).or_else(err).or_else(sq), Ok(2));\nassert_eq!(Err(3).or_else(sq).or_else(err), Ok(9));\nassert_eq!(Err(3).or_else(err).or_else(err), Err(3));
\n
1.0.0 · source

pub fn unwrap_or(self, default: T) -> T

Returns the contained Ok value or a provided default.

\n

Arguments passed to unwrap_or are eagerly evaluated; if you are passing\nthe result of a function call, it is recommended to use unwrap_or_else,\nwhich is lazily evaluated.

\n
§Examples
\n
let default = 2;\nlet x: Result<u32, &str> = Ok(9);\nassert_eq!(x.unwrap_or(default), 9);\n\nlet x: Result<u32, &str> = Err(\"error\");\nassert_eq!(x.unwrap_or(default), default);
\n
1.0.0 · source

pub fn unwrap_or_else<F>(self, op: F) -> T
where\n F: FnOnce(E) -> T,

Returns the contained Ok value or computes it from a closure.

\n
§Examples
\n
fn count(x: &str) -> usize { x.len() }\n\nassert_eq!(Ok(2).unwrap_or_else(count), 2);\nassert_eq!(Err(\"foo\").unwrap_or_else(count), 3);
\n
1.58.0 · source

pub unsafe fn unwrap_unchecked(self) -> T

Returns the contained Ok value, consuming the self value,\nwithout checking that the value is not an Err.

\n
§Safety
\n

Calling this method on an Err is undefined behavior.

\n
§Examples
\n
let x: Result<u32, &str> = Ok(2);\nassert_eq!(unsafe { x.unwrap_unchecked() }, 2);
\n\n
let x: Result<u32, &str> = Err(\"emergency failure\");\nunsafe { x.unwrap_unchecked(); } // Undefined behavior!
\n
1.58.0 · source

pub unsafe fn unwrap_err_unchecked(self) -> E

Returns the contained Err value, consuming the self value,\nwithout checking that the value is not an Ok.

\n
§Safety
\n

Calling this method on an Ok is undefined behavior.

\n
§Examples
\n
let x: Result<u32, &str> = Ok(2);\nunsafe { x.unwrap_err_unchecked() }; // Undefined behavior!
\n\n
let x: Result<u32, &str> = Err(\"emergency failure\");\nassert_eq!(unsafe { x.unwrap_err_unchecked() }, \"emergency failure\");
\n
",0,"oo7::error::Result"],["
source§

impl<T, E> Result<&T, E>

1.59.0 · source

pub fn copied(self) -> Result<T, E>
where\n T: Copy,

Maps a Result<&T, E> to a Result<T, E> by copying the contents of the\nOk part.

\n
§Examples
\n
let val = 12;\nlet x: Result<&i32, i32> = Ok(&val);\nassert_eq!(x, Ok(&12));\nlet copied = x.copied();\nassert_eq!(copied, Ok(12));
\n
1.59.0 · source

pub fn cloned(self) -> Result<T, E>
where\n T: Clone,

Maps a Result<&T, E> to a Result<T, E> by cloning the contents of the\nOk part.

\n
§Examples
\n
let val = 12;\nlet x: Result<&i32, i32> = Ok(&val);\nassert_eq!(x, Ok(&12));\nlet cloned = x.cloned();\nassert_eq!(cloned, Ok(12));
\n
",0,"oo7::error::Result"],["
source§

impl<T, E> Result<&mut T, E>

1.59.0 · source

pub fn copied(self) -> Result<T, E>
where\n T: Copy,

Maps a Result<&mut T, E> to a Result<T, E> by copying the contents of the\nOk part.

\n
§Examples
\n
let mut val = 12;\nlet x: Result<&mut i32, i32> = Ok(&mut val);\nassert_eq!(x, Ok(&mut 12));\nlet copied = x.copied();\nassert_eq!(copied, Ok(12));
\n
1.59.0 · source

pub fn cloned(self) -> Result<T, E>
where\n T: Clone,

Maps a Result<&mut T, E> to a Result<T, E> by cloning the contents of the\nOk part.

\n
§Examples
\n
let mut val = 12;\nlet x: Result<&mut i32, i32> = Ok(&mut val);\nassert_eq!(x, Ok(&mut 12));\nlet cloned = x.cloned();\nassert_eq!(cloned, Ok(12));
\n
",0,"oo7::error::Result"],["
source§

impl<T, E> Result<Option<T>, E>

1.33.0 (const: unstable) · source

pub fn transpose(self) -> Option<Result<T, E>>

Transposes a Result of an Option into an Option of a Result.

\n

Ok(None) will be mapped to None.\nOk(Some(_)) and Err(_) will be mapped to Some(Ok(_)) and Some(Err(_)).

\n
§Examples
\n
#[derive(Debug, Eq, PartialEq)]\nstruct SomeErr;\n\nlet x: Result<Option<i32>, SomeErr> = Ok(Some(5));\nlet y: Option<Result<i32, SomeErr>> = Some(Ok(5));\nassert_eq!(x.transpose(), y);
\n
",0,"oo7::error::Result"],["
source§

impl<T, E> Result<Result<T, E>, E>

source

pub fn flatten(self) -> Result<T, E>

🔬This is a nightly-only experimental API. (result_flattening)

Converts from Result<Result<T, E>, E> to Result<T, E>

\n
§Examples
\n
#![feature(result_flattening)]\nlet x: Result<Result<&'static str, u32>, u32> = Ok(Ok(\"hello\"));\nassert_eq!(Ok(\"hello\"), x.flatten());\n\nlet x: Result<Result<&'static str, u32>, u32> = Ok(Err(6));\nassert_eq!(Err(6), x.flatten());\n\nlet x: Result<Result<&'static str, u32>, u32> = Err(6);\nassert_eq!(Err(6), x.flatten());
\n

Flattening only removes one level of nesting at a time:

\n\n
#![feature(result_flattening)]\nlet x: Result<Result<Result<&'static str, u32>, u32>, u32> = Ok(Ok(Ok(\"hello\")));\nassert_eq!(Ok(Ok(\"hello\")), x.flatten());\nassert_eq!(Ok(\"hello\"), x.flatten().flatten());
\n
",0,"oo7::error::Result"],["
1.61.0 · source§

impl<T, E> Termination for Result<T, E>
where\n T: Termination,\n E: Debug,

source§

fn report(self) -> ExitCode

Is called to get the representation of the value as status code.\nThis status code is returned to the operating system.
","Termination","oo7::error::Result"],["
1.0.0 · source§

impl<T, E> StructuralPartialEq for Result<T, E>

","StructuralPartialEq","oo7::error::Result"],["
source§

impl<T, E> Residual<T> for Result<Infallible, E>

§

type TryType = Result<T, E>

🔬This is a nightly-only experimental API. (try_trait_v2_residual)
The “return” type of this meta-function.
","Residual","oo7::error::Result"],["
1.0.0 · source§

impl<T, E> Eq for Result<T, E>
where\n T: Eq,\n E: Eq,

","Eq","oo7::error::Result"],["
1.0.0 · source§

impl<T, E> Ord for Result<T, E>
where\n T: Ord,\n E: Ord,

source§

fn cmp(&self, other: &Result<T, E>) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where\n Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where\n Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where\n Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
","Ord","oo7::error::Result"],["
1.0.0 · source§

impl<T, E> IntoIterator for Result<T, E>

source§

fn into_iter(self) -> IntoIter<T>

Returns a consuming iterator over the possibly contained value.

\n

The iterator yields one value if the result is Result::Ok, otherwise none.

\n
§Examples
\n
let x: Result<u32, &str> = Ok(5);\nlet v: Vec<u32> = x.into_iter().collect();\nassert_eq!(v, [5]);\n\nlet x: Result<u32, &str> = Err(\"nothing!\");\nlet v: Vec<u32> = x.into_iter().collect();\nassert_eq!(v, []);
\n
§

type Item = T

The type of the elements being iterated over.
§

type IntoIter = IntoIter<T>

Which kind of iterator are we turning this into?
","IntoIterator","oo7::error::Result"],["
1.0.0 · source§

impl<T, E> Debug for Result<T, E>
where\n T: Debug,\n E: Debug,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
","Debug","oo7::error::Result"],["
1.0.0 · source§

impl<T, E> Copy for Result<T, E>
where\n T: Copy,\n E: Copy,

","Copy","oo7::error::Result"],["
1.0.0 · source§

impl<T, E> PartialEq for Result<T, E>
where\n T: PartialEq,\n E: PartialEq,

source§

fn eq(&self, other: &Result<T, E>) -> bool

This method tests for self and other values to be equal, and is used\nby ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always\nsufficient, and should not be overridden without very good reason.
","PartialEq","oo7::error::Result"],["
1.16.0 · source§

impl<T, U, E> Sum<Result<U, E>> for Result<T, E>
where\n T: Sum<U>,

source§

fn sum<I>(iter: I) -> Result<T, E>
where\n I: Iterator<Item = Result<U, E>>,

Takes each element in the Iterator: if it is an Err, no further\nelements are taken, and the Err is returned. Should no Err\noccur, the sum of all elements is returned.

\n
§Examples
\n

This sums up every integer in a vector, rejecting the sum if a negative\nelement is encountered:

\n\n
let f = |&x: &i32| if x < 0 { Err(\"Negative element found\") } else { Ok(x) };\nlet v = vec![1, 2];\nlet res: Result<i32, _> = v.iter().map(f).sum();\nassert_eq!(res, Ok(3));\nlet v = vec![1, -2];\nlet res: Result<i32, _> = v.iter().map(f).sum();\nassert_eq!(res, Err(\"Negative element found\"));
\n
","Sum>","oo7::error::Result"],["
1.0.0 · source§

impl<T, E> StructuralEq for Result<T, E>

","StructuralEq","oo7::error::Result"],["
source§

impl<T, E, F> FromResidual<Yeet<E>> for Result<T, F>
where\n F: From<E>,

source§

fn from_residual(_: Yeet<E>) -> Result<T, F>

🔬This is a nightly-only experimental API. (try_trait_v2)
Constructs the type from a compatible Residual type. Read more
","FromResidual>","oo7::error::Result"],["
source§

impl<T, E, F> FromResidual<Result<Infallible, E>> for Result<T, F>
where\n F: From<E>,

source§

fn from_residual(residual: Result<Infallible, E>) -> Result<T, F>

🔬This is a nightly-only experimental API. (try_trait_v2)
Constructs the type from a compatible Residual type. Read more
","FromResidual>","oo7::error::Result"],["
1.16.0 · source§

impl<T, U, E> Product<Result<U, E>> for Result<T, E>
where\n T: Product<U>,

source§

fn product<I>(iter: I) -> Result<T, E>
where\n I: Iterator<Item = Result<U, E>>,

Takes each element in the Iterator: if it is an Err, no further\nelements are taken, and the Err is returned. Should no Err\noccur, the product of all elements is returned.

\n
§Examples
\n

This multiplies each number in a vector of strings,\nif a string could not be parsed the operation returns Err:

\n\n
let nums = vec![\"5\", \"10\", \"1\", \"2\"];\nlet total: Result<usize, _> = nums.iter().map(|w| w.parse::<usize>()).product();\nassert_eq!(total, Ok(100));\nlet nums = vec![\"5\", \"10\", \"one\", \"2\"];\nlet total: Result<usize, _> = nums.iter().map(|w| w.parse::<usize>()).product();\nassert!(total.is_err());
\n
","Product>","oo7::error::Result"],["
1.0.0 · source§

impl<T, E> PartialOrd for Result<T, E>
where\n T: PartialOrd,\n E: PartialOrd,

source§

fn partial_cmp(&self, other: &Result<T, E>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <=\noperator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >=\noperator. Read more
","PartialOrd","oo7::error::Result"],["
source§

impl<T, E> Try for Result<T, E>

§

type Output = T

🔬This is a nightly-only experimental API. (try_trait_v2)
The type of the value produced by ? when not short-circuiting.
§

type Residual = Result<Infallible, E>

🔬This is a nightly-only experimental API. (try_trait_v2)
The type of the value passed to FromResidual::from_residual\nas part of ? when short-circuiting. Read more
source§

fn from_output(output: <Result<T, E> as Try>::Output) -> Result<T, E>

🔬This is a nightly-only experimental API. (try_trait_v2)
Constructs the type from its Output type. Read more
source§

fn branch(\n self\n) -> ControlFlow<<Result<T, E> as Try>::Residual, <Result<T, E> as Try>::Output>

🔬This is a nightly-only experimental API. (try_trait_v2)
Used in ? to decide whether the operator should produce a value\n(because this returned ControlFlow::Continue)\nor propagate a value back to the caller\n(because this returned ControlFlow::Break). Read more
","Try","oo7::error::Result"],["
1.0.0 · source§

impl<A, E, V> FromIterator<Result<A, E>> for Result<V, E>
where\n V: FromIterator<A>,

source§

fn from_iter<I>(iter: I) -> Result<V, E>
where\n I: IntoIterator<Item = Result<A, E>>,

Takes each element in the Iterator: if it is an Err, no further\nelements are taken, and the Err is returned. Should no Err occur, a\ncontainer with the values of each Result is returned.

\n

Here is an example which increments every integer in a vector,\nchecking for overflow:

\n\n
let v = vec![1, 2];\nlet res: Result<Vec<u32>, &'static str> = v.iter().map(|x: &u32|\n    x.checked_add(1).ok_or(\"Overflow!\")\n).collect();\nassert_eq!(res, Ok(vec![2, 3]));
\n

Here is another example that tries to subtract one from another list\nof integers, this time checking for underflow:

\n\n
let v = vec![1, 2, 0];\nlet res: Result<Vec<u32>, &'static str> = v.iter().map(|x: &u32|\n    x.checked_sub(1).ok_or(\"Underflow!\")\n).collect();\nassert_eq!(res, Err(\"Underflow!\"));
\n

Here is a variation on the previous example, showing that no\nfurther elements are taken from iter after the first Err.

\n\n
let v = vec![3, 2, 1, 10];\nlet mut shared = 0;\nlet res: Result<Vec<u32>, &'static str> = v.iter().map(|x: &u32| {\n    shared += x;\n    x.checked_sub(2).ok_or(\"Underflow!\")\n}).collect();\nassert_eq!(res, Err(\"Underflow!\"));\nassert_eq!(shared, 6);
\n

Since the third element caused an underflow, no further elements were taken,\nso the final value of shared is 6 (= 3 + 2 + 1), not 16.

\n
","FromIterator>","oo7::error::Result"],["
1.0.0 · source§

impl<T, E> Clone for Result<T, E>
where\n T: Clone,\n E: Clone,

source§

fn clone(&self) -> Result<T, E>

Returns a copy of the value. Read more
source§

fn clone_from(&mut self, source: &Result<T, E>)

Performs copy-assignment from source. Read more
","Clone","oo7::error::Result"],["
1.0.0 · source§

impl<T, E> Hash for Result<T, E>
where\n T: Hash,\n E: Hash,

source§

fn hash<__H>(&self, state: &mut __H)
where\n __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where\n H: Hasher,\n Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
","Hash","oo7::error::Result"],["
§

impl<T, E> ResultAdapter for Result<T, E>

§

type Ok = T

§

type Err = E

","ResultAdapter","oo7::error::Result"],["
source§

impl<'de, T, E> Deserialize<'de> for Result<T, E>
where\n T: Deserialize<'de>,\n E: Deserialize<'de>,

source§

fn deserialize<D>(\n deserializer: D\n) -> Result<Result<T, E>, <D as Deserializer<'de>>::Error>
where\n D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
","Deserialize<'de>","oo7::error::Result"],["
source§

impl<T, E> Serialize for Result<T, E>
where\n T: Serialize,\n E: Serialize,

source§

fn serialize<S>(\n &self,\n serializer: S\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>
where\n S: Serializer,

Serialize this value into the given Serde serializer. Read more
","Serialize","oo7::error::Result"]] +"oo7":[["
1.0.0 · source§

impl<T, E> Clone for Result<T, E>
where\n T: Clone,\n E: Clone,

source§

fn clone(&self) -> Result<T, E>

Returns a copy of the value. Read more
source§

fn clone_from(&mut self, source: &Result<T, E>)

Performs copy-assignment from source. Read more
","Clone","oo7::error::Result"],["
1.0.0 · source§

impl<T, E> Debug for Result<T, E>
where\n T: Debug,\n E: Debug,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
","Debug","oo7::error::Result"],["
source§

impl<'de, T, E> Deserialize<'de> for Result<T, E>
where\n T: Deserialize<'de>,\n E: Deserialize<'de>,

source§

fn deserialize<D>(\n deserializer: D\n) -> Result<Result<T, E>, <D as Deserializer<'de>>::Error>
where\n D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
","Deserialize<'de>","oo7::error::Result"],["
1.0.0 · source§

impl<A, E, V> FromIterator<Result<A, E>> for Result<V, E>
where\n V: FromIterator<A>,

source§

fn from_iter<I>(iter: I) -> Result<V, E>
where\n I: IntoIterator<Item = Result<A, E>>,

Takes each element in the Iterator: if it is an Err, no further\nelements are taken, and the Err is returned. Should no Err occur, a\ncontainer with the values of each Result is returned.

\n

Here is an example which increments every integer in a vector,\nchecking for overflow:

\n\n
let v = vec![1, 2];\nlet res: Result<Vec<u32>, &'static str> = v.iter().map(|x: &u32|\n    x.checked_add(1).ok_or(\"Overflow!\")\n).collect();\nassert_eq!(res, Ok(vec![2, 3]));
\n

Here is another example that tries to subtract one from another list\nof integers, this time checking for underflow:

\n\n
let v = vec![1, 2, 0];\nlet res: Result<Vec<u32>, &'static str> = v.iter().map(|x: &u32|\n    x.checked_sub(1).ok_or(\"Underflow!\")\n).collect();\nassert_eq!(res, Err(\"Underflow!\"));
\n

Here is a variation on the previous example, showing that no\nfurther elements are taken from iter after the first Err.

\n\n
let v = vec![3, 2, 1, 10];\nlet mut shared = 0;\nlet res: Result<Vec<u32>, &'static str> = v.iter().map(|x: &u32| {\n    shared += x;\n    x.checked_sub(2).ok_or(\"Underflow!\")\n}).collect();\nassert_eq!(res, Err(\"Underflow!\"));\nassert_eq!(shared, 6);
\n

Since the third element caused an underflow, no further elements were taken,\nso the final value of shared is 6 (= 3 + 2 + 1), not 16.

\n
","FromIterator>","oo7::error::Result"],["
source§

impl<T, E, F> FromResidual<Result<Infallible, E>> for Result<T, F>
where\n F: From<E>,

source§

fn from_residual(residual: Result<Infallible, E>) -> Result<T, F>

🔬This is a nightly-only experimental API. (try_trait_v2)
Constructs the type from a compatible Residual type. Read more
","FromResidual>","oo7::error::Result"],["
source§

impl<T, E, F> FromResidual<Yeet<E>> for Result<T, F>
where\n F: From<E>,

source§

fn from_residual(_: Yeet<E>) -> Result<T, F>

🔬This is a nightly-only experimental API. (try_trait_v2)
Constructs the type from a compatible Residual type. Read more
","FromResidual>","oo7::error::Result"],["
1.0.0 · source§

impl<T, E> Hash for Result<T, E>
where\n T: Hash,\n E: Hash,

source§

fn hash<__H>(&self, state: &mut __H)
where\n __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where\n H: Hasher,\n Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
","Hash","oo7::error::Result"],["
1.0.0 · source§

impl<T, E> IntoIterator for Result<T, E>

source§

fn into_iter(self) -> IntoIter<T>

Returns a consuming iterator over the possibly contained value.

\n

The iterator yields one value if the result is Result::Ok, otherwise none.

\n
§Examples
\n
let x: Result<u32, &str> = Ok(5);\nlet v: Vec<u32> = x.into_iter().collect();\nassert_eq!(v, [5]);\n\nlet x: Result<u32, &str> = Err(\"nothing!\");\nlet v: Vec<u32> = x.into_iter().collect();\nassert_eq!(v, []);
\n
§

type Item = T

The type of the elements being iterated over.
§

type IntoIter = IntoIter<T>

Which kind of iterator are we turning this into?
","IntoIterator","oo7::error::Result"],["
1.0.0 · source§

impl<T, E> Ord for Result<T, E>
where\n T: Ord,\n E: Ord,

source§

fn cmp(&self, other: &Result<T, E>) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where\n Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where\n Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where\n Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
","Ord","oo7::error::Result"],["
1.0.0 · source§

impl<T, E> PartialEq for Result<T, E>
where\n T: PartialEq,\n E: PartialEq,

source§

fn eq(&self, other: &Result<T, E>) -> bool

This method tests for self and other values to be equal, and is used\nby ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always\nsufficient, and should not be overridden without very good reason.
","PartialEq","oo7::error::Result"],["
1.0.0 · source§

impl<T, E> PartialOrd for Result<T, E>
where\n T: PartialOrd,\n E: PartialOrd,

source§

fn partial_cmp(&self, other: &Result<T, E>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <=\noperator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >=\noperator. Read more
","PartialOrd","oo7::error::Result"],["
1.16.0 · source§

impl<T, U, E> Product<Result<U, E>> for Result<T, E>
where\n T: Product<U>,

source§

fn product<I>(iter: I) -> Result<T, E>
where\n I: Iterator<Item = Result<U, E>>,

Takes each element in the Iterator: if it is an Err, no further\nelements are taken, and the Err is returned. Should no Err\noccur, the product of all elements is returned.

\n
§Examples
\n

This multiplies each number in a vector of strings,\nif a string could not be parsed the operation returns Err:

\n\n
let nums = vec![\"5\", \"10\", \"1\", \"2\"];\nlet total: Result<usize, _> = nums.iter().map(|w| w.parse::<usize>()).product();\nassert_eq!(total, Ok(100));\nlet nums = vec![\"5\", \"10\", \"one\", \"2\"];\nlet total: Result<usize, _> = nums.iter().map(|w| w.parse::<usize>()).product();\nassert!(total.is_err());
\n
","Product>","oo7::error::Result"],["
source§

impl<T, E> Residual<T> for Result<Infallible, E>

§

type TryType = Result<T, E>

🔬This is a nightly-only experimental API. (try_trait_v2_residual)
The “return” type of this meta-function.
","Residual","oo7::error::Result"],["
source§

impl<T, E> Result<&T, E>

1.59.0 · source

pub fn copied(self) -> Result<T, E>
where\n T: Copy,

Maps a Result<&T, E> to a Result<T, E> by copying the contents of the\nOk part.

\n
§Examples
\n
let val = 12;\nlet x: Result<&i32, i32> = Ok(&val);\nassert_eq!(x, Ok(&12));\nlet copied = x.copied();\nassert_eq!(copied, Ok(12));
\n
1.59.0 · source

pub fn cloned(self) -> Result<T, E>
where\n T: Clone,

Maps a Result<&T, E> to a Result<T, E> by cloning the contents of the\nOk part.

\n
§Examples
\n
let val = 12;\nlet x: Result<&i32, i32> = Ok(&val);\nassert_eq!(x, Ok(&12));\nlet cloned = x.cloned();\nassert_eq!(cloned, Ok(12));
\n
",0,"oo7::error::Result"],["
source§

impl<T, E> Result<&mut T, E>

1.59.0 · source

pub fn copied(self) -> Result<T, E>
where\n T: Copy,

Maps a Result<&mut T, E> to a Result<T, E> by copying the contents of the\nOk part.

\n
§Examples
\n
let mut val = 12;\nlet x: Result<&mut i32, i32> = Ok(&mut val);\nassert_eq!(x, Ok(&mut 12));\nlet copied = x.copied();\nassert_eq!(copied, Ok(12));
\n
1.59.0 · source

pub fn cloned(self) -> Result<T, E>
where\n T: Clone,

Maps a Result<&mut T, E> to a Result<T, E> by cloning the contents of the\nOk part.

\n
§Examples
\n
let mut val = 12;\nlet x: Result<&mut i32, i32> = Ok(&mut val);\nassert_eq!(x, Ok(&mut 12));\nlet cloned = x.cloned();\nassert_eq!(cloned, Ok(12));
\n
",0,"oo7::error::Result"],["
source§

impl<T, E> Result<Option<T>, E>

1.33.0 (const: unstable) · source

pub fn transpose(self) -> Option<Result<T, E>>

Transposes a Result of an Option into an Option of a Result.

\n

Ok(None) will be mapped to None.\nOk(Some(_)) and Err(_) will be mapped to Some(Ok(_)) and Some(Err(_)).

\n
§Examples
\n
#[derive(Debug, Eq, PartialEq)]\nstruct SomeErr;\n\nlet x: Result<Option<i32>, SomeErr> = Ok(Some(5));\nlet y: Option<Result<i32, SomeErr>> = Some(Ok(5));\nassert_eq!(x.transpose(), y);
\n
",0,"oo7::error::Result"],["
source§

impl<T, E> Result<Result<T, E>, E>

source

pub fn flatten(self) -> Result<T, E>

🔬This is a nightly-only experimental API. (result_flattening)

Converts from Result<Result<T, E>, E> to Result<T, E>

\n
§Examples
\n
#![feature(result_flattening)]\nlet x: Result<Result<&'static str, u32>, u32> = Ok(Ok(\"hello\"));\nassert_eq!(Ok(\"hello\"), x.flatten());\n\nlet x: Result<Result<&'static str, u32>, u32> = Ok(Err(6));\nassert_eq!(Err(6), x.flatten());\n\nlet x: Result<Result<&'static str, u32>, u32> = Err(6);\nassert_eq!(Err(6), x.flatten());
\n

Flattening only removes one level of nesting at a time:

\n\n
#![feature(result_flattening)]\nlet x: Result<Result<Result<&'static str, u32>, u32>, u32> = Ok(Ok(Ok(\"hello\")));\nassert_eq!(Ok(Ok(\"hello\")), x.flatten());\nassert_eq!(Ok(\"hello\"), x.flatten().flatten());
\n
",0,"oo7::error::Result"],["
source§

impl<T, E> Result<T, E>

1.0.0 (const: 1.48.0) · source

pub const fn is_ok(&self) -> bool

Returns true if the result is Ok.

\n
§Examples
\n
let x: Result<i32, &str> = Ok(-3);\nassert_eq!(x.is_ok(), true);\n\nlet x: Result<i32, &str> = Err(\"Some error message\");\nassert_eq!(x.is_ok(), false);
\n
1.70.0 · source

pub fn is_ok_and(self, f: impl FnOnce(T) -> bool) -> bool

Returns true if the result is Ok and the value inside of it matches a predicate.

\n
§Examples
\n
let x: Result<u32, &str> = Ok(2);\nassert_eq!(x.is_ok_and(|x| x > 1), true);\n\nlet x: Result<u32, &str> = Ok(0);\nassert_eq!(x.is_ok_and(|x| x > 1), false);\n\nlet x: Result<u32, &str> = Err(\"hey\");\nassert_eq!(x.is_ok_and(|x| x > 1), false);
\n
1.0.0 (const: 1.48.0) · source

pub const fn is_err(&self) -> bool

Returns true if the result is Err.

\n
§Examples
\n
let x: Result<i32, &str> = Ok(-3);\nassert_eq!(x.is_err(), false);\n\nlet x: Result<i32, &str> = Err(\"Some error message\");\nassert_eq!(x.is_err(), true);
\n
1.70.0 · source

pub fn is_err_and(self, f: impl FnOnce(E) -> bool) -> bool

Returns true if the result is Err and the value inside of it matches a predicate.

\n
§Examples
\n
use std::io::{Error, ErrorKind};\n\nlet x: Result<u32, Error> = Err(Error::new(ErrorKind::NotFound, \"!\"));\nassert_eq!(x.is_err_and(|x| x.kind() == ErrorKind::NotFound), true);\n\nlet x: Result<u32, Error> = Err(Error::new(ErrorKind::PermissionDenied, \"!\"));\nassert_eq!(x.is_err_and(|x| x.kind() == ErrorKind::NotFound), false);\n\nlet x: Result<u32, Error> = Ok(123);\nassert_eq!(x.is_err_and(|x| x.kind() == ErrorKind::NotFound), false);
\n
1.0.0 · source

pub fn ok(self) -> Option<T>

Converts from Result<T, E> to Option<T>.

\n

Converts self into an Option<T>, consuming self,\nand discarding the error, if any.

\n
§Examples
\n
let x: Result<u32, &str> = Ok(2);\nassert_eq!(x.ok(), Some(2));\n\nlet x: Result<u32, &str> = Err(\"Nothing here\");\nassert_eq!(x.ok(), None);
\n
1.0.0 · source

pub fn err(self) -> Option<E>

Converts from Result<T, E> to Option<E>.

\n

Converts self into an Option<E>, consuming self,\nand discarding the success value, if any.

\n
§Examples
\n
let x: Result<u32, &str> = Ok(2);\nassert_eq!(x.err(), None);\n\nlet x: Result<u32, &str> = Err(\"Nothing here\");\nassert_eq!(x.err(), Some(\"Nothing here\"));
\n
1.0.0 (const: 1.48.0) · source

pub const fn as_ref(&self) -> Result<&T, &E>

Converts from &Result<T, E> to Result<&T, &E>.

\n

Produces a new Result, containing a reference\ninto the original, leaving the original in place.

\n
§Examples
\n
let x: Result<u32, &str> = Ok(2);\nassert_eq!(x.as_ref(), Ok(&2));\n\nlet x: Result<u32, &str> = Err(\"Error\");\nassert_eq!(x.as_ref(), Err(&\"Error\"));
\n
1.0.0 (const: unstable) · source

pub fn as_mut(&mut self) -> Result<&mut T, &mut E>

Converts from &mut Result<T, E> to Result<&mut T, &mut E>.

\n
§Examples
\n
fn mutate(r: &mut Result<i32, i32>) {\n    match r.as_mut() {\n        Ok(v) => *v = 42,\n        Err(e) => *e = 0,\n    }\n}\n\nlet mut x: Result<i32, i32> = Ok(2);\nmutate(&mut x);\nassert_eq!(x.unwrap(), 42);\n\nlet mut x: Result<i32, i32> = Err(13);\nmutate(&mut x);\nassert_eq!(x.unwrap_err(), 0);
\n
1.0.0 · source

pub fn map<U, F>(self, op: F) -> Result<U, E>
where\n F: FnOnce(T) -> U,

Maps a Result<T, E> to Result<U, E> by applying a function to a\ncontained Ok value, leaving an Err value untouched.

\n

This function can be used to compose the results of two functions.

\n
§Examples
\n

Print the numbers on each line of a string multiplied by two.

\n\n
let line = \"1\\n2\\n3\\n4\\n\";\n\nfor num in line.lines() {\n    match num.parse::<i32>().map(|i| i * 2) {\n        Ok(n) => println!(\"{n}\"),\n        Err(..) => {}\n    }\n}
\n
1.41.0 · source

pub fn map_or<U, F>(self, default: U, f: F) -> U
where\n F: FnOnce(T) -> U,

Returns the provided default (if Err), or\napplies a function to the contained value (if Ok).

\n

Arguments passed to map_or are eagerly evaluated; if you are passing\nthe result of a function call, it is recommended to use map_or_else,\nwhich is lazily evaluated.

\n
§Examples
\n
let x: Result<_, &str> = Ok(\"foo\");\nassert_eq!(x.map_or(42, |v| v.len()), 3);\n\nlet x: Result<&str, _> = Err(\"bar\");\nassert_eq!(x.map_or(42, |v| v.len()), 42);
\n
1.41.0 · source

pub fn map_or_else<U, D, F>(self, default: D, f: F) -> U
where\n D: FnOnce(E) -> U,\n F: FnOnce(T) -> U,

Maps a Result<T, E> to U by applying fallback function default to\na contained Err value, or function f to a contained Ok value.

\n

This function can be used to unpack a successful result\nwhile handling an error.

\n
§Examples
\n
let k = 21;\n\nlet x : Result<_, &str> = Ok(\"foo\");\nassert_eq!(x.map_or_else(|e| k * 2, |v| v.len()), 3);\n\nlet x : Result<&str, _> = Err(\"bar\");\nassert_eq!(x.map_or_else(|e| k * 2, |v| v.len()), 42);
\n
1.0.0 · source

pub fn map_err<F, O>(self, op: O) -> Result<T, F>
where\n O: FnOnce(E) -> F,

Maps a Result<T, E> to Result<T, F> by applying a function to a\ncontained Err value, leaving an Ok value untouched.

\n

This function can be used to pass through a successful result while handling\nan error.

\n
§Examples
\n
fn stringify(x: u32) -> String { format!(\"error code: {x}\") }\n\nlet x: Result<u32, u32> = Ok(2);\nassert_eq!(x.map_err(stringify), Ok(2));\n\nlet x: Result<u32, u32> = Err(13);\nassert_eq!(x.map_err(stringify), Err(\"error code: 13\".to_string()));
\n
1.76.0 · source

pub fn inspect<F>(self, f: F) -> Result<T, E>
where\n F: FnOnce(&T),

Calls the provided closure with a reference to the contained value (if Ok).

\n
§Examples
\n
let x: u8 = \"4\"\n    .parse::<u8>()\n    .inspect(|x| println!(\"original: {x}\"))\n    .map(|x| x.pow(3))\n    .expect(\"failed to parse number\");
\n
1.76.0 · source

pub fn inspect_err<F>(self, f: F) -> Result<T, E>
where\n F: FnOnce(&E),

Calls the provided closure with a reference to the contained error (if Err).

\n
§Examples
\n
use std::{fs, io};\n\nfn read() -> io::Result<String> {\n    fs::read_to_string(\"address.txt\")\n        .inspect_err(|e| eprintln!(\"failed to read file: {e}\"))\n}
\n
1.47.0 · source

pub fn as_deref(&self) -> Result<&<T as Deref>::Target, &E>
where\n T: Deref,

Converts from Result<T, E> (or &Result<T, E>) to Result<&<T as Deref>::Target, &E>.

\n

Coerces the Ok variant of the original Result via Deref\nand returns the new Result.

\n
§Examples
\n
let x: Result<String, u32> = Ok(\"hello\".to_string());\nlet y: Result<&str, &u32> = Ok(\"hello\");\nassert_eq!(x.as_deref(), y);\n\nlet x: Result<String, u32> = Err(42);\nlet y: Result<&str, &u32> = Err(&42);\nassert_eq!(x.as_deref(), y);
\n
1.47.0 · source

pub fn as_deref_mut(&mut self) -> Result<&mut <T as Deref>::Target, &mut E>
where\n T: DerefMut,

Converts from Result<T, E> (or &mut Result<T, E>) to Result<&mut <T as DerefMut>::Target, &mut E>.

\n

Coerces the Ok variant of the original Result via DerefMut\nand returns the new Result.

\n
§Examples
\n
let mut s = \"HELLO\".to_string();\nlet mut x: Result<String, u32> = Ok(\"hello\".to_string());\nlet y: Result<&mut str, &mut u32> = Ok(&mut s);\nassert_eq!(x.as_deref_mut().map(|x| { x.make_ascii_uppercase(); x }), y);\n\nlet mut i = 42;\nlet mut x: Result<String, u32> = Err(42);\nlet y: Result<&mut str, &mut u32> = Err(&mut i);\nassert_eq!(x.as_deref_mut().map(|x| { x.make_ascii_uppercase(); x }), y);
\n
1.0.0 · source

pub fn iter(&self) -> Iter<'_, T>

Returns an iterator over the possibly contained value.

\n

The iterator yields one value if the result is Result::Ok, otherwise none.

\n
§Examples
\n
let x: Result<u32, &str> = Ok(7);\nassert_eq!(x.iter().next(), Some(&7));\n\nlet x: Result<u32, &str> = Err(\"nothing!\");\nassert_eq!(x.iter().next(), None);
\n
1.0.0 · source

pub fn iter_mut(&mut self) -> IterMut<'_, T>

Returns a mutable iterator over the possibly contained value.

\n

The iterator yields one value if the result is Result::Ok, otherwise none.

\n
§Examples
\n
let mut x: Result<u32, &str> = Ok(7);\nmatch x.iter_mut().next() {\n    Some(v) => *v = 40,\n    None => {},\n}\nassert_eq!(x, Ok(40));\n\nlet mut x: Result<u32, &str> = Err(\"nothing!\");\nassert_eq!(x.iter_mut().next(), None);
\n
1.4.0 · source

pub fn expect(self, msg: &str) -> T
where\n E: Debug,

Returns the contained Ok value, consuming the self value.

\n

Because this function may panic, its use is generally discouraged.\nInstead, prefer to use pattern matching and handle the Err\ncase explicitly, or call unwrap_or, unwrap_or_else, or\nunwrap_or_default.

\n
§Panics
\n

Panics if the value is an Err, with a panic message including the\npassed message, and the content of the Err.

\n
§Examples
\n
let x: Result<u32, &str> = Err(\"emergency failure\");\nx.expect(\"Testing expect\"); // panics with `Testing expect: emergency failure`
\n
§Recommended Message Style
\n

We recommend that expect messages are used to describe the reason you\nexpect the Result should be Ok.

\n\n
let path = std::env::var(\"IMPORTANT_PATH\")\n    .expect(\"env variable `IMPORTANT_PATH` should be set by `wrapper_script.sh`\");
\n

Hint: If you’re having trouble remembering how to phrase expect\nerror messages remember to focus on the word “should” as in “env\nvariable should be set by blah” or “the given binary should be available\nand executable by the current user”.

\n

For more detail on expect message styles and the reasoning behind our recommendation please\nrefer to the section on “Common Message\nStyles” in the\nstd::error module docs.

\n
1.0.0 · source

pub fn unwrap(self) -> T
where\n E: Debug,

Returns the contained Ok value, consuming the self value.

\n

Because this function may panic, its use is generally discouraged.\nInstead, prefer to use pattern matching and handle the Err\ncase explicitly, or call unwrap_or, unwrap_or_else, or\nunwrap_or_default.

\n
§Panics
\n

Panics if the value is an Err, with a panic message provided by the\nErr’s value.

\n
§Examples
\n

Basic usage:

\n\n
let x: Result<u32, &str> = Ok(2);\nassert_eq!(x.unwrap(), 2);
\n\n
let x: Result<u32, &str> = Err(\"emergency failure\");\nx.unwrap(); // panics with `emergency failure`
\n
1.16.0 · source

pub fn unwrap_or_default(self) -> T
where\n T: Default,

Returns the contained Ok value or a default

\n

Consumes the self argument then, if Ok, returns the contained\nvalue, otherwise if Err, returns the default value for that\ntype.

\n
§Examples
\n

Converts a string to an integer, turning poorly-formed strings\ninto 0 (the default value for integers). parse converts\na string to any other type that implements FromStr, returning an\nErr on error.

\n\n
let good_year_from_input = \"1909\";\nlet bad_year_from_input = \"190blarg\";\nlet good_year = good_year_from_input.parse().unwrap_or_default();\nlet bad_year = bad_year_from_input.parse().unwrap_or_default();\n\nassert_eq!(1909, good_year);\nassert_eq!(0, bad_year);
\n
1.17.0 · source

pub fn expect_err(self, msg: &str) -> E
where\n T: Debug,

Returns the contained Err value, consuming the self value.

\n
§Panics
\n

Panics if the value is an Ok, with a panic message including the\npassed message, and the content of the Ok.

\n
§Examples
\n
let x: Result<u32, &str> = Ok(10);\nx.expect_err(\"Testing expect_err\"); // panics with `Testing expect_err: 10`
\n
1.0.0 · source

pub fn unwrap_err(self) -> E
where\n T: Debug,

Returns the contained Err value, consuming the self value.

\n
§Panics
\n

Panics if the value is an Ok, with a custom panic message provided\nby the Ok’s value.

\n
§Examples
\n
let x: Result<u32, &str> = Ok(2);\nx.unwrap_err(); // panics with `2`
\n\n
let x: Result<u32, &str> = Err(\"emergency failure\");\nassert_eq!(x.unwrap_err(), \"emergency failure\");
\n
source

pub fn into_ok(self) -> T
where\n E: Into<!>,

🔬This is a nightly-only experimental API. (unwrap_infallible)

Returns the contained Ok value, but never panics.

\n

Unlike unwrap, this method is known to never panic on the\nresult types it is implemented for. Therefore, it can be used\ninstead of unwrap as a maintainability safeguard that will fail\nto compile if the error type of the Result is later changed\nto an error that can actually occur.

\n
§Examples
\n
\nfn only_good_news() -> Result<String, !> {\n    Ok(\"this is fine\".into())\n}\n\nlet s: String = only_good_news().into_ok();\nprintln!(\"{s}\");
\n
source

pub fn into_err(self) -> E
where\n T: Into<!>,

🔬This is a nightly-only experimental API. (unwrap_infallible)

Returns the contained Err value, but never panics.

\n

Unlike unwrap_err, this method is known to never panic on the\nresult types it is implemented for. Therefore, it can be used\ninstead of unwrap_err as a maintainability safeguard that will fail\nto compile if the ok type of the Result is later changed\nto a type that can actually occur.

\n
§Examples
\n
\nfn only_bad_news() -> Result<!, String> {\n    Err(\"Oops, it failed\".into())\n}\n\nlet error: String = only_bad_news().into_err();\nprintln!(\"{error}\");
\n
1.0.0 · source

pub fn and<U>(self, res: Result<U, E>) -> Result<U, E>

Returns res if the result is Ok, otherwise returns the Err value of self.

\n

Arguments passed to and are eagerly evaluated; if you are passing the\nresult of a function call, it is recommended to use and_then, which is\nlazily evaluated.

\n
§Examples
\n
let x: Result<u32, &str> = Ok(2);\nlet y: Result<&str, &str> = Err(\"late error\");\nassert_eq!(x.and(y), Err(\"late error\"));\n\nlet x: Result<u32, &str> = Err(\"early error\");\nlet y: Result<&str, &str> = Ok(\"foo\");\nassert_eq!(x.and(y), Err(\"early error\"));\n\nlet x: Result<u32, &str> = Err(\"not a 2\");\nlet y: Result<&str, &str> = Err(\"late error\");\nassert_eq!(x.and(y), Err(\"not a 2\"));\n\nlet x: Result<u32, &str> = Ok(2);\nlet y: Result<&str, &str> = Ok(\"different result type\");\nassert_eq!(x.and(y), Ok(\"different result type\"));
\n
1.0.0 · source

pub fn and_then<U, F>(self, op: F) -> Result<U, E>
where\n F: FnOnce(T) -> Result<U, E>,

Calls op if the result is Ok, otherwise returns the Err value of self.

\n

This function can be used for control flow based on Result values.

\n
§Examples
\n
fn sq_then_to_string(x: u32) -> Result<String, &'static str> {\n    x.checked_mul(x).map(|sq| sq.to_string()).ok_or(\"overflowed\")\n}\n\nassert_eq!(Ok(2).and_then(sq_then_to_string), Ok(4.to_string()));\nassert_eq!(Ok(1_000_000).and_then(sq_then_to_string), Err(\"overflowed\"));\nassert_eq!(Err(\"not a number\").and_then(sq_then_to_string), Err(\"not a number\"));
\n

Often used to chain fallible operations that may return Err.

\n\n
use std::{io::ErrorKind, path::Path};\n\n// Note: on Windows \"/\" maps to \"C:\\\"\nlet root_modified_time = Path::new(\"/\").metadata().and_then(|md| md.modified());\nassert!(root_modified_time.is_ok());\n\nlet should_fail = Path::new(\"/bad/path\").metadata().and_then(|md| md.modified());\nassert!(should_fail.is_err());\nassert_eq!(should_fail.unwrap_err().kind(), ErrorKind::NotFound);
\n
1.0.0 · source

pub fn or<F>(self, res: Result<T, F>) -> Result<T, F>

Returns res if the result is Err, otherwise returns the Ok value of self.

\n

Arguments passed to or are eagerly evaluated; if you are passing the\nresult of a function call, it is recommended to use or_else, which is\nlazily evaluated.

\n
§Examples
\n
let x: Result<u32, &str> = Ok(2);\nlet y: Result<u32, &str> = Err(\"late error\");\nassert_eq!(x.or(y), Ok(2));\n\nlet x: Result<u32, &str> = Err(\"early error\");\nlet y: Result<u32, &str> = Ok(2);\nassert_eq!(x.or(y), Ok(2));\n\nlet x: Result<u32, &str> = Err(\"not a 2\");\nlet y: Result<u32, &str> = Err(\"late error\");\nassert_eq!(x.or(y), Err(\"late error\"));\n\nlet x: Result<u32, &str> = Ok(2);\nlet y: Result<u32, &str> = Ok(100);\nassert_eq!(x.or(y), Ok(2));
\n
1.0.0 · source

pub fn or_else<F, O>(self, op: O) -> Result<T, F>
where\n O: FnOnce(E) -> Result<T, F>,

Calls op if the result is Err, otherwise returns the Ok value of self.

\n

This function can be used for control flow based on result values.

\n
§Examples
\n
fn sq(x: u32) -> Result<u32, u32> { Ok(x * x) }\nfn err(x: u32) -> Result<u32, u32> { Err(x) }\n\nassert_eq!(Ok(2).or_else(sq).or_else(sq), Ok(2));\nassert_eq!(Ok(2).or_else(err).or_else(sq), Ok(2));\nassert_eq!(Err(3).or_else(sq).or_else(err), Ok(9));\nassert_eq!(Err(3).or_else(err).or_else(err), Err(3));
\n
1.0.0 · source

pub fn unwrap_or(self, default: T) -> T

Returns the contained Ok value or a provided default.

\n

Arguments passed to unwrap_or are eagerly evaluated; if you are passing\nthe result of a function call, it is recommended to use unwrap_or_else,\nwhich is lazily evaluated.

\n
§Examples
\n
let default = 2;\nlet x: Result<u32, &str> = Ok(9);\nassert_eq!(x.unwrap_or(default), 9);\n\nlet x: Result<u32, &str> = Err(\"error\");\nassert_eq!(x.unwrap_or(default), default);
\n
1.0.0 · source

pub fn unwrap_or_else<F>(self, op: F) -> T
where\n F: FnOnce(E) -> T,

Returns the contained Ok value or computes it from a closure.

\n
§Examples
\n
fn count(x: &str) -> usize { x.len() }\n\nassert_eq!(Ok(2).unwrap_or_else(count), 2);\nassert_eq!(Err(\"foo\").unwrap_or_else(count), 3);
\n
1.58.0 · source

pub unsafe fn unwrap_unchecked(self) -> T

Returns the contained Ok value, consuming the self value,\nwithout checking that the value is not an Err.

\n
§Safety
\n

Calling this method on an Err is undefined behavior.

\n
§Examples
\n
let x: Result<u32, &str> = Ok(2);\nassert_eq!(unsafe { x.unwrap_unchecked() }, 2);
\n\n
let x: Result<u32, &str> = Err(\"emergency failure\");\nunsafe { x.unwrap_unchecked(); } // Undefined behavior!
\n
1.58.0 · source

pub unsafe fn unwrap_err_unchecked(self) -> E

Returns the contained Err value, consuming the self value,\nwithout checking that the value is not an Ok.

\n
§Safety
\n

Calling this method on an Ok is undefined behavior.

\n
§Examples
\n
let x: Result<u32, &str> = Ok(2);\nunsafe { x.unwrap_err_unchecked() }; // Undefined behavior!
\n\n
let x: Result<u32, &str> = Err(\"emergency failure\");\nassert_eq!(unsafe { x.unwrap_err_unchecked() }, \"emergency failure\");
\n
",0,"oo7::error::Result"],["
§

impl<T, E> ResultAdapter for Result<T, E>

§

type Ok = T

§

type Err = E

","ResultAdapter","oo7::error::Result"],["
source§

impl<T, E> Serialize for Result<T, E>
where\n T: Serialize,\n E: Serialize,

source§

fn serialize<S>(\n &self,\n serializer: S\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>
where\n S: Serializer,

Serialize this value into the given Serde serializer. Read more
","Serialize","oo7::error::Result"],["
1.16.0 · source§

impl<T, U, E> Sum<Result<U, E>> for Result<T, E>
where\n T: Sum<U>,

source§

fn sum<I>(iter: I) -> Result<T, E>
where\n I: Iterator<Item = Result<U, E>>,

Takes each element in the Iterator: if it is an Err, no further\nelements are taken, and the Err is returned. Should no Err\noccur, the sum of all elements is returned.

\n
§Examples
\n

This sums up every integer in a vector, rejecting the sum if a negative\nelement is encountered:

\n\n
let f = |&x: &i32| if x < 0 { Err(\"Negative element found\") } else { Ok(x) };\nlet v = vec![1, 2];\nlet res: Result<i32, _> = v.iter().map(f).sum();\nassert_eq!(res, Ok(3));\nlet v = vec![1, -2];\nlet res: Result<i32, _> = v.iter().map(f).sum();\nassert_eq!(res, Err(\"Negative element found\"));
\n
","Sum>","oo7::error::Result"],["
1.61.0 · source§

impl<T, E> Termination for Result<T, E>
where\n T: Termination,\n E: Debug,

source§

fn report(self) -> ExitCode

Is called to get the representation of the value as status code.\nThis status code is returned to the operating system.
","Termination","oo7::error::Result"],["
source§

impl<T, E> Try for Result<T, E>

§

type Output = T

🔬This is a nightly-only experimental API. (try_trait_v2)
The type of the value produced by ? when not short-circuiting.
§

type Residual = Result<Infallible, E>

🔬This is a nightly-only experimental API. (try_trait_v2)
The type of the value passed to FromResidual::from_residual\nas part of ? when short-circuiting. Read more
source§

fn from_output(output: <Result<T, E> as Try>::Output) -> Result<T, E>

🔬This is a nightly-only experimental API. (try_trait_v2)
Constructs the type from its Output type. Read more
source§

fn branch(\n self\n) -> ControlFlow<<Result<T, E> as Try>::Residual, <Result<T, E> as Try>::Output>

🔬This is a nightly-only experimental API. (try_trait_v2)
Used in ? to decide whether the operator should produce a value\n(because this returned ControlFlow::Continue)\nor propagate a value back to the caller\n(because this returned ControlFlow::Break). Read more
","Try","oo7::error::Result"],["
1.0.0 · source§

impl<T, E> Copy for Result<T, E>
where\n T: Copy,\n E: Copy,

","Copy","oo7::error::Result"],["
1.0.0 · source§

impl<T, E> Eq for Result<T, E>
where\n T: Eq,\n E: Eq,

","Eq","oo7::error::Result"],["
1.0.0 · source§

impl<T, E> StructuralPartialEq for Result<T, E>

","StructuralPartialEq","oo7::error::Result"]] };if (window.register_type_impls) {window.register_type_impls(type_impls);} else {window.pending_type_impls = type_impls;}})() \ No newline at end of file