Struct iroh_blobs::downloader::DownloadRequest
source · pub struct DownloadRequest { /* private fields */ }Expand description
A download request.
Implementations§
source§impl DownloadRequest
impl DownloadRequest
sourcepub fn new(
resource: impl Into<DownloadKind>,
- nodes: impl IntoIterator<Item = impl Into<NodeAddr>>
+ nodes: impl IntoIterator<Item = impl Into<NodeAddr>>
) -> Self
pub fn new( resource: impl Into<DownloadKind>, - nodes: impl IntoIterator<Item = impl Into<NodeAddr>> + nodes: impl IntoIterator<Item = impl Into<NodeAddr>> ) -> Self
Create a new download request.
It is the responsibility of the caller to ensure that the data is tagged either with a temp tag or with a persistent tag to make sure the data is not garbage collected during diff --git a/pr/2595/docs/iroh_blobs/downloader/struct.Downloader.html b/pr/2595/docs/iroh_blobs/downloader/struct.Downloader.html index 88d2e7f7c0..1c6762c576 100644 --- a/pr/2595/docs/iroh_blobs/downloader/struct.Downloader.html +++ b/pr/2595/docs/iroh_blobs/downloader/struct.Downloader.html @@ -11,7 +11,7 @@ S: Store,
Create a new Downloader with custom ConcurrencyLimits and RetryConfig.
sourcepub async fn queue(&self, request: DownloadRequest) -> DownloadHandle ⓘ
pub async fn queue(&self, request: DownloadRequest) -> DownloadHandle ⓘ
Queue a download.
sourcepub async fn cancel(&self, handle: DownloadHandle)
pub async fn cancel(&self, handle: DownloadHandle)
Cancel a download.
-sourcepub async fn nodes_have(&mut self, hash: Hash, nodes: Vec<NodeId>)
pub async fn nodes_have(&mut self, hash: Hash, nodes: Vec<NodeId>)
Declare that certains nodes can be used to download a hash.
+sourcepub async fn nodes_have(&mut self, hash: Hash, nodes: Vec<NodeId>)
pub async fn nodes_have(&mut self, hash: Hash, nodes: Vec<NodeId>)
Declare that certains nodes can be used to download a hash.
Note that this does not start a download, but only provides new nodes to already queued
downloads. Use Self::queue to queue a download.
Trait Implementations§
source§impl Clone for Downloader
impl Clone for Downloader
source§fn clone(&self) -> Downloader
fn clone(&self) -> Downloader
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for Downloader
impl !RefUnwindSafe for Downloader
impl Send for Downloader
impl Sync for Downloader
impl Unpin for Downloader
impl !UnwindSafe for Downloader
Blanket Implementations§
source§impl<T> Any for Twhere
diff --git a/pr/2595/docs/iroh_blobs/downloader/trait.Dialer.html b/pr/2595/docs/iroh_blobs/downloader/trait.Dialer.html
index 2dfc99bd33..d23576a87e 100644
--- a/pr/2595/docs/iroh_blobs/downloader/trait.Dialer.html
+++ b/pr/2595/docs/iroh_blobs/downloader/trait.Dialer.html
@@ -1,15 +1,15 @@
-Dialer in iroh_blobs::downloader - Rust Trait iroh_blobs::downloader::Dialer
source · pub trait Dialer: Stream<Item = (NodeId, Result<Self::Connection>)> + Unpin {
+Dialer in iroh_blobs::downloader - Rust Trait iroh_blobs::downloader::Dialer
source · pub trait Dialer: Stream<Item = (NodeId, Result<Self::Connection>)> + Unpin {
type Connection: Clone + 'static;
// Required methods
- fn queue_dial(&mut self, node_id: NodeId);
+ fn queue_dial(&mut self, node_id: NodeId);
fn pending_count(&self) -> usize;
- fn is_pending(&self, node: NodeId) -> bool;
- fn node_id(&self) -> NodeId;
+ fn is_pending(&self, node: NodeId) -> bool;
+ fn node_id(&self) -> NodeId;
}
Expand description
Trait modeling a dialer. This allows for IO-less testing.
Required Associated Types§
sourcetype Connection: Clone + 'static
Type of connections returned by the Dialer.
-Required Methods§
sourcefn queue_dial(&mut self, node_id: NodeId)
Dial a node.
+Required Methods§
sourcefn queue_dial(&mut self, node_id: NodeId)
Dial a node.
sourcefn pending_count(&self) -> usize
Get the number of dialing nodes.
-sourcefn is_pending(&self, node: NodeId) -> bool
Check if a node is being dialed.
-Implementations on Foreign Types§
source§impl Dialer for Dialer
§type Connection = Connection
source§fn queue_dial(&mut self, node_id: NodeId)
source§fn pending_count(&self) -> usize
source§fn is_pending(&self, node: NodeId) -> bool
source§fn node_id(&self) -> NodeId
Implementors§
\ No newline at end of file
+
sourcefn is_pending(&self, node: NodeId) -> bool
Check if a node is being dialed.
+Implementations on Foreign Types§
source§impl Dialer for Dialer
§type Connection = Connection
source§fn queue_dial(&mut self, node_id: NodeId)
source§fn pending_count(&self) -> usize
source§fn is_pending(&self, node: NodeId) -> bool
source§fn node_id(&self) -> NodeId
Implementors§
impl<T> Any for Twhere
diff --git a/pr/2595/docs/iroh_blobs/downloader/trait.Dialer.html b/pr/2595/docs/iroh_blobs/downloader/trait.Dialer.html
index 2dfc99bd33..d23576a87e 100644
--- a/pr/2595/docs/iroh_blobs/downloader/trait.Dialer.html
+++ b/pr/2595/docs/iroh_blobs/downloader/trait.Dialer.html
@@ -1,15 +1,15 @@
-Dialer in iroh_blobs::downloader - Rust Trait iroh_blobs::downloader::Dialer
source · pub trait Dialer: Stream<Item = (NodeId, Result<Self::Connection>)> + Unpin {
+Dialer in iroh_blobs::downloader - Rust Trait iroh_blobs::downloader::Dialer
source · pub trait Dialer: Stream<Item = (NodeId, Result<Self::Connection>)> + Unpin {
type Connection: Clone + 'static;
// Required methods
- fn queue_dial(&mut self, node_id: NodeId);
+ fn queue_dial(&mut self, node_id: NodeId);
fn pending_count(&self) -> usize;
- fn is_pending(&self, node: NodeId) -> bool;
- fn node_id(&self) -> NodeId;
+ fn is_pending(&self, node: NodeId) -> bool;
+ fn node_id(&self) -> NodeId;
}
Expand description
Trait modeling a dialer. This allows for IO-less testing.
Required Associated Types§
sourcetype Connection: Clone + 'static
Type of connections returned by the Dialer.
-Required Methods§
sourcefn queue_dial(&mut self, node_id: NodeId)
Dial a node.
+Required Methods§
sourcefn queue_dial(&mut self, node_id: NodeId)
Dial a node.
sourcefn pending_count(&self) -> usize
Get the number of dialing nodes.
-sourcefn is_pending(&self, node: NodeId) -> bool
Check if a node is being dialed.
-Implementations on Foreign Types§
source§impl Dialer for Dialer
§type Connection = Connection
source§fn queue_dial(&mut self, node_id: NodeId)
source§fn pending_count(&self) -> usize
source§fn is_pending(&self, node: NodeId) -> bool
source§fn node_id(&self) -> NodeId
Implementors§
\ No newline at end of file
+
sourcefn is_pending(&self, node: NodeId) -> bool
Check if a node is being dialed.
+Implementations on Foreign Types§
source§impl Dialer for Dialer
§type Connection = Connection
source§fn queue_dial(&mut self, node_id: NodeId)
source§fn pending_count(&self) -> usize
source§fn is_pending(&self, node: NodeId) -> bool
source§fn node_id(&self) -> NodeId
Implementors§
Trait iroh_blobs::downloader::Dialer
source · pub trait Dialer: Stream<Item = (NodeId, Result<Self::Connection>)> + Unpin {
+Dialer in iroh_blobs::downloader - Rust Trait iroh_blobs::downloader::Dialer
source · pub trait Dialer: Stream<Item = (NodeId, Result<Self::Connection>)> + Unpin {
type Connection: Clone + 'static;
// Required methods
- fn queue_dial(&mut self, node_id: NodeId);
+ fn queue_dial(&mut self, node_id: NodeId);
fn pending_count(&self) -> usize;
- fn is_pending(&self, node: NodeId) -> bool;
- fn node_id(&self) -> NodeId;
+ fn is_pending(&self, node: NodeId) -> bool;
+ fn node_id(&self) -> NodeId;
}
Expand description
Trait modeling a dialer. This allows for IO-less testing.
Required Associated Types§
sourcetype Connection: Clone + 'static
Type of connections returned by the Dialer.
-Required Methods§
sourcefn queue_dial(&mut self, node_id: NodeId)
Dial a node.
+Required Methods§
sourcefn queue_dial(&mut self, node_id: NodeId)
Dial a node.
sourcefn pending_count(&self) -> usize
Get the number of dialing nodes.
-sourcefn is_pending(&self, node: NodeId) -> bool
Check if a node is being dialed.
-Implementations on Foreign Types§
source§impl Dialer for Dialer
§type Connection = Connection
source§fn queue_dial(&mut self, node_id: NodeId)
source§fn pending_count(&self) -> usize
source§fn is_pending(&self, node: NodeId) -> bool
source§fn node_id(&self) -> NodeId
Implementors§
\ No newline at end of file
+sourcefn is_pending(&self, node: NodeId) -> bool
fn is_pending(&self, node: NodeId) -> bool
Check if a node is being dialed.
+source§impl Dialer for Dialer
impl Dialer for Dialer
type Connection = Connection
fn queue_dial(&mut self, node_id: NodeId)
fn pending_count(&self) -> usize
fn is_pending(&self, node: NodeId) -> bool
fn node_id(&self) -> NodeId
Enum iroh_blobs::BlobFormat
pub enum BlobFormat {
+BlobFormat in iroh_blobs - Rust Enum iroh_blobs::BlobFormat
source · pub enum BlobFormat {
Raw,
HashSeq,
}
Expand description
A format identifier
Variants§
Implementations§
§impl BlobFormat
pub const fn is_hash_seq(&self) -> bool
Is hash seq format
-Trait Implementations§
§impl Clone for BlobFormat
§fn clone(&self) -> BlobFormat
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more§impl Debug for BlobFormat
§impl Default for BlobFormat
§fn default() -> BlobFormat
Returns the “default value” for a type. Read more§impl<'de> Deserialize<'de> for BlobFormat
§fn deserialize<__D>(
+
Implementations§
source§impl BlobFormat
Trait Implementations§
source§impl Clone for BlobFormat
source§fn clone(&self) -> BlobFormat
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moresource§impl Debug for BlobFormat
source§impl Default for BlobFormat
source§fn default() -> BlobFormat
Returns the “default value” for a type. Read moresource§impl<'de> Deserialize<'de> for BlobFormat
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<BlobFormat, <__D as Deserializer<'de>>::Error>where
- __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more§impl Display for BlobFormat
§impl Hash for BlobFormat
§fn hash<__H>(&self, state: &mut __H)where
+ __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl Display for BlobFormat
source§impl Hash for BlobFormat
§impl MaxSize for BlobFormat
§const POSTCARD_MAX_SIZE: usize = 1usize
The maximum possible size that the serialization of this
-type can have, in bytes.§impl Ord for BlobFormat
source§impl MaxSize for BlobFormat
source§const POSTCARD_MAX_SIZE: usize = 1usize
The maximum possible size that the serialization of this
+type can have, in bytes.source§impl Ord for BlobFormat
source§fn cmp(&self, other: &BlobFormat) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more§impl PartialEq for BlobFormat
§fn eq(&self, other: &BlobFormat) -> bool
Restrict a value to a certain interval. Read moresource§impl PartialEq for BlobFormat
source§fn eq(&self, other: &BlobFormat) -> bool
This method tests for self and other values to be equal, and is used
by ==.§impl PartialOrd for BlobFormat
§fn partial_cmp(&self, other: &BlobFormat) -> Option<Ordering>
source§impl PartialOrd for BlobFormat
source§fn partial_cmp(&self, other: &BlobFormat) -> Option<Ordering>
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 <=
operator. Read moresource§impl Serialize for BlobFormat
source§fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
- __S: Serializer,
Serialize this value into the given Serde serializer. Read more§impl Copy for BlobFormat
§impl Eq for BlobFormat
§impl StructuralPartialEq for BlobFormat
Auto Trait Implementations§
§impl Freeze for BlobFormat
§impl RefUnwindSafe for BlobFormat
§impl Send for BlobFormat
§impl Sync for BlobFormat
§impl Unpin for BlobFormat
§impl UnwindSafe for BlobFormat
Blanket Implementations§
source§impl<T> Any for Twhere
+ __S: Serializer,
Serialize this value into the given Serde serializer. Read moresource§impl Copy for BlobFormat
source§impl Eq for BlobFormat
source§impl StructuralPartialEq for BlobFormat
Auto Trait Implementations§
impl Freeze for BlobFormat
impl RefUnwindSafe for BlobFormat
impl Send for BlobFormat
impl Sync for BlobFormat
impl Unpin for BlobFormat
impl UnwindSafe for BlobFormat
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
diff --git a/pr/2595/docs/iroh_blobs/export/enum.ExportProgress.html b/pr/2595/docs/iroh_blobs/export/enum.ExportProgress.html
index 0429dd3c2d..64648a463a 100644
--- a/pr/2595/docs/iroh_blobs/export/enum.ExportProgress.html
+++ b/pr/2595/docs/iroh_blobs/export/enum.ExportProgress.html
@@ -14,7 +14,7 @@
id: u64,
},
AllDone,
- Abort(RpcError),
+ Abort(RpcError),
}Expand description
Progress events for an export operation
Variants§
§Found
The download part is done for this id, we are now exporting the data
to the specified out path.
@@ -30,7 +30,7 @@ to the specified out path.
§Done
We finished exporting a blob
§AllDone
We are done with the whole operation.
-§Abort(RpcError)
We got an error and need to abort.
+§Abort(RpcError)
We got an error and need to abort.
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
diff --git a/pr/2595/docs/iroh_blobs/export/enum.ExportProgress.html b/pr/2595/docs/iroh_blobs/export/enum.ExportProgress.html
index 0429dd3c2d..64648a463a 100644
--- a/pr/2595/docs/iroh_blobs/export/enum.ExportProgress.html
+++ b/pr/2595/docs/iroh_blobs/export/enum.ExportProgress.html
@@ -14,7 +14,7 @@
id: u64,
},
AllDone,
- Abort(RpcError),
+ Abort(RpcError),
}Expand description
Progress events for an export operation
Variants§
§Found
The download part is done for this id, we are now exporting the data
to the specified out path.
@@ -30,7 +30,7 @@ to the specified out path.
§Done
We finished exporting a blob
§AllDone
We are done with the whole operation.
-§Abort(RpcError)
We got an error and need to abort.
+§Abort(RpcError)
We got an error and need to abort.
Expand description
Progress events for an export operation
Variants§
Found
The download part is done for this id, we are now exporting the data to the specified out path.
@@ -30,7 +30,7 @@ to the specified out path.Done
We finished exporting a blob
AllDone
We are done with the whole operation.
-Abort(RpcError)
We got an error and need to abort.
+Abort(RpcError)
We got an error and need to abort.
Trait Implementations§
source§impl Clone for ExportProgress
impl Clone for ExportProgress
source§fn clone(&self) -> ExportProgress
fn clone(&self) -> ExportProgress
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Debug for ExportProgress
impl Debug for ExportProgress
source§impl<'de> Deserialize<'de> for ExportProgress
impl<'de> Deserialize<'de> for ExportProgress
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl !Freeze for ExportProgress
impl RefUnwindSafe for ExportProgress
impl Send for ExportProgress
impl Sync for ExportProgress
impl Unpin for ExportProgress
impl UnwindSafe for ExportProgress
Blanket Implementations§
source§impl<T> Any for Twhere
diff --git a/pr/2595/docs/iroh_blobs/get/db/enum.DownloadProgress.html b/pr/2595/docs/iroh_blobs/get/db/enum.DownloadProgress.html
index 048ea4b8ea..053c531570 100644
--- a/pr/2595/docs/iroh_blobs/get/db/enum.DownloadProgress.html
+++ b/pr/2595/docs/iroh_blobs/get/db/enum.DownloadProgress.html
@@ -25,7 +25,7 @@
id: u64,
},
AllDone(Stats),
- Abort(RpcError),
+ Abort(RpcError),
}Expand description
Progress updates for the get operation.
Variants§
§InitialState(TransferState)
Initial state if subscribing to a running or queued transfer.
§FoundLocal
Data was found locally.
@@ -51,7 +51,7 @@ allows to identify the children by their offset in the hashseq.
§AllDone(Stats)
All operations finished.
This will be the last message in the stream.
-§Abort(RpcError)
We got an error and need to abort.
+§Abort(RpcError)
We got an error and need to abort.
This will be the last message in the stream.
Trait Implementations§
source§impl Clone for DownloadProgress
source§fn clone(&self) -> DownloadProgress
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moresource§impl Debug for DownloadProgress
source§impl<'de> Deserialize<'de> for DownloadProgress
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl Serialize for DownloadProgress
source§fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where
diff --git a/pr/2595/docs/iroh_blobs/provider/enum.AddProgress.html b/pr/2595/docs/iroh_blobs/provider/enum.AddProgress.html
index f66b9300f3..c70929bdee 100644
--- a/pr/2595/docs/iroh_blobs/provider/enum.AddProgress.html
+++ b/pr/2595/docs/iroh_blobs/provider/enum.AddProgress.html
@@ -17,7 +17,7 @@
format: BlobFormat,
tag: Tag,
},
- Abort(RpcError),
+ Abort(RpcError),
}Expand description
Progress updates for the add operation.
Variants§
§Found
An item was found with name name, from now on referred to via id
Fields
§Abort(RpcError)
We got an error and need to abort.
This will be the last message in the stream.
Trait Implementations§
source§impl Debug for AddProgress
source§impl<'de> Deserialize<'de> for AddProgress
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl Serialize for AddProgress
source§fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where
diff --git a/pr/2595/docs/iroh_blobs/store/enum.ConsistencyCheckProgress.html b/pr/2595/docs/iroh_blobs/store/enum.ConsistencyCheckProgress.html
index ad14d9476a..46469fe5e2 100644
--- a/pr/2595/docs/iroh_blobs/store/enum.ConsistencyCheckProgress.html
+++ b/pr/2595/docs/iroh_blobs/store/enum.ConsistencyCheckProgress.html
@@ -6,7 +6,7 @@
level: ReportLevel,
},
Done,
- Abort(RpcError),
+ Abort(RpcError),
}Expand description
Progress updates for the validate operation
Variants§
§level: ReportLevelThe level of the message
§Done
Consistency check ended
-§Abort(RpcError)
We got an error and need to abort.
+§Abort(RpcError)
We got an error and need to abort.
Trait Implementations§
source§impl Debug for ConsistencyCheckProgress
source§impl<'de> Deserialize<'de> for ConsistencyCheckProgress
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreAuto Trait Implementations§
§impl Freeze for ConsistencyCheckProgress
§impl RefUnwindSafe for ConsistencyCheckProgress
§impl Send for ConsistencyCheckProgress
§impl Sync for ConsistencyCheckProgress
§impl Unpin for ConsistencyCheckProgress
§impl UnwindSafe for ConsistencyCheckProgress
Blanket Implementations§
source§impl<T> Any for Twhere
diff --git a/pr/2595/docs/iroh_blobs/store/enum.ValidateProgress.html b/pr/2595/docs/iroh_blobs/store/enum.ValidateProgress.html
index 76a8f01e97..f4494f3a46 100644
--- a/pr/2595/docs/iroh_blobs/store/enum.ValidateProgress.html
+++ b/pr/2595/docs/iroh_blobs/store/enum.ValidateProgress.html
@@ -31,7 +31,7 @@
ranges: RangeSpec,
},
AllDone,
- Abort(RpcError),
+ Abort(RpcError),
}Expand description
Progress updates for the validate operation
Variants§
§Starting
started validating
Fields
§total: u64The total number of entries to validate
@@ -62,7 +62,7 @@ Otherwise it might be an url or something else to uniquely identify the entry.
§AllDone
We are done with the whole operation.
-§Abort(RpcError)
We got an error and need to abort.
+§Abort(RpcError)
We got an error and need to abort.
Trait Implementations§
source§impl Debug for ValidateProgress
source§impl<'de> Deserialize<'de> for ValidateProgress
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreAuto Trait Implementations§
§impl Freeze for ValidateProgress
§impl RefUnwindSafe for ValidateProgress
§impl Send for ValidateProgress
§impl Sync for ValidateProgress
§impl Unpin for ValidateProgress
§impl UnwindSafe for ValidateProgress
Blanket Implementations§
source§impl<T> Any for Twhere
diff --git a/pr/2595/docs/iroh_blobs/struct.Hash.html b/pr/2595/docs/iroh_blobs/struct.Hash.html
index 260e50d4b9..ba12d52876 100644
--- a/pr/2595/docs/iroh_blobs/struct.Hash.html
+++ b/pr/2595/docs/iroh_blobs/struct.Hash.html
@@ -1,36 +1,36 @@
-Hash in iroh_blobs - Rust Struct iroh_blobs::Hash
pub struct Hash(/* private fields */);
Expand description
Hash type used throughout.
-Implementations§
§impl Hash
pub const fn from_bytes(bytes: [u8; 32]) -> Hash
Create a Hash from its raw bytes representation.
-pub fn fmt_short(&self) -> String
Convert to a base32 string limited to the first 10 bytes for a friendly string
+
Hash in iroh_blobs - Rust Struct iroh_blobs::Hash
source · pub struct Hash(/* private fields */);
Expand description
Hash type used throughout.
+Implementations§
Trait Implementations§
Trait Implementations§
source§impl<'de> Deserialize<'de> for Hash
source§fn deserialize<D>(
deserializer: D
) -> Result<Hash, <D as Deserializer<'de>>::Error>where
- D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl FromIterator<Hash> for HashSeq
§impl Hash for Hash
§fn hash<__H>(&self, state: &mut __H)where
+ D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl FromIterator<Hash> for HashSeq
§impl MaxSize for Hash
§const POSTCARD_MAX_SIZE: usize = 32usize
The maximum possible size that the serialization of this
-type can have, in bytes.source§impl MaxSize for Hash
source§const POSTCARD_MAX_SIZE: usize = 32usize
The maximum possible size that the serialization of this
+type can have, in bytes.source§impl Ord for Hash
source§impl PartialEq for Hash
§impl PartialOrd for Hash
source§impl PartialOrd for Hash
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 <=
operator. Read moresource§impl Serialize for Hash
source§fn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
- S: Serializer,
Serialize this value into the given Serde serializer. Read more§impl Value for Hash
§type SelfType<'a> = Hash
SelfType<’a> must be the same type as Self with all lifetimes replaced with ’a§type AsBytes<'a> = &'a [u8; 32]
§fn fixed_width() -> Option<usize>
Width of a fixed type, or None for variable width§fn from_bytes<'a>(data: &'a [u8]) -> <Hash as Value>::SelfType<'a>where
+ S: Serializer,
Serialize this value into the given Serde serializer. Read moresource§impl Value for Hash
§type SelfType<'a> = Hash
SelfType<’a> must be the same type as Self with all lifetimes replaced with ’a§type AsBytes<'a> = &'a [u8; 32]
source§fn fixed_width() -> Option<usize>
Width of a fixed type, or None for variable width§impl Copy for Hash
§impl Eq for Hash
§impl StructuralPartialEq for Hash
Auto Trait Implementations§
§impl Freeze for Hash
§impl RefUnwindSafe for Hash
§impl Send for Hash
§impl Sync for Hash
§impl Unpin for Hash
§impl UnwindSafe for Hash
Blanket Implementations§
source§impl Copy for Hash
source§impl Eq for Hash
source§impl StructuralPartialEq for Hash
Auto Trait Implementations§
§impl Freeze for Hash
§impl RefUnwindSafe for Hash
§impl Send for Hash
§impl Sync for Hash
§impl Unpin for Hash
§impl UnwindSafe for Hash
Blanket Implementations§
§impl<A, T> AsBits<T> for A
§fn as_bits<O>(&self) -> &BitSlice<T, O>where
diff --git a/pr/2595/docs/iroh_blobs/struct.HashAndFormat.html b/pr/2595/docs/iroh_blobs/struct.HashAndFormat.html
index 8eb7ba64d5..421c7e1439 100644
--- a/pr/2595/docs/iroh_blobs/struct.HashAndFormat.html
+++ b/pr/2595/docs/iroh_blobs/struct.HashAndFormat.html
@@ -1,37 +1,37 @@
-HashAndFormat in iroh_blobs - Rust Struct iroh_blobs::HashAndFormat
pub struct HashAndFormat {
+HashAndFormat in iroh_blobs - Rust Struct iroh_blobs::HashAndFormat
source · pub struct HashAndFormat {
pub hash: Hash,
pub format: BlobFormat,
}
Expand description
A hash and format pair
Fields§
§hash: HashThe hash
§format: BlobFormatThe format
-Implementations§
§impl HashAndFormat
pub fn new(hash: Hash, format: BlobFormat) -> HashAndFormat
Create a new hash and format pair.
-pub fn raw(hash: Hash) -> HashAndFormat
Create a new hash and format pair, using the default (raw) format.
-pub fn hash_seq(hash: Hash) -> HashAndFormat
Create a new hash and format pair, using the collection format.
-Trait Implementations§
§impl Clone for HashAndFormat
§fn clone(&self) -> HashAndFormat
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more§impl Debug for HashAndFormat
§impl<'de> Deserialize<'de> for HashAndFormat
§fn deserialize<D>(
+
Implementations§
source§impl HashAndFormat
sourcepub fn new(hash: Hash, format: BlobFormat) -> HashAndFormat
Create a new hash and format pair.
+sourcepub fn raw(hash: Hash) -> HashAndFormat
Create a new hash and format pair, using the default (raw) format.
+sourcepub fn hash_seq(hash: Hash) -> HashAndFormat
Create a new hash and format pair, using the collection format.
+Trait Implementations§
source§impl Clone for HashAndFormat
source§fn clone(&self) -> HashAndFormat
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moresource§impl Debug for HashAndFormat
source§impl<'de> Deserialize<'de> for HashAndFormat
source§fn deserialize<D>(
deserializer: D
) -> Result<HashAndFormat, <D as Deserializer<'de>>::Error>where
- D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more§impl Display for HashAndFormat
source§impl From<DownloadKind> for HashAndFormat
source§fn from(value: DownloadKind) -> Self
Converts to this type from the input type.source§impl From<HashAndFormat> for DownloadKind
source§fn from(value: HashAndFormat) -> Self
Converts to this type from the input type.§impl FromStr for HashAndFormat
§impl Hash for HashAndFormat
§fn hash<__H>(&self, state: &mut __H)where
+ D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl Display for HashAndFormat
source§impl From<DownloadKind> for HashAndFormat
source§fn from(value: DownloadKind) -> Self
Converts to this type from the input type.source§impl From<HashAndFormat> for DownloadKind
source§fn from(value: HashAndFormat) -> Self
Converts to this type from the input type.source§impl FromStr for HashAndFormat
source§impl Hash for HashAndFormat
§impl MaxSize for HashAndFormat
§const POSTCARD_MAX_SIZE: usize = 33usize
The maximum possible size that the serialization of this
-type can have, in bytes.§impl Ord for HashAndFormat
source§impl MaxSize for HashAndFormat
source§const POSTCARD_MAX_SIZE: usize = 33usize
The maximum possible size that the serialization of this
+type can have, in bytes.source§impl Ord for HashAndFormat
source§fn cmp(&self, other: &HashAndFormat) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more§impl PartialEq for HashAndFormat
§fn eq(&self, other: &HashAndFormat) -> bool
Restrict a value to a certain interval. Read moresource§impl PartialEq for HashAndFormat
source§fn eq(&self, other: &HashAndFormat) -> bool
This method tests for self and other values to be equal, and is used
by ==.§impl PartialOrd for HashAndFormat
§fn partial_cmp(&self, other: &HashAndFormat) -> Option<Ordering>
source§impl PartialOrd for HashAndFormat
source§fn partial_cmp(&self, other: &HashAndFormat) -> Option<Ordering>
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 <=
operator. Read moresource§impl Serialize for HashAndFormat
source§fn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
- S: Serializer,
Serialize this value into the given Serde serializer. Read more§impl Value for HashAndFormat
§type SelfType<'a> = HashAndFormat
SelfType<’a> must be the same type as Self with all lifetimes replaced with ’a§type AsBytes<'a> = [u8; 33]
§fn fixed_width() -> Option<usize>
Width of a fixed type, or None for variable width§fn from_bytes<'a>(data: &'a [u8]) -> <HashAndFormat as Value>::SelfType<'a>where
+ S: Serializer,
Serialize this value into the given Serde serializer. Read moresource§impl Value for HashAndFormat
§type SelfType<'a> = HashAndFormat
SelfType<’a> must be the same type as Self with all lifetimes replaced with ’a§type AsBytes<'a> = [u8; 33]
source§fn fixed_width() -> Option<usize>
Width of a fixed type, or None for variable widthsource§fn from_bytes<'a>(data: &'a [u8]) -> <HashAndFormat as Value>::SelfType<'a>where
HashAndFormat: 'a,
Deserializes data
-Implementations may return a view over data, or an owned typesource§fn as_bytes<'a, 'b>(
value: &'a <HashAndFormat as Value>::SelfType<'b>
) -> <HashAndFormat as Value>::AsBytes<'a>where
'b: 'a,
- HashAndFormat: 'a + 'b,
Serialize the value to a slice§impl Copy for HashAndFormat
§impl Eq for HashAndFormat
§impl StructuralPartialEq for HashAndFormat
Auto Trait Implementations§
§impl Freeze for HashAndFormat
§impl RefUnwindSafe for HashAndFormat
§impl Send for HashAndFormat
§impl Sync for HashAndFormat
§impl Unpin for HashAndFormat
§impl UnwindSafe for HashAndFormat
Blanket Implementations§
source§impl<T> Any for Twhere
+ HashAndFormat: 'a + 'b,
Serialize the value to a slicesource§impl Copy for HashAndFormat
source§impl Eq for HashAndFormat
source§impl StructuralPartialEq for HashAndFormat
Auto Trait Implementations§
§impl Freeze for HashAndFormat
§impl RefUnwindSafe for HashAndFormat
§impl Send for HashAndFormat
§impl Sync for HashAndFormat
§impl Unpin for HashAndFormat
§impl UnwindSafe for HashAndFormat
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
diff --git a/pr/2595/docs/iroh_docs/actor/struct.SyncHandle.html b/pr/2595/docs/iroh_docs/actor/struct.SyncHandle.html
index cfd29c2ce8..6c70a0ff39 100644
--- a/pr/2595/docs/iroh_docs/actor/struct.SyncHandle.html
+++ b/pr/2595/docs/iroh_docs/actor/struct.SyncHandle.html
@@ -26,7 +26,7 @@ waiting for the actor to finish happens in an async context, and therefore that
namespace: NamespaceId,
author: AuthorId,
key: Bytes,
- hash: Hash,
+ hash: Hash,
len: u64
) -> Result<()>sourcepub async fn delete_prefix(
&self,
diff --git a/pr/2595/docs/iroh_docs/engine/enum.LiveEvent.html b/pr/2595/docs/iroh_docs/engine/enum.LiveEvent.html
index ceb8545b50..f0d33bcb21 100644
--- a/pr/2595/docs/iroh_docs/engine/enum.LiveEvent.html
+++ b/pr/2595/docs/iroh_docs/engine/enum.LiveEvent.html
@@ -3,34 +3,34 @@
entry: Entry,
},
InsertRemote {
- from: PublicKey,
+ from: PublicKey,
entry: Entry,
content_status: ContentStatus,
},
ContentReady {
- hash: Hash,
+ hash: Hash,
},
PendingContentReady,
- NeighborUp(PublicKey),
- NeighborDown(PublicKey),
+ NeighborUp(PublicKey),
+ NeighborDown(PublicKey),
SyncFinished(SyncEvent),
}Expand description
Events informing about actions of the live sync progress.
Variants§
§InsertLocal
A local insertion.
§InsertRemote
Received a remote insert.
-Fields
§from: PublicKeyThe peer that sent us the entry.
+Fields
§content_status: ContentStatusIf the content is available at the local node
§ContentReady
The content of an entry was downloaded and is now available at the local node
-Fields
§hash: HashThe content hash of the newly available entry content
+§PendingContentReady
All pending content is now ready.
This event signals that all queued content downloads from the last sync run have either
completed or failed.
It will only be emitted after a Self::SyncFinished event, never before.
Receiving this event does not guarantee that all content in the document is available. If
blobs failed to download, this event will still be emitted after all operations completed.
-§NeighborUp(PublicKey)
We have a new neighbor in the swarm.
-§NeighborDown(PublicKey)
We lost a neighbor in the swarm.
+§NeighborUp(PublicKey)
We have a new neighbor in the swarm.
+§NeighborDown(PublicKey)
We lost a neighbor in the swarm.
§SyncFinished(SyncEvent)
A set-reconciliation sync finished.
Trait Implementations§
source§impl<'de> Deserialize<'de> for LiveEvent
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl PartialEq for LiveEvent
source§fn eq(&self, other: &LiveEvent) -> bool
This method tests for self and other values to be equal, and is used
diff --git a/pr/2595/docs/iroh_docs/engine/fn.entry_to_content_status.html b/pr/2595/docs/iroh_docs/engine/fn.entry_to_content_status.html
index 459a6719d2..3b39df6428 100644
--- a/pr/2595/docs/iroh_docs/engine/fn.entry_to_content_status.html
+++ b/pr/2595/docs/iroh_docs/engine/fn.entry_to_content_status.html
@@ -1,2 +1,2 @@
-entry_to_content_status in iroh_docs::engine - Rust Function iroh_docs::engine::entry_to_content_status
source · pub fn entry_to_content_status(entry: Result<EntryStatus>) -> ContentStatus
Expand description
Converts an [EntryStatus] into a [‘ContentStatus’].
+entry_to_content_status in iroh_docs::engine - Rust Function iroh_docs::engine::entry_to_content_status
source · pub fn entry_to_content_status(entry: Result<EntryStatus>) -> ContentStatus
Expand description
Converts an EntryStatus into a [‘ContentStatus’].
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_docs/engine/index.html b/pr/2595/docs/iroh_docs/engine/index.html
index 5f78e23386..622ab4b871 100644
--- a/pr/2595/docs/iroh_docs/engine/index.html
+++ b/pr/2595/docs/iroh_docs/engine/index.html
@@ -1,4 +1,4 @@
iroh_docs::engine - Rust Expand description
Handlers and actors to for live syncing replicas.
crate::Replica is also called documents here.
Structs§
- Persistent default author for a docs engine.
- The sync engine coordinates actors that manage open documents, set-reconciliation syncs with
-peers and a gossip swarm for each syncing document.
- Event emitted when a sync operation completes
Enums§
- Where to persist the default author.
- Events informing about actions of the live sync progress.
- Why we performed a sync exchange
- Why we started a sync request
Functions§
- Converts an [
EntryStatus] into a [‘ContentStatus’].
\ No newline at end of file
+peers and a gossip swarm for each syncing document.Event emitted when a sync operation completes Enums§
- Where to persist the default author.
- Events informing about actions of the live sync progress.
- Why we performed a sync exchange
- Why we started a sync request
Functions§
- Converts an
EntryStatus into a [‘ContentStatus’].
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_docs/engine/struct.Engine.html b/pr/2595/docs/iroh_docs/engine/struct.Engine.html
index 1b88a96726..46cd25179e 100644
--- a/pr/2595/docs/iroh_docs/engine/struct.Engine.html
+++ b/pr/2595/docs/iroh_docs/engine/struct.Engine.html
@@ -8,12 +8,12 @@ peers and a gossip swarm for each syncing document.
Fields§
§endpoint: EndpointEndpoint used by the engine.
§sync: SyncHandleHandle to the actor thread.
The persistent default author for this engine.
-Implementations§
source§impl Engine
Implementations§
source§impl Engine
sourcepub async fn spawn<B: Store>(
endpoint: Endpoint,
- gossip: Gossip,
+ gossip: Gossip,
replica_store: Store,
bao_store: B,
- downloader: Downloader,
+ downloader: Downloader,
default_author_storage: DefaultAuthorStorage
) -> Result<Self>
Start the sync engine.
This will spawn two tokio tasks for the live sync coordination and gossip actors, and a
@@ -21,7 +21,7 @@ thread for the sourcepub async fn start_sync(
&self,
namespace: NamespaceId,
- peers: Vec<NodeAddr>
+ peers: Vec<NodeAddr>
) -> Result<()>
Start to sync a document.
If peers is non-empty, it will both do an initial set-reconciliation sync with each peer,
and join an iroh-gossip swarm with these peers to receive and broadcast document updates.
diff --git a/pr/2595/docs/iroh_docs/engine/struct.SyncEvent.html b/pr/2595/docs/iroh_docs/engine/struct.SyncEvent.html
index 49ba954022..d7eb730d81 100644
--- a/pr/2595/docs/iroh_docs/engine/struct.SyncEvent.html
+++ b/pr/2595/docs/iroh_docs/engine/struct.SyncEvent.html
@@ -1,11 +1,11 @@
SyncEvent in iroh_docs::engine - Rust pub struct SyncEvent {
- pub peer: PublicKey,
+ pub peer: PublicKey,
pub origin: Origin,
pub finished: SystemTime,
pub started: SystemTime,
pub result: Result<SyncDetails, String>,
}
Expand description
Event emitted when a sync operation completes
-Fields§
§peer: PublicKeyPeer we synced with
+Fields§
§peer: PublicKeyPeer we synced with
§origin: OriginOrigin of the sync exchange
§finished: SystemTimeTimestamp when the sync started
§started: SystemTimeTimestamp when the sync finished
diff --git a/pr/2595/docs/iroh_docs/index.html b/pr/2595/docs/iroh_docs/index.html
index a37d30e2a6..41c792c5e5 100644
--- a/pr/2595/docs/iroh_docs/index.html
+++ b/pr/2595/docs/iroh_docs/index.html
@@ -1,7 +1,7 @@
iroh_docs - Rust Expand description
Multi-dimensional key-value documents with an efficient synchronization protocol
The crate operates on Replicas. A replica contains an unlimited number of
Entries. Each entry is identified by a key, its author, and the replica’s
-namespace. Its value is the 32-byte BLAKE3 hash
+namespace. Its value is the 32-byte BLAKE3 hash
of the entry’s content data, the size of this content data, and a timestamp.
The content data itself is not stored or transferred through a replica.
All entries in a replica are signed with two keypairs:
diff --git a/pr/2595/docs/iroh_docs/net/enum.AcceptError.html b/pr/2595/docs/iroh_docs/net/enum.AcceptError.html
index 87e9a07ad3..cf11b5b695 100644
--- a/pr/2595/docs/iroh_docs/net/enum.AcceptError.html
+++ b/pr/2595/docs/iroh_docs/net/enum.AcceptError.html
@@ -3,31 +3,31 @@
error: Error,
},
Open {
- peer: PublicKey,
+ peer: PublicKey,
error: Error,
},
Abort {
- peer: PublicKey,
+ peer: PublicKey,
namespace: NamespaceId,
reason: AbortReason,
},
Sync {
- peer: PublicKey,
+ peer: PublicKey,
namespace: Option<NamespaceId>,
error: Error,
},
Close {
- peer: PublicKey,
+ peer: PublicKey,
namespace: Option<NamespaceId>,
error: Error,
},
}Expand description
Errors that may occur on handling incoming sync connections.
Variants§
§Connect
Failed to establish connection
§Open
Failed to open replica
-§Abort
We aborted the sync request.
-§Sync
Failed to run sync
-§Close
Failed to close
-Implementations§
source§impl AcceptError
Implementations§
Trait Implementations§
source§impl Debug for AcceptError
source§impl Display for AcceptError
source§impl Error for AcceptError
source§fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more1.0.0 · source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()Auto Trait Implementations§
§impl Freeze for AcceptError
§impl RefUnwindSafe for AcceptError
§impl Send for AcceptError
§impl Sync for AcceptError
§impl Unpin for AcceptError
§impl UnwindSafe for AcceptError
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
diff --git a/pr/2595/docs/iroh_docs/net/fn.connect_and_sync.html b/pr/2595/docs/iroh_docs/net/fn.connect_and_sync.html
index 1ee6909d53..7bec313309 100644
--- a/pr/2595/docs/iroh_docs/net/fn.connect_and_sync.html
+++ b/pr/2595/docs/iroh_docs/net/fn.connect_and_sync.html
@@ -2,6 +2,6 @@
endpoint: &Endpoint,
sync: &SyncHandle,
namespace: NamespaceId,
- peer: NodeAddr
+ peer: NodeAddr
) -> Result<SyncFinished, ConnectError>Expand description
Connect to a peer and sync a replica
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_docs/net/fn.handle_connection.html b/pr/2595/docs/iroh_docs/net/fn.handle_connection.html
index 347a0c22bf..e96816b362 100644
--- a/pr/2595/docs/iroh_docs/net/fn.handle_connection.html
+++ b/pr/2595/docs/iroh_docs/net/fn.handle_connection.html
@@ -3,6 +3,6 @@
connecting: Connecting,
accept_cb: F
) -> Result<SyncFinished, AcceptError>where
- F: Fn(NamespaceId, PublicKey) -> Fut,
+ F: Fn(NamespaceId, PublicKey) -> Fut,
Fut: Future<Output = AcceptOutcome>,Expand description
Handle an iroh-docs connection and sync all shared documents in the replica store.
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_docs/net/struct.SyncFinished.html b/pr/2595/docs/iroh_docs/net/struct.SyncFinished.html
index 74ab2f6632..dcd549e6fc 100644
--- a/pr/2595/docs/iroh_docs/net/struct.SyncFinished.html
+++ b/pr/2595/docs/iroh_docs/net/struct.SyncFinished.html
@@ -1,11 +1,11 @@
SyncFinished in iroh_docs::net - Rust Struct iroh_docs::net::SyncFinished
source · pub struct SyncFinished {
pub namespace: NamespaceId,
- pub peer: PublicKey,
+ pub peer: PublicKey,
pub outcome: SyncOutcome,
pub timings: Timings,
}
Expand description
Details of a finished sync operation.
Fields§
§namespace: NamespaceIdThe namespace that was synced.
-§peer: PublicKeyThe peer we syned with.
+§peer: PublicKeyThe peer we syned with.
§outcome: SyncOutcomeThe outcome of the sync operation
§timings: TimingsThe time this operation took
Trait Implementations§
source§impl Clone for SyncFinished
source§fn clone(&self) -> SyncFinished
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moreAuto Trait Implementations§
§impl Freeze for SyncFinished
§impl RefUnwindSafe for SyncFinished
§impl Send for SyncFinished
§impl Sync for SyncFinished
§impl Unpin for SyncFinished
§impl UnwindSafe for SyncFinished
Blanket Implementations§
source§impl<T> Any for Twhere
diff --git a/pr/2595/docs/iroh_docs/store/fs/struct.ContentHashesIterator.html b/pr/2595/docs/iroh_docs/store/fs/struct.ContentHashesIterator.html
index 8bebf68ec6..df1fc8865f 100644
--- a/pr/2595/docs/iroh_docs/store/fs/struct.ContentHashesIterator.html
+++ b/pr/2595/docs/iroh_docs/store/fs/struct.ContentHashesIterator.html
@@ -6,7 +6,7 @@ It needs a copy of a redb::ReadOnlyTable to be self-contained.
Implementations§
Trait Implementations§
source§impl Debug for ContentHashesIterator
Trait Implementations§
source§impl Debug for ContentHashesIterator
source§impl Iterator for ContentHashesIterator
source§fn next(&mut self) -> Option<Self::Item>
Advances the iterator and returns the next value. Read moresource§fn next_chunk<const N: usize>(
&mut self
) -> Result<[Self::Item; N], IntoIter<Self::Item, N>>where
Self: Sized,
🔬This is a nightly-only experimental API. (iter_next_chunk)Advances the iterator and returns an array containing the next N values. Read more1.0.0 · source§fn size_hint(&self) -> (usize, Option<usize>)
Returns the bounds on the remaining length of the iterator. Read more1.0.0 · source§fn count(self) -> usizewhere
diff --git a/pr/2595/docs/iroh_docs/struct.AuthorId.html b/pr/2595/docs/iroh_docs/struct.AuthorId.html
index 7dfa3dea5b..02221b0eb6 100644
--- a/pr/2595/docs/iroh_docs/struct.AuthorId.html
+++ b/pr/2595/docs/iroh_docs/struct.AuthorId.html
@@ -156,6 +156,6 @@ letters are used (e.g. F9B4CA)
Into<Dispatch>, source§fn with_current_subscriber(self) -> WithDispatch<Self>
source§impl<T> DeserializeOwned for Twhere
- T: for<'de> Deserialize<'de>,
§impl<T> PeerIdentity for Twhere
+ T: for<'de> Deserialize<'de>,
source§impl<T> PeerIdentity for T
source§impl<T> RuleType for T
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_docs/struct.AuthorPublicKey.html b/pr/2595/docs/iroh_docs/struct.AuthorPublicKey.html
index 8e72b11c8a..7a83ce68e4 100644
--- a/pr/2595/docs/iroh_docs/struct.AuthorPublicKey.html
+++ b/pr/2595/docs/iroh_docs/struct.AuthorPublicKey.html
@@ -148,6 +148,6 @@ builds. Into<Dispatch>,source§fn with_current_subscriber(self) -> WithDispatch<Self>
source§impl<T> DeserializeOwned for Twhere
- T: for<'de> Deserialize<'de>,
§impl<T> PeerIdentity for Twhere
+ T: for<'de> Deserialize<'de>,
source§impl<T> PeerIdentity for T
source§impl<T> RuleType for T
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_docs/struct.DocTicket.html b/pr/2595/docs/iroh_docs/struct.DocTicket.html
index d53a93c4c4..fd1bb5eb02 100644
--- a/pr/2595/docs/iroh_docs/struct.DocTicket.html
+++ b/pr/2595/docs/iroh_docs/struct.DocTicket.html
@@ -1,13 +1,13 @@
DocTicket in iroh_docs - Rust pub struct DocTicket {
pub capability: Capability,
- pub nodes: Vec<NodeAddr>,
+ pub nodes: Vec<NodeAddr>,
}
Expand description
Contains both a key (either secret or public) to a document, and a list of peers to join.
Fields§
§capability: Capabilityeither a public or private key
-§nodes: Vec<NodeAddr>A list of nodes to contact.
-Implementations§
source§impl DocTicket
sourcepub fn new(capability: Capability, peers: Vec<NodeAddr>) -> Self
Create a new doc ticket
+§nodes: Vec<NodeAddr>A list of nodes to contact.
+Implementations§
Trait Implementations§
source§impl<'de> Deserialize<'de> for DocTicket
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
- __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreAuto Trait Implementations§
§impl Freeze for DocTicket
§impl RefUnwindSafe for DocTicket
§impl Send for DocTicket
§impl Sync for DocTicket
§impl Unpin for DocTicket
§impl UnwindSafe for DocTicket
Blanket Implementations§
source§impl<T> Any for Twhere
+ __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreAuto Trait Implementations§
§impl Freeze for DocTicket
§impl RefUnwindSafe for DocTicket
§impl Send for DocTicket
§impl Sync for DocTicket
§impl Unpin for DocTicket
§impl UnwindSafe for DocTicket
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
diff --git a/pr/2595/docs/iroh_docs/struct.NamespaceId.html b/pr/2595/docs/iroh_docs/struct.NamespaceId.html
index 433d51afc6..f9acda8e94 100644
--- a/pr/2595/docs/iroh_docs/struct.NamespaceId.html
+++ b/pr/2595/docs/iroh_docs/struct.NamespaceId.html
@@ -156,6 +156,6 @@ letters are used (e.g. F9B4CA)
Into<Dispatch>, source§fn with_current_subscriber(self) -> WithDispatch<Self>
source§impl<T> DeserializeOwned for Twhere
- T: for<'de> Deserialize<'de>,
§impl<T> PeerIdentity for Twhere
+ T: for<'de> Deserialize<'de>,
source§impl<T> PeerIdentity for T
source§impl<T> RuleType for T
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_docs/struct.NamespacePublicKey.html b/pr/2595/docs/iroh_docs/struct.NamespacePublicKey.html
index 350dea9049..72b75ed510 100644
--- a/pr/2595/docs/iroh_docs/struct.NamespacePublicKey.html
+++ b/pr/2595/docs/iroh_docs/struct.NamespacePublicKey.html
@@ -147,6 +147,6 @@ builds.Into<Dispatch>,source§fn with_current_subscriber(self) -> WithDispatch<Self>
source§impl<T> DeserializeOwned for Twhere
- T: for<'de> Deserialize<'de>,
§impl<T> PeerIdentity for Twhere
+ T: for<'de> Deserialize<'de>,
source§impl<T> PeerIdentity for T
source§impl<T> RuleType for T
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_docs/sync/struct.Entry.html b/pr/2595/docs/iroh_docs/sync/struct.Entry.html
index 55bf06044f..055a4b6f54 100644
--- a/pr/2595/docs/iroh_docs/sync/struct.Entry.html
+++ b/pr/2595/docs/iroh_docs/sync/struct.Entry.html
@@ -1,6 +1,6 @@
Entry in iroh_docs::sync - Rust pub struct Entry { /* private fields */ }
Expand description
A single entry in a Replica
An entry is identified by a key, its Author, and the Replica’s
-NamespaceSecret. Its value is the 32-byte BLAKE3 hash
+NamespaceSecret. Its value is the 32-byte BLAKE3 hash
of the entry’s content data, the size of this content data, and a timestamp.
Implementations§
source§impl Entry
sourcepub fn new(id: RecordIdentifier, record: Record) -> Self
Create a new entry
sourcepub fn new_empty(id: RecordIdentifier) -> Self
Create a new empty entry with the current timestamp.
@@ -15,7 +15,7 @@ of the entry’s content data, the size of this content data, and a timestamp.
sourcepub fn sign(self, namespace: &NamespaceSecret, author: &Author) -> SignedEntry
Sign this entry with a NamespaceSecret and Author.
Methods from Deref<Target = Record>§
sourcepub fn content_len(&self) -> u64
Get the length of the data addressed by this record’s content hash.
-sourcepub fn content_hash(&self) -> Hash
Get the [struct@Hash] of the content data of this record.
+sourcepub fn content_hash(&self) -> Hash
Get the Hash of the content data of this record.
Trait Implementations§
source§impl<'de> Deserialize<'de> for Entry
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl From<SignedEntry> for Entry
source§fn from(value: SignedEntry) -> Self
Converts to this type from the input type.source§impl Ord for Entry
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
diff --git a/pr/2595/docs/iroh_docs/sync/struct.Record.html b/pr/2595/docs/iroh_docs/sync/struct.Record.html
index 94479a973e..f06cccab52 100644
--- a/pr/2595/docs/iroh_docs/sync/struct.Record.html
+++ b/pr/2595/docs/iroh_docs/sync/struct.Record.html
@@ -1,11 +1,11 @@
Record in iroh_docs::sync - Rust pub struct Record { /* private fields */ }
Expand description
The data part of an entry in a Replica.
-Implementations§
source§impl Record
Implementations§
source§impl Record
sourcepub fn empty_current() -> Self
Create a tombstone record with the timestamp set to now.
sourcepub fn new_current(hash: Hash, len: u64) -> Self
Create a new Record with the timestamp set to now.
+sourcepub fn new_current(hash: Hash, len: u64) -> Self
Create a new Record with the timestamp set to now.
sourcepub fn content_len(&self) -> u64
Get the length of the data addressed by this record’s content hash.
-sourcepub fn content_hash(&self) -> Hash
Get the [struct@Hash] of the content data of this record.
+sourcepub fn content_hash(&self) -> Hash
Get the Hash of the content data of this record.
Trait Implementations§
source§impl<'de> Deserialize<'de> for Record
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl Ord for Record
Ordering for entry values.
diff --git a/pr/2595/docs/iroh_docs/sync/struct.Replica.html b/pr/2595/docs/iroh_docs/sync/struct.Replica.html
index 23a9798651..c4e161f3c3 100644
--- a/pr/2595/docs/iroh_docs/sync/struct.Replica.html
+++ b/pr/2595/docs/iroh_docs/sync/struct.Replica.html
@@ -5,7 +5,7 @@
&mut self,
key: impl AsRef<[u8]>,
author: &Author,
- hash: Hash,
+ hash: Hash,
len: u64
) -> Result<usize, InsertError>Insert a new record at the given key.
The entry will by signed by the provided author.
@@ -35,7 +35,7 @@ or an error if the entry failed to validate or if a store operation failed.
key: impl AsRef<[u8]>,
author: &Author,
data: impl AsRef<[u8]>
-) -> Result<Hash, InsertError>Hashes the given data and inserts it.
+) -> Result<Hash, InsertError>Hashes the given data and inserts it.
This does not store the content, just the record of it.
Returns the calculated hash.
sourcepub fn record_id(
diff --git a/pr/2595/docs/iroh_docs/sync/struct.SignedEntry.html b/pr/2595/docs/iroh_docs/sync/struct.SignedEntry.html
index 21644eacb1..9ef5e98134 100644
--- a/pr/2595/docs/iroh_docs/sync/struct.SignedEntry.html
+++ b/pr/2595/docs/iroh_docs/sync/struct.SignedEntry.html
@@ -14,7 +14,7 @@
sourcepub fn signature(&self) -> &EntrySignature
Get the signature.
sourcepub fn validate_empty(&self) -> Result<(), ValidationFailure>
Validate that the entry has the empty hash if the length is 0, or a non-zero length.
sourcepub fn content_hash(&self) -> Hash
Get the content [struct@Hash] of the entry.
+sourcepub fn content_hash(&self) -> Hash
Get the content Hash of the entry.
sourcepub fn content_len(&self) -> u64
Get the content length of the entry.
Get the author bytes of this entry.
Methods from Deref<Target = Record>§
sourcepub fn content_len(&self) -> u64
Get the length of the data addressed by this record’s content hash.
-sourcepub fn content_hash(&self) -> Hash
Get the [struct@Hash] of the content data of this record.
+sourcepub fn content_hash(&self) -> Hash
Get the Hash of the content data of this record.
Trait Implementations§
source§impl Clone for SignedEntry
source§fn clone(&self) -> SignedEntry
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moresource§impl Debug for SignedEntry
source§impl Deref for SignedEntry
source§impl<'de> Deserialize<'de> for SignedEntry
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl From<SignedEntry> for Entry
source§fn from(value: SignedEntry) -> Self
Converts to this type from the input type.source§impl Ord for SignedEntry
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
diff --git a/pr/2595/docs/iroh_docs/sync/type.ContentStatusCallback.html b/pr/2595/docs/iroh_docs/sync/type.ContentStatusCallback.html
index 46d5a5a49c..84ffdbe8ee 100644
--- a/pr/2595/docs/iroh_docs/sync/type.ContentStatusCallback.html
+++ b/pr/2595/docs/iroh_docs/sync/type.ContentStatusCallback.html
@@ -1,2 +1,2 @@
-ContentStatusCallback in iroh_docs::sync - Rust Type Alias iroh_docs::sync::ContentStatusCallback
source · pub type ContentStatusCallback = Arc<dyn Fn(Hash) -> ContentStatus + Send + Sync + 'static>;
Expand description
Callback that may be set on a replica to determine the availability status for a content hash.
+ContentStatusCallback in iroh_docs::sync - Rust Type Alias iroh_docs::sync::ContentStatusCallback
source · pub type ContentStatusCallback = Arc<dyn Fn(Hash) -> ContentStatus + Send + Sync + 'static>;
Expand description
Callback that may be set on a replica to determine the availability status for a content hash.
Aliased Type§
struct ContentStatusCallback { /* private fields */ }
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_net/discovery/dns/index.html b/pr/2595/docs/iroh_net/discovery/dns/index.html
index 5a80538422..a752b49d78 100644
--- a/pr/2595/docs/iroh_net/discovery/dns/index.html
+++ b/pr/2595/docs/iroh_net/discovery/dns/index.html
@@ -1,2 +1,2 @@
-iroh_net::discovery::dns - Rust Expand description
DNS node discovery for iroh-net
+iroh_net::discovery::dns - Rust Expand description
DNS node discovery for iroh-net
Structs§
- DNS node discovery
Constants§
- The n0 testing DNS node origin, for production.
- The n0 testing DNS node origin, for testing.
- Testing DNS node origin, must run server from
crate::test_utils::DnsPkarrServer.
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_net/discovery/dns/struct.DnsDiscovery.html b/pr/2595/docs/iroh_net/discovery/dns/struct.DnsDiscovery.html
index 3e7d5d71cc..7628fb45a9 100644
--- a/pr/2595/docs/iroh_net/discovery/dns/struct.DnsDiscovery.html
+++ b/pr/2595/docs/iroh_net/discovery/dns/struct.DnsDiscovery.html
@@ -28,7 +28,7 @@ custom discovery mechanism.
For testing it is also possible to use the N0_DNS_NODE_ORIGIN_STAGING domain
with DnsDiscovery::new. This would then use a hosted discovery service again,
but for testing purposes.
-Trait Implementations§
Trait Implementations§
source§impl Debug for DnsDiscovery
source§impl Discovery for DnsDiscovery
source§fn resolve(
&self,
ep: Endpoint,
node_id: NodeId
diff --git a/pr/2595/docs/iroh_net/discovery/trait.Discovery.html b/pr/2595/docs/iroh_net/discovery/trait.Discovery.html
index a53a618708..d3832a56b5 100644
--- a/pr/2595/docs/iroh_net/discovery/trait.Discovery.html
+++ b/pr/2595/docs/iroh_net/discovery/trait.Discovery.html
@@ -29,4 +29,4 @@ These tasks will be run on the runtime of the Option<BoxStream<Result<DiscoveryItem>>>
Implementors§
source§impl Discovery for DnsDiscovery
source§impl Discovery for LocalSwarmDiscovery
source§impl Discovery for PkarrPublisher
source§impl Discovery for PkarrResolver
source§impl Discovery for ConcurrentDiscovery
\ No newline at end of file
+
Implementors§
source§impl Discovery for DnsDiscovery
source§impl Discovery for LocalSwarmDiscovery
source§impl Discovery for PkarrPublisher
source§impl Discovery for PkarrResolver
source§impl Discovery for ConcurrentDiscovery
\ No newline at end of file
diff --git a/pr/2595/docs/src/iroh_net/discovery/dns.rs.html b/pr/2595/docs/src/iroh_net/discovery/dns.rs.html
index dd1a279fb3..1d32545ed3 100644
--- a/pr/2595/docs/src/iroh_net/discovery/dns.rs.html
+++ b/pr/2595/docs/src/iroh_net/discovery/dns.rs.html
@@ -97,6 +97,10 @@
97
98
99
+100
+101
+102
+103
//! DNS node discovery for iroh-net
use anyhow::Result;
@@ -182,6 +186,10 @@
fn resolve(&self, ep: Endpoint, node_id: NodeId) -> Option<BoxStream<Result<DiscoveryItem>>> {
let resolver = ep.dns_resolver().clone();
let origin_domain = self.origin_domain.clone();
+ #[cfg(any(test, feature = "test-utils"))]
+ if origin_domain.contains(&TEST_DNS_NODE_ORIGIN.to_string()) {
+ panic!("wait. THIS IS ILLEGAL!");
+ }
let fut = async move {
let node_addr = resolver
.lookup_by_id_staggered(&node_id, &origin_domain, DNS_STAGGERING_MS)
diff --git a/pr/2595/docs/trait.impl/iroh_base/ticket/trait.Ticket.js b/pr/2595/docs/trait.impl/iroh_base/ticket/trait.Ticket.js
index 12fa1e3ee5..5d209fabd2 100644
--- a/pr/2595/docs/trait.impl/iroh_base/ticket/trait.Ticket.js
+++ b/pr/2595/docs/trait.impl/iroh_base/ticket/trait.Ticket.js
@@ -1,5 +1,5 @@
(function() {var implementors = {
"iroh":[],
"iroh_base":[],
-"iroh_docs":[["impl Ticket for DocTicket"]]
+"iroh_docs":[["impl Ticket for DocTicket"]]
};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
diff --git a/pr/2595/docs/type.impl/std/primitive.array.js b/pr/2595/docs/type.impl/std/primitive.array.js
index 588a8b53a3..3006964922 100644
--- a/pr/2595/docs/type.impl/std/primitive.array.js
+++ b/pr/2595/docs/type.impl/std/primitive.array.js
@@ -1,4 +1,4 @@
(function() {var type_impls = {
"iroh":[["source§impl<T, const N: usize> [T; N]
1.55.0 · sourcepub fn map<F, U>(self, f: F) -> [U; N]where\n F: FnMut(T) -> U,
Returns an array of the same size as self, with function f applied to each element\nin order.
\nIf you don’t necessarily need a new fixed-size array, consider using\nIterator::map instead.
\n§Note on performance and stack usage
\nUnfortunately, usages of this method are currently not always optimized\nas well as they could be. This mainly concerns large arrays, as mapping\nover small arrays seem to be optimized just fine. Also note that in\ndebug mode (i.e. without any optimizations), this method can use a lot\nof stack space (a few times the size of the array or more).
\nTherefore, in performance-critical code, try to avoid using this method\non large arrays or check the emitted code. Also try to avoid chained\nmaps (e.g. arr.map(...).map(...)).
\nIn many cases, you can instead use Iterator::map by calling .iter()\nor .into_iter() on your array. [T; N]::map is only necessary if you\nreally need a new array of the same size as the result. Rust’s lazy\niterators tend to get optimized very well.
\n§Examples
\nlet x = [1, 2, 3];\nlet y = x.map(|v| v + 1);\nassert_eq!(y, [2, 3, 4]);\n\nlet x = [1, 2, 3];\nlet mut temp = 0;\nlet y = x.map(|v| { temp += 1; v * temp });\nassert_eq!(y, [1, 4, 9]);\n\nlet x = [\"Ferris\", \"Bueller's\", \"Day\", \"Off\"];\nlet y = x.map(|v| v.len());\nassert_eq!(y, [6, 9, 3, 3]);
\nsourcepub fn try_map<F, R>(\n self,\n f: F\n) -> <<R as Try>::Residual as Residual<[<R as Try>::Output; N]>>::TryType
🔬This is a nightly-only experimental API. (array_try_map)
A fallible function f applied to each element on array self in order to\nreturn an array the same size as self or the first error encountered.
\nThe return type of this function depends on the return type of the closure.\nIf you return Result<T, E> from the closure, you’ll get a Result<[T; N], E>.\nIf you return Option<T> from the closure, you’ll get an Option<[T; N]>.
\n§Examples
\n#![feature(array_try_map)]\n\nlet a = [\"1\", \"2\", \"3\"];\nlet b = a.try_map(|v| v.parse::<u32>()).unwrap().map(|v| v + 1);\nassert_eq!(b, [2, 3, 4]);\n\nlet a = [\"1\", \"2a\", \"3\"];\nlet b = a.try_map(|v| v.parse::<u32>());\nassert!(b.is_err());\n\nuse std::num::NonZero;\n\nlet z = [1, 2, 0, 3, 4];\nassert_eq!(z.try_map(NonZero::new), None);\n\nlet a = [1, 2, 3];\nlet b = a.try_map(NonZero::new);\nlet c = b.map(|x| x.map(NonZero::get));\nassert_eq!(c, Some(a));
\n1.57.0 (const: 1.57.0) · sourcepub const fn as_slice(&self) -> &[T]
Returns a slice containing the entire array. Equivalent to &s[..].
\n1.57.0 · sourcepub fn as_mut_slice(&mut self) -> &mut [T]
Returns a mutable slice containing the entire array. Equivalent to\n&mut s[..].
\n1.77.0 · sourcepub fn each_ref(&self) -> [&T; N]
Borrows each element and returns an array of references with the same\nsize as self.
\n§Example
\nlet floats = [3.1, 2.7, -1.0];\nlet float_refs: [&f64; 3] = floats.each_ref();\nassert_eq!(float_refs, [&3.1, &2.7, &-1.0]);
\nThis method is particularly useful if combined with other methods, like\nmap. This way, you can avoid moving the original\narray if its elements are not Copy.
\n\nlet strings = [\"Ferris\".to_string(), \"♥\".to_string(), \"Rust\".to_string()];\nlet is_ascii = strings.each_ref().map(|s| s.is_ascii());\nassert_eq!(is_ascii, [true, false, true]);\n\n// We can still access the original array: it has not been moved.\nassert_eq!(strings.len(), 3);
\n1.77.0 · sourcepub fn each_mut(&mut self) -> [&mut T; N]
Borrows each element mutably and returns an array of mutable references\nwith the same size as self.
\n§Example
\n\nlet mut floats = [3.1, 2.7, -1.0];\nlet float_refs: [&mut f64; 3] = floats.each_mut();\n*float_refs[0] = 0.0;\nassert_eq!(float_refs, [&mut 0.0, &mut 2.7, &mut -1.0]);\nassert_eq!(floats, [0.0, 2.7, -1.0]);
\nsourcepub fn split_array_ref<const M: usize>(&self) -> (&[T; M], &[T])
🔬This is a nightly-only experimental API. (split_array)
Divides one array reference into two at an index.
\nThe first will contain all indices from [0, M) (excluding\nthe index M itself) and the second will contain all\nindices from [M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet v = [1, 2, 3, 4, 5, 6];\n\n{\n let (left, right) = v.split_array_ref::<0>();\n assert_eq!(left, &[]);\n assert_eq!(right, &[1, 2, 3, 4, 5, 6]);\n}\n\n{\n let (left, right) = v.split_array_ref::<2>();\n assert_eq!(left, &[1, 2]);\n assert_eq!(right, &[3, 4, 5, 6]);\n}\n\n{\n let (left, right) = v.split_array_ref::<6>();\n assert_eq!(left, &[1, 2, 3, 4, 5, 6]);\n assert_eq!(right, &[]);\n}
\nsourcepub fn split_array_mut<const M: usize>(&mut self) -> (&mut [T; M], &mut [T])
🔬This is a nightly-only experimental API. (split_array)
Divides one mutable array reference into two at an index.
\nThe first will contain all indices from [0, M) (excluding\nthe index M itself) and the second will contain all\nindices from [M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet mut v = [1, 0, 3, 0, 5, 6];\nlet (left, right) = v.split_array_mut::<2>();\nassert_eq!(left, &mut [1, 0][..]);\nassert_eq!(right, &mut [3, 0, 5, 6]);\nleft[1] = 2;\nright[1] = 4;\nassert_eq!(v, [1, 2, 3, 4, 5, 6]);
\nsourcepub fn rsplit_array_ref<const M: usize>(&self) -> (&[T], &[T; M])
🔬This is a nightly-only experimental API. (split_array)
Divides one array reference into two at an index from the end.
\nThe first will contain all indices from [0, N - M) (excluding\nthe index N - M itself) and the second will contain all\nindices from [N - M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet v = [1, 2, 3, 4, 5, 6];\n\n{\n let (left, right) = v.rsplit_array_ref::<0>();\n assert_eq!(left, &[1, 2, 3, 4, 5, 6]);\n assert_eq!(right, &[]);\n}\n\n{\n let (left, right) = v.rsplit_array_ref::<2>();\n assert_eq!(left, &[1, 2, 3, 4]);\n assert_eq!(right, &[5, 6]);\n}\n\n{\n let (left, right) = v.rsplit_array_ref::<6>();\n assert_eq!(left, &[]);\n assert_eq!(right, &[1, 2, 3, 4, 5, 6]);\n}
\nsourcepub fn rsplit_array_mut<const M: usize>(&mut self) -> (&mut [T], &mut [T; M])
🔬This is a nightly-only experimental API. (split_array)
Divides one mutable array reference into two at an index from the end.
\nThe first will contain all indices from [0, N - M) (excluding\nthe index N - M itself) and the second will contain all\nindices from [N - M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet mut v = [1, 0, 3, 0, 5, 6];\nlet (left, right) = v.rsplit_array_mut::<4>();\nassert_eq!(left, &mut [1, 0]);\nassert_eq!(right, &mut [3, 0, 5, 6][..]);\nleft[1] = 2;\nright[1] = 4;\nassert_eq!(v, [1, 2, 3, 4, 5, 6]);
\n",0,"iroh::docs::PeerIdBytes"],["source§impl<const N: usize> [u8; N]
sourcepub const fn as_ascii(&self) -> Option<&[AsciiChar; N]>
🔬This is a nightly-only experimental API. (ascii_char)
Converts this array of bytes into a array of ASCII characters,\nor returns None if any of the characters is non-ASCII.
\n§Examples
\n#![feature(ascii_char)]\n#![feature(const_option)]\n\nconst HEX_DIGITS: [std::ascii::Char; 16] =\n *b\"0123456789abcdef\".as_ascii().unwrap();\n\nassert_eq!(HEX_DIGITS[1].as_str(), \"1\");\nassert_eq!(HEX_DIGITS[10].as_str(), \"a\");
\nsourcepub const unsafe fn as_ascii_unchecked(&self) -> &[AsciiChar; N]
🔬This is a nightly-only experimental API. (ascii_char)
Converts this array of bytes into a array of ASCII characters,\nwithout checking whether they’re valid.
\n§Safety
\nEvery byte in the array must be in 0..=127, or else this is UB.
\n",0,"iroh::docs::PeerIdBytes"],["§impl<T> Array for [T; 32]where\n T: Default,
§fn as_slice_mut(&mut self) -> &mut [T]
Gives a unique slice over the whole thing. Read more","Array","iroh::docs::PeerIdBytes"],["","Array","iroh::docs::PeerIdBytes"],["§impl<const N: usize, T> AsBytes for [T; N]where\n T: AsBytes,
§fn write_to_prefix(&self, bytes: &mut [u8]) -> Option<()>
","AsBytes","iroh::docs::PeerIdBytes"],["","AsBytes","iroh::docs::PeerIdBytes"],["","AsMut<[T]>","iroh::docs::PeerIdBytes"],["","AsRef<[T]>","iroh::docs::PeerIdBytes"],["§impl<T, const N: usize> BitView for [T; N]where\n T: BitStore,
Note that overly-large arrays may cause the conversions to fail.
\n§fn view_bits<O>(&self) -> &BitSlice<T, O>where\n O: BitOrder,
Views a memory region as an immutable bit-slice.§fn try_view_bits<O>(&self) -> Result<&BitSlice<T, O>, BitSpanError<T>>where\n O: BitOrder,
Attempts to view a memory region as an immutable bit-slice. Read more§fn view_bits_mut<O>(&mut self) -> &mut BitSlice<T, O>where\n O: BitOrder,
Views a memory region as a mutable bit-slice.§fn try_view_bits_mut<O>(\n &mut self\n) -> Result<&mut BitSlice<T, O>, BitSpanError<T>>where\n O: BitOrder,
Attempts to view a memory region as a mutable bit-slice. Read more","BitView","iroh::docs::PeerIdBytes"],["§impl<T, const N: usize> BitViewSized for [T; N]where\n T: BitStore,
§fn as_raw_slice(&self) -> &[<[T; N] as BitView>::Store]
Views the type as a slice of its elements.§fn as_raw_mut_slice(&mut self) -> &mut [<[T; N] as BitView>::Store]
Views the type as a mutable slice of its elements.§fn into_bitarray<O>(self) -> BitArray<Self, O>where\n O: BitOrder,
Wraps self in a BitArray.","BitViewSized","iroh::docs::PeerIdBytes"],["","Borrow<[T]>","iroh::docs::PeerIdBytes"],["1.4.0 · source§impl<T, const N: usize> BorrowMut<[T]> for [T; N]
source§fn borrow_mut(&mut self) -> &mut [T]
Mutably borrows from an owned value. Read more","BorrowMut<[T]>","iroh::docs::PeerIdBytes"],["","Chain","iroh::docs::PeerIdBytes"],["","Clone","iroh::docs::PeerIdBytes"],["","Debug","iroh::docs::PeerIdBytes"],["§impl<const N: usize> Decode for [u8; N]
Decodes a byte array from byte[n] as described in RFC4251 § 5:
\n\nA byte represents an arbitrary 8-bit value (octet). Fixed length\ndata is sometimes represented as an array of bytes, written\nbyte[n], where n is the number of bytes in the array.
\n
\n","Decode","iroh::docs::PeerIdBytes"],["§impl<'a, T, const N: usize> DecodeValue<'a> for [T; N]where\n T: Decode<'a>,
§fn decode_value<R>(reader: &mut R, header: Header) -> Result<[T; N], Error>where\n R: Reader<'a>,
Attempt to decode this message using the provided [Reader].","DecodeValue<'a>","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["source§impl<'de, T> Deserialize<'de> for [T; 32]where\n T: Deserialize<'de>,
source§fn deserialize<D>(\n deserializer: D\n) -> Result<[T; 32], <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more","Deserialize<'de>","iroh::docs::PeerIdBytes"],["source§impl<'de, const N: usize> Deserialize<'de> for [u8; N]
source§fn deserialize<D>(\n deserializer: D\n) -> Result<[u8; N], <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
","Deserialize<'de>","iroh::docs::PeerIdBytes"],["§impl<const N: usize> Encode for [u8; N]
Encodes [u8; N] into byte[n] as described in RFC4251 § 5:
\n\nA byte represents an arbitrary 8-bit value (octet). Fixed length\ndata is sometimes represented as an array of bytes, written\nbyte[n], where n is the number of bytes in the array.
\n
\n§fn encoded_len(&self) -> Result<usize, Error>
Get the length of this type encoded in bytes, prior to Base64 encoding.§fn encode(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value using the provided [Writer].§fn encoded_len_prefixed(&self) -> Result<usize, Error>
Return the length of this type after encoding when prepended with a\nuint32 length prefix.§fn encode_prefixed(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value, first prepending a uint32 length prefix\nset to [Encode::encoded_len].","Encode","iroh::docs::PeerIdBytes"],["","EncodeLabelSet","iroh::docs::PeerIdBytes"],["§impl<T, const N: usize> EncodeValue for [T; N]where\n T: Encode,
","EncodeValue","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["§impl<'a> FindToken<&'a u8> for [u8; 32]
§fn find_token(&self, token: &u8) -> bool
Returns true if self contains the token","FindToken<&'a u8>","iroh::docs::PeerIdBytes"],["§impl FindToken<u8> for [u8; 32]
§fn find_token(&self, token: u8) -> bool
Returns true if self contains the token","FindToken","iroh::docs::PeerIdBytes"],["","FixedTag","iroh::docs::PeerIdBytes"],["","From<&Signature>","iroh::docs::PeerIdBytes"],["","From","iroh::docs::PeerIdBytes"],["§impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>>> for [T; 32]
","From, B0>, B0>, B0>, B0>, B0>>>","iroh::docs::PeerIdBytes"],["","From","iroh::docs::PeerIdBytes"],["","From","iroh::docs::PeerIdBytes"],["","From>","iroh::docs::PeerIdBytes"],["","From","iroh::docs::PeerIdBytes"],["","From","iroh::docs::PeerIdBytes"],["","From","iroh::docs::PeerIdBytes"],["","From>","iroh::docs::PeerIdBytes"],["§impl<const N: usize, T> FromBytes for [T; N]where\n T: FromBytes,
§fn slice_from_prefix(bytes: &[u8], count: usize) -> Option<(&[Self], &[u8])>where\n Self: Sized,
Interprets the prefix of the given bytes as a &[Self] with length\nequal to count without copying. Read more§fn slice_from_suffix(bytes: &[u8], count: usize) -> Option<(&[u8], &[Self])>where\n Self: Sized,
Interprets the suffix of the given bytes as a &[Self] with length\nequal to count without copying. Read more§fn read_from_prefix(bytes: &[u8]) -> Option<Self>where\n Self: Sized,
","FromBytes","iroh::docs::PeerIdBytes"],["","FromHex","iroh::docs::PeerIdBytes"],["","FromZeroes","iroh::docs::PeerIdBytes"],["","Hash","iroh::docs::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Hash for [T; N]where\n T: Hash,
The hash of an array is the same as that of the corresponding slice,\nas required by the Borrow implementation.
\n\nuse std::hash::BuildHasher;\n\nlet b = std::hash::RandomState::new();\nlet a: [u8; 3] = [0xa8, 0x3c, 0x09];\nlet s: &[u8] = &[0xa8, 0x3c, 0x09];\nassert_eq!(b.hash_one(a), b.hash_one(s));
\n","Hash","iroh::docs::PeerIdBytes"],["","Index","iroh::docs::PeerIdBytes"],["","IndexMut","iroh::docs::PeerIdBytes"],["","InputLength","iroh::docs::PeerIdBytes"],["1.53.0 · source§impl<T, const N: usize> IntoIterator for [T; N]
source§fn into_iter(self) -> <[T; N] as IntoIterator>::IntoIter
Creates a consuming iterator, that is, one that moves each value out of\nthe array (from start to end). The array cannot be used after calling\nthis unless T implements Copy, so the whole array is copied.
\nArrays have special behavior when calling .into_iter() prior to the\n2021 edition – see the array Editions section for more information.
\n","IntoIterator","iroh::docs::PeerIdBytes"],["§impl<const N: usize> IntoResponse for [u8; N]
§fn into_response(self) -> Response<Body>
Create a response.","IntoResponse","iroh::docs::PeerIdBytes"],["§impl<Fut, const N: usize> Join for [Fut; N]where\n Fut: IntoFuture,
§type Output = [<Fut as IntoFuture>::Output; N]
The resulting output type.§type Future = Join<<Fut as IntoFuture>::IntoFuture, N>
The Future implementation returned by this method.","Join","iroh::docs::PeerIdBytes"],["","Key","iroh::docs::PeerIdBytes"],["§impl<T, const N: usize> MaxSize for [T; N]where\n T: MaxSize,
§const POSTCARD_MAX_SIZE: usize = _
The maximum possible size that the serialization of this\ntype can have, in bytes.","MaxSize","iroh::docs::PeerIdBytes"],["","Merge","iroh::docs::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Ord for [T; N]where\n T: Ord,
Implements comparison of arrays lexicographically.
\n1.21.0 · source§fn max(self, other: Self) -> Selfwhere\n Self: Sized,
Compares and returns the maximum of two values. Read more","Ord","iroh::docs::PeerIdBytes"],["","PartialEq<&[U]>","iroh::docs::PeerIdBytes"],["1.0.0 · source§impl<T, U, const N: usize> PartialEq<&mut [U]> for [T; N]where\n T: PartialEq<U>,
","PartialEq<&mut [U]>","iroh::docs::PeerIdBytes"],["","PartialEq<[U]>","iroh::docs::PeerIdBytes"],["","PartialEq<[U; N]>","iroh::docs::PeerIdBytes"],["","PartialEq","iroh::docs::PeerIdBytes"],["§impl<A, B, const N: usize, const M: usize> PartialEq<Vec<A, N>> for [B; M]where\n A: PartialEq<B>,
","PartialEq>","iroh::docs::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> PartialOrd for [T; N]where\n T: PartialOrd,
Implements comparison of arrays lexicographically.
\nsource§fn le(&self, other: &[T; N]) -> bool
This method tests less than or equal to (for self and other) and is used by the <=\noperator. Read more","PartialOrd","iroh::docs::PeerIdBytes"],["§impl<Fut, const N: usize> Race for [Fut; N]where\n Fut: IntoFuture,
§type Output = <Fut as IntoFuture>::Output
The resulting output type.§type Future = Race<<Fut as IntoFuture>::IntoFuture, N>
Which kind of future are we turning this into?","Race","iroh::docs::PeerIdBytes"],["§impl<Fut, T, E, const N: usize> RaceOk for [Fut; N]where\n Fut: IntoFuture<Output = Result<T, E>>,
§type Future = RaceOk<<Fut as IntoFuture>::IntoFuture, T, E, N>
Which kind of future are we turning this into?","RaceOk","iroh::docs::PeerIdBytes"],["","Schema","iroh::docs::PeerIdBytes"],["source§impl<T> Serialize for [T; 32]where\n T: 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","iroh::docs::PeerIdBytes"],["source§impl<const N: usize> Serialize for [u8; N]
source§fn serialize<S>(\n &self,\n serializer: S\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where\n S: Serializer,
","Serialize","iroh::docs::PeerIdBytes"],["1.51.0 · source§impl<T, const N: usize> SlicePattern for [T; N]
","SlicePattern","iroh::docs::PeerIdBytes"],["1.34.0 · source§impl<T, const N: usize> TryFrom<&[T]> for [T; N]where\n T: Copy,
Tries to create an array [T; N] by copying from a slice &[T]. Succeeds if\nslice.len() == N.
\n\nlet bytes: [u8; 3] = [1, 0, 2];\n\nlet bytes_head: [u8; 2] = <[u8; 2]>::try_from(&bytes[0..2]).unwrap();\nassert_eq!(1, u16::from_le_bytes(bytes_head));\n\nlet bytes_tail: [u8; 2] = bytes[1..3].try_into().unwrap();\nassert_eq!(512, u16::from_le_bytes(bytes_tail));
\n§type Error = TryFromSliceError
The type returned in the event of a conversion error.","TryFrom<&[T]>","iroh::docs::PeerIdBytes"],["1.59.0 · source§impl<T, const N: usize> TryFrom<&mut [T]> for [T; N]where\n T: Copy,
Tries to create an array [T; N] by copying from a mutable slice &mut [T].\nSucceeds if slice.len() == N.
\n\nlet mut bytes: [u8; 3] = [1, 0, 2];\n\nlet bytes_head: [u8; 2] = <[u8; 2]>::try_from(&mut bytes[0..2]).unwrap();\nassert_eq!(1, u16::from_le_bytes(bytes_head));\n\nlet bytes_tail: [u8; 2] = (&mut bytes[1..3]).try_into().unwrap();\nassert_eq!(512, u16::from_le_bytes(bytes_tail));
\n§type Error = TryFromSliceError
The type returned in the event of a conversion error.","TryFrom<&mut [T]>","iroh::docs::PeerIdBytes"],["§impl<T, A, const N: usize> TryFrom<Vec<T, A>> for [T; N]where\n A: Allocator,
§fn try_from(vec: Vec<T, A>) -> Result<[T; N], Vec<T, A>>
Gets the entire contents of the Vec<T> as an array,\nif its size exactly matches that of the requested array.
\n§Examples
\nassert_eq!(vec![1, 2, 3].try_into(), Ok([1, 2, 3]));\nassert_eq!(<Vec<i32>>::new().try_into(), Ok([]));
\nIf the length doesn’t match, the input comes back in Err:
\n\nlet r: Result<[i32; 4], _> = (0..10).collect::<Vec<_>>().try_into();\nassert_eq!(r, Err(vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9]));
\nIf you’re fine with just getting a prefix of the Vec<T>,\nyou can call .truncate(N) first.
\n\nlet mut v = String::from(\"hello world\").into_bytes();\nv.sort();\nv.truncate(2);\nlet [a, b]: [_; 2] = v.try_into().unwrap();\nassert_eq!(a, b' ');\nassert_eq!(b, b'd');
\n","TryFrom>","iroh::docs::PeerIdBytes"],["1.48.0 · source§impl<T, A, const N: usize> TryFrom<Vec<T, A>> for [T; N]where\n A: Allocator,
source§fn try_from(vec: Vec<T, A>) -> Result<[T; N], Vec<T, A>>
Gets the entire contents of the Vec<T> as an array,\nif its size exactly matches that of the requested array.
\n§Examples
\nassert_eq!(vec![1, 2, 3].try_into(), Ok([1, 2, 3]));\nassert_eq!(<Vec<i32>>::new().try_into(), Ok([]));
\nIf the length doesn’t match, the input comes back in Err:
\n\nlet r: Result<[i32; 4], _> = (0..10).collect::<Vec<_>>().try_into();\nassert_eq!(r, Err(vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9]));
\nIf you’re fine with just getting a prefix of the Vec<T>,\nyou can call .truncate(N) first.
\n\nlet mut v = String::from(\"hello world\").into_bytes();\nv.sort();\nv.truncate(2);\nlet [a, b]: [_; 2] = v.try_into().unwrap();\nassert_eq!(a, b' ');\nassert_eq!(b, b'd');
\n","TryFrom>","iroh::docs::PeerIdBytes"],["§impl<Fut, T, E, const N: usize> TryJoin for [Fut; N]where\n Fut: IntoFuture<Output = Result<T, E>>,
§type Future = TryJoin<<Fut as IntoFuture>::IntoFuture, T, E, N>
Which kind of future are we turning this into?","TryJoin","iroh::docs::PeerIdBytes"],["§impl<const N: usize, T> Value for [T; N]where\n T: Value,
§type SelfType<'a> = [<T as Value>::SelfType<'a>; N]\nwhere\n [T; N]: 'a
SelfType<’a> must be the same type as Self with all lifetimes replaced with ’a§type AsBytes<'a> = Vec<u8>\nwhere\n [T; N]: 'a
§fn fixed_width() -> Option<usize>
Width of a fixed type, or None for variable width§fn from_bytes<'a>(data: &'a [u8]) -> [<T as Value>::SelfType<'a>; N]where\n [T; N]: 'a,
Deserializes data\nImplementations may return a view over data, or an owned type","Value","iroh::docs::PeerIdBytes"],["","ValueOrd","iroh::docs::PeerIdBytes"],["§impl<Z, const N: usize> Zeroize for [Z; N]where\n Z: Zeroize,
Impl [Zeroize] on arrays of types that impl [Zeroize].
\n","Zeroize","iroh::docs::PeerIdBytes"],["","Zip","iroh::docs::PeerIdBytes"],["source§impl<T, const N: usize> ConstParamTy for [T; N]where\n T: ConstParamTy,
","ConstParamTy","iroh::docs::PeerIdBytes"],["1.58.0 · source§impl<T, const N: usize> Copy for [T; N]where\n T: Copy,
","Copy","iroh::docs::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Eq for [T; N]where\n T: Eq,
","Eq","iroh::docs::PeerIdBytes"],["source§impl<T, const N: usize> StructuralPartialEq for [T; N]
","StructuralPartialEq","iroh::docs::PeerIdBytes"],["§impl<const N: usize, T> Unaligned for [T; N]where\n T: Unaligned,
","Unaligned","iroh::docs::PeerIdBytes"],["§impl<Z, const N: usize> ZeroizeOnDrop for [Z; N]where\n Z: ZeroizeOnDrop,
Impl [ZeroizeOnDrop] on arrays of types that impl [ZeroizeOnDrop].
\n","ZeroizeOnDrop","iroh::docs::PeerIdBytes"]],
-"iroh_docs":[["source§impl<T, const N: usize> [T; N]
1.55.0 · sourcepub fn map<F, U>(self, f: F) -> [U; N]where\n F: FnMut(T) -> U,
Returns an array of the same size as self, with function f applied to each element\nin order.
\nIf you don’t necessarily need a new fixed-size array, consider using\nIterator::map instead.
\n§Note on performance and stack usage
\nUnfortunately, usages of this method are currently not always optimized\nas well as they could be. This mainly concerns large arrays, as mapping\nover small arrays seem to be optimized just fine. Also note that in\ndebug mode (i.e. without any optimizations), this method can use a lot\nof stack space (a few times the size of the array or more).
\nTherefore, in performance-critical code, try to avoid using this method\non large arrays or check the emitted code. Also try to avoid chained\nmaps (e.g. arr.map(...).map(...)).
\nIn many cases, you can instead use Iterator::map by calling .iter()\nor .into_iter() on your array. [T; N]::map is only necessary if you\nreally need a new array of the same size as the result. Rust’s lazy\niterators tend to get optimized very well.
\n§Examples
\nlet x = [1, 2, 3];\nlet y = x.map(|v| v + 1);\nassert_eq!(y, [2, 3, 4]);\n\nlet x = [1, 2, 3];\nlet mut temp = 0;\nlet y = x.map(|v| { temp += 1; v * temp });\nassert_eq!(y, [1, 4, 9]);\n\nlet x = [\"Ferris\", \"Bueller's\", \"Day\", \"Off\"];\nlet y = x.map(|v| v.len());\nassert_eq!(y, [6, 9, 3, 3]);
\nsourcepub fn try_map<F, R>(\n self,\n f: F\n) -> <<R as Try>::Residual as Residual<[<R as Try>::Output; N]>>::TryType
🔬This is a nightly-only experimental API. (array_try_map)
A fallible function f applied to each element on array self in order to\nreturn an array the same size as self or the first error encountered.
\nThe return type of this function depends on the return type of the closure.\nIf you return Result<T, E> from the closure, you’ll get a Result<[T; N], E>.\nIf you return Option<T> from the closure, you’ll get an Option<[T; N]>.
\n§Examples
\n#![feature(array_try_map)]\n\nlet a = [\"1\", \"2\", \"3\"];\nlet b = a.try_map(|v| v.parse::<u32>()).unwrap().map(|v| v + 1);\nassert_eq!(b, [2, 3, 4]);\n\nlet a = [\"1\", \"2a\", \"3\"];\nlet b = a.try_map(|v| v.parse::<u32>());\nassert!(b.is_err());\n\nuse std::num::NonZero;\n\nlet z = [1, 2, 0, 3, 4];\nassert_eq!(z.try_map(NonZero::new), None);\n\nlet a = [1, 2, 3];\nlet b = a.try_map(NonZero::new);\nlet c = b.map(|x| x.map(NonZero::get));\nassert_eq!(c, Some(a));
\n1.57.0 (const: 1.57.0) · sourcepub const fn as_slice(&self) -> &[T]
Returns a slice containing the entire array. Equivalent to &s[..].
\n1.57.0 · sourcepub fn as_mut_slice(&mut self) -> &mut [T]
Returns a mutable slice containing the entire array. Equivalent to\n&mut s[..].
\n1.77.0 · sourcepub fn each_ref(&self) -> [&T; N]
Borrows each element and returns an array of references with the same\nsize as self.
\n§Example
\nlet floats = [3.1, 2.7, -1.0];\nlet float_refs: [&f64; 3] = floats.each_ref();\nassert_eq!(float_refs, [&3.1, &2.7, &-1.0]);
\nThis method is particularly useful if combined with other methods, like\nmap. This way, you can avoid moving the original\narray if its elements are not Copy.
\n\nlet strings = [\"Ferris\".to_string(), \"♥\".to_string(), \"Rust\".to_string()];\nlet is_ascii = strings.each_ref().map(|s| s.is_ascii());\nassert_eq!(is_ascii, [true, false, true]);\n\n// We can still access the original array: it has not been moved.\nassert_eq!(strings.len(), 3);
\n1.77.0 · sourcepub fn each_mut(&mut self) -> [&mut T; N]
Borrows each element mutably and returns an array of mutable references\nwith the same size as self.
\n§Example
\n\nlet mut floats = [3.1, 2.7, -1.0];\nlet float_refs: [&mut f64; 3] = floats.each_mut();\n*float_refs[0] = 0.0;\nassert_eq!(float_refs, [&mut 0.0, &mut 2.7, &mut -1.0]);\nassert_eq!(floats, [0.0, 2.7, -1.0]);
\nsourcepub fn split_array_ref<const M: usize>(&self) -> (&[T; M], &[T])
🔬This is a nightly-only experimental API. (split_array)
Divides one array reference into two at an index.
\nThe first will contain all indices from [0, M) (excluding\nthe index M itself) and the second will contain all\nindices from [M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet v = [1, 2, 3, 4, 5, 6];\n\n{\n let (left, right) = v.split_array_ref::<0>();\n assert_eq!(left, &[]);\n assert_eq!(right, &[1, 2, 3, 4, 5, 6]);\n}\n\n{\n let (left, right) = v.split_array_ref::<2>();\n assert_eq!(left, &[1, 2]);\n assert_eq!(right, &[3, 4, 5, 6]);\n}\n\n{\n let (left, right) = v.split_array_ref::<6>();\n assert_eq!(left, &[1, 2, 3, 4, 5, 6]);\n assert_eq!(right, &[]);\n}
\nsourcepub fn split_array_mut<const M: usize>(&mut self) -> (&mut [T; M], &mut [T])
🔬This is a nightly-only experimental API. (split_array)
Divides one mutable array reference into two at an index.
\nThe first will contain all indices from [0, M) (excluding\nthe index M itself) and the second will contain all\nindices from [M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet mut v = [1, 0, 3, 0, 5, 6];\nlet (left, right) = v.split_array_mut::<2>();\nassert_eq!(left, &mut [1, 0][..]);\nassert_eq!(right, &mut [3, 0, 5, 6]);\nleft[1] = 2;\nright[1] = 4;\nassert_eq!(v, [1, 2, 3, 4, 5, 6]);
\nsourcepub fn rsplit_array_ref<const M: usize>(&self) -> (&[T], &[T; M])
🔬This is a nightly-only experimental API. (split_array)
Divides one array reference into two at an index from the end.
\nThe first will contain all indices from [0, N - M) (excluding\nthe index N - M itself) and the second will contain all\nindices from [N - M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet v = [1, 2, 3, 4, 5, 6];\n\n{\n let (left, right) = v.rsplit_array_ref::<0>();\n assert_eq!(left, &[1, 2, 3, 4, 5, 6]);\n assert_eq!(right, &[]);\n}\n\n{\n let (left, right) = v.rsplit_array_ref::<2>();\n assert_eq!(left, &[1, 2, 3, 4]);\n assert_eq!(right, &[5, 6]);\n}\n\n{\n let (left, right) = v.rsplit_array_ref::<6>();\n assert_eq!(left, &[]);\n assert_eq!(right, &[1, 2, 3, 4, 5, 6]);\n}
\nsourcepub fn rsplit_array_mut<const M: usize>(&mut self) -> (&mut [T], &mut [T; M])
🔬This is a nightly-only experimental API. (split_array)
Divides one mutable array reference into two at an index from the end.
\nThe first will contain all indices from [0, N - M) (excluding\nthe index N - M itself) and the second will contain all\nindices from [N - M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet mut v = [1, 0, 3, 0, 5, 6];\nlet (left, right) = v.rsplit_array_mut::<4>();\nassert_eq!(left, &mut [1, 0]);\nassert_eq!(right, &mut [3, 0, 5, 6][..]);\nleft[1] = 2;\nright[1] = 4;\nassert_eq!(v, [1, 2, 3, 4, 5, 6]);
\n",0,"iroh_docs::sync::PeerIdBytes"],["source§impl<const N: usize> [u8; N]
sourcepub const fn as_ascii(&self) -> Option<&[AsciiChar; N]>
🔬This is a nightly-only experimental API. (ascii_char)
Converts this array of bytes into a array of ASCII characters,\nor returns None if any of the characters is non-ASCII.
\n§Examples
\n#![feature(ascii_char)]\n#![feature(const_option)]\n\nconst HEX_DIGITS: [std::ascii::Char; 16] =\n *b\"0123456789abcdef\".as_ascii().unwrap();\n\nassert_eq!(HEX_DIGITS[1].as_str(), \"1\");\nassert_eq!(HEX_DIGITS[10].as_str(), \"a\");
\nsourcepub const unsafe fn as_ascii_unchecked(&self) -> &[AsciiChar; N]
🔬This is a nightly-only experimental API. (ascii_char)
Converts this array of bytes into a array of ASCII characters,\nwithout checking whether they’re valid.
\n§Safety
\nEvery byte in the array must be in 0..=127, or else this is UB.
\n",0,"iroh_docs::sync::PeerIdBytes"],["§impl<T> Array for [T; 32]where\n T: Default,
§fn as_slice_mut(&mut self) -> &mut [T]
Gives a unique slice over the whole thing. Read more","Array","iroh_docs::sync::PeerIdBytes"],["","Array","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> AsBytes for [T; N]where\n T: AsBytes,
§fn write_to_prefix(&self, bytes: &mut [u8]) -> Option<()>
","AsBytes","iroh_docs::sync::PeerIdBytes"],["","AsBytes","iroh_docs::sync::PeerIdBytes"],["","AsMut<[T]>","iroh_docs::sync::PeerIdBytes"],["","AsRef<[T]>","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> BitView for [T; N]where\n T: BitStore,
Note that overly-large arrays may cause the conversions to fail.
\n§fn view_bits<O>(&self) -> &BitSlice<T, O>where\n O: BitOrder,
Views a memory region as an immutable bit-slice.§fn try_view_bits<O>(&self) -> Result<&BitSlice<T, O>, BitSpanError<T>>where\n O: BitOrder,
Attempts to view a memory region as an immutable bit-slice. Read more§fn view_bits_mut<O>(&mut self) -> &mut BitSlice<T, O>where\n O: BitOrder,
Views a memory region as a mutable bit-slice.§fn try_view_bits_mut<O>(\n &mut self\n) -> Result<&mut BitSlice<T, O>, BitSpanError<T>>where\n O: BitOrder,
Attempts to view a memory region as a mutable bit-slice. Read more","BitView","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> BitViewSized for [T; N]where\n T: BitStore,
§fn as_raw_slice(&self) -> &[<[T; N] as BitView>::Store]
Views the type as a slice of its elements.§fn as_raw_mut_slice(&mut self) -> &mut [<[T; N] as BitView>::Store]
Views the type as a mutable slice of its elements.§fn into_bitarray<O>(self) -> BitArray<Self, O>where\n O: BitOrder,
Wraps self in a BitArray.","BitViewSized","iroh_docs::sync::PeerIdBytes"],["","Borrow<[T]>","iroh_docs::sync::PeerIdBytes"],["1.4.0 · source§impl<T, const N: usize> BorrowMut<[T]> for [T; N]
source§fn borrow_mut(&mut self) -> &mut [T]
Mutably borrows from an owned value. Read more","BorrowMut<[T]>","iroh_docs::sync::PeerIdBytes"],["","Chain","iroh_docs::sync::PeerIdBytes"],["","Clone","iroh_docs::sync::PeerIdBytes"],["","Debug","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize> Decode for [u8; N]
Decodes a byte array from byte[n] as described in RFC4251 § 5:
\n\nA byte represents an arbitrary 8-bit value (octet). Fixed length\ndata is sometimes represented as an array of bytes, written\nbyte[n], where n is the number of bytes in the array.
\n
\n","Decode","iroh_docs::sync::PeerIdBytes"],["§impl<'a, T, const N: usize> DecodeValue<'a> for [T; N]where\n T: Decode<'a>,
§fn decode_value<R>(reader: &mut R, header: Header) -> Result<[T; N], Error>where\n R: Reader<'a>,
Attempt to decode this message using the provided [Reader].","DecodeValue<'a>","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["source§impl<'de, T> Deserialize<'de> for [T; 32]where\n T: Deserialize<'de>,
source§fn deserialize<D>(\n deserializer: D\n) -> Result<[T; 32], <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more","Deserialize<'de>","iroh_docs::sync::PeerIdBytes"],["source§impl<'de, const N: usize> Deserialize<'de> for [u8; N]
source§fn deserialize<D>(\n deserializer: D\n) -> Result<[u8; N], <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
","Deserialize<'de>","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize> Encode for [u8; N]
Encodes [u8; N] into byte[n] as described in RFC4251 § 5:
\n\nA byte represents an arbitrary 8-bit value (octet). Fixed length\ndata is sometimes represented as an array of bytes, written\nbyte[n], where n is the number of bytes in the array.
\n
\n§fn encoded_len(&self) -> Result<usize, Error>
Get the length of this type encoded in bytes, prior to Base64 encoding.§fn encode(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value using the provided [Writer].§fn encoded_len_prefixed(&self) -> Result<usize, Error>
Return the length of this type after encoding when prepended with a\nuint32 length prefix.§fn encode_prefixed(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value, first prepending a uint32 length prefix\nset to [Encode::encoded_len].","Encode","iroh_docs::sync::PeerIdBytes"],["","EncodeLabelSet","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> EncodeValue for [T; N]where\n T: Encode,
","EncodeValue","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["§impl<'a> FindToken<&'a u8> for [u8; 32]
§fn find_token(&self, token: &u8) -> bool
Returns true if self contains the token","FindToken<&'a u8>","iroh_docs::sync::PeerIdBytes"],["§impl FindToken<u8> for [u8; 32]
§fn find_token(&self, token: u8) -> bool
Returns true if self contains the token","FindToken","iroh_docs::sync::PeerIdBytes"],["","FixedTag","iroh_docs::sync::PeerIdBytes"],["","From<&Signature>","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["§impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>>> for [T; 32]
","From, B0>, B0>, B0>, B0>, B0>>>","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["","From>","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["source§impl From<NamespaceId> for [u8; 32]
source§fn from(value: NamespaceId) -> Self
Converts to this type from the input type.","From","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["","From>","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> FromBytes for [T; N]where\n T: FromBytes,
§fn slice_from_prefix(bytes: &[u8], count: usize) -> Option<(&[Self], &[u8])>where\n Self: Sized,
Interprets the prefix of the given bytes as a &[Self] with length\nequal to count without copying. Read more§fn slice_from_suffix(bytes: &[u8], count: usize) -> Option<(&[u8], &[Self])>where\n Self: Sized,
Interprets the suffix of the given bytes as a &[Self] with length\nequal to count without copying. Read more§fn read_from_prefix(bytes: &[u8]) -> Option<Self>where\n Self: Sized,
","FromBytes","iroh_docs::sync::PeerIdBytes"],["","FromHex","iroh_docs::sync::PeerIdBytes"],["","FromZeroes","iroh_docs::sync::PeerIdBytes"],["","Hash","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Hash for [T; N]where\n T: Hash,
The hash of an array is the same as that of the corresponding slice,\nas required by the Borrow implementation.
\n\nuse std::hash::BuildHasher;\n\nlet b = std::hash::RandomState::new();\nlet a: [u8; 3] = [0xa8, 0x3c, 0x09];\nlet s: &[u8] = &[0xa8, 0x3c, 0x09];\nassert_eq!(b.hash_one(a), b.hash_one(s));
\n","Hash","iroh_docs::sync::PeerIdBytes"],["","Index","iroh_docs::sync::PeerIdBytes"],["","IndexMut","iroh_docs::sync::PeerIdBytes"],["","InputLength","iroh_docs::sync::PeerIdBytes"],["1.53.0 · source§impl<T, const N: usize> IntoIterator for [T; N]
source§fn into_iter(self) -> <[T; N] as IntoIterator>::IntoIter
Creates a consuming iterator, that is, one that moves each value out of\nthe array (from start to end). The array cannot be used after calling\nthis unless T implements Copy, so the whole array is copied.
\nArrays have special behavior when calling .into_iter() prior to the\n2021 edition – see the array Editions section for more information.
\n","IntoIterator","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize> IntoResponse for [u8; N]
§fn into_response(self) -> Response<Body>
Create a response.","IntoResponse","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, const N: usize> Join for [Fut; N]where\n Fut: IntoFuture,
§type Output = [<Fut as IntoFuture>::Output; N]
The resulting output type.§type Future = Join<<Fut as IntoFuture>::IntoFuture, N>
The Future implementation returned by this method.","Join","iroh_docs::sync::PeerIdBytes"],["","Key","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> MaxSize for [T; N]where\n T: MaxSize,
§const POSTCARD_MAX_SIZE: usize = _
The maximum possible size that the serialization of this\ntype can have, in bytes.","MaxSize","iroh_docs::sync::PeerIdBytes"],["","Merge","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Ord for [T; N]where\n T: Ord,
Implements comparison of arrays lexicographically.
\n1.21.0 · source§fn max(self, other: Self) -> Selfwhere\n Self: Sized,
Compares and returns the maximum of two values. Read more","Ord","iroh_docs::sync::PeerIdBytes"],["","PartialEq<&[U]>","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, U, const N: usize> PartialEq<&mut [U]> for [T; N]where\n T: PartialEq<U>,
","PartialEq<&mut [U]>","iroh_docs::sync::PeerIdBytes"],["","PartialEq<[U]>","iroh_docs::sync::PeerIdBytes"],["","PartialEq<[U; N]>","iroh_docs::sync::PeerIdBytes"],["","PartialEq","iroh_docs::sync::PeerIdBytes"],["§impl<A, B, const N: usize, const M: usize> PartialEq<Vec<A, N>> for [B; M]where\n A: PartialEq<B>,
","PartialEq>","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> PartialOrd for [T; N]where\n T: PartialOrd,
Implements comparison of arrays lexicographically.
\nsource§fn le(&self, other: &[T; N]) -> bool
This method tests less than or equal to (for self and other) and is used by the <=\noperator. Read more","PartialOrd","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, const N: usize> Race for [Fut; N]where\n Fut: IntoFuture,
§type Output = <Fut as IntoFuture>::Output
The resulting output type.§type Future = Race<<Fut as IntoFuture>::IntoFuture, N>
Which kind of future are we turning this into?","Race","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, T, E, const N: usize> RaceOk for [Fut; N]where\n Fut: IntoFuture<Output = Result<T, E>>,
§type Future = RaceOk<<Fut as IntoFuture>::IntoFuture, T, E, N>
Which kind of future are we turning this into?","RaceOk","iroh_docs::sync::PeerIdBytes"],["","Schema","iroh_docs::sync::PeerIdBytes"],["source§impl<T> Serialize for [T; 32]where\n T: 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","iroh_docs::sync::PeerIdBytes"],["source§impl<const N: usize> Serialize for [u8; N]
source§fn serialize<S>(\n &self,\n serializer: S\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where\n S: Serializer,
","Serialize","iroh_docs::sync::PeerIdBytes"],["1.51.0 · source§impl<T, const N: usize> SlicePattern for [T; N]
","SlicePattern","iroh_docs::sync::PeerIdBytes"],["1.34.0 · source§impl<T, const N: usize> TryFrom<&[T]> for [T; N]where\n T: Copy,
Tries to create an array [T; N] by copying from a slice &[T]. Succeeds if\nslice.len() == N.
\n\nlet bytes: [u8; 3] = [1, 0, 2];\n\nlet bytes_head: [u8; 2] = <[u8; 2]>::try_from(&bytes[0..2]).unwrap();\nassert_eq!(1, u16::from_le_bytes(bytes_head));\n\nlet bytes_tail: [u8; 2] = bytes[1..3].try_into().unwrap();\nassert_eq!(512, u16::from_le_bytes(bytes_tail));
\n§type Error = TryFromSliceError
The type returned in the event of a conversion error.","TryFrom<&[T]>","iroh_docs::sync::PeerIdBytes"],["1.59.0 · source§impl<T, const N: usize> TryFrom<&mut [T]> for [T; N]where\n T: Copy,
Tries to create an array [T; N] by copying from a mutable slice &mut [T].\nSucceeds if slice.len() == N.
\n\nlet mut bytes: [u8; 3] = [1, 0, 2];\n\nlet bytes_head: [u8; 2] = <[u8; 2]>::try_from(&mut bytes[0..2]).unwrap();\nassert_eq!(1, u16::from_le_bytes(bytes_head));\n\nlet bytes_tail: [u8; 2] = (&mut bytes[1..3]).try_into().unwrap();\nassert_eq!(512, u16::from_le_bytes(bytes_tail));
\n§type Error = TryFromSliceError
The type returned in the event of a conversion error.","TryFrom<&mut [T]>","iroh_docs::sync::PeerIdBytes"],["§impl<T, A, const N: usize> TryFrom<Vec<T, A>> for [T; N]where\n A: Allocator,
§fn try_from(vec: Vec<T, A>) -> Result<[T; N], Vec<T, A>>
Gets the entire contents of the Vec<T> as an array,\nif its size exactly matches that of the requested array.
\n§Examples
\nassert_eq!(vec![1, 2, 3].try_into(), Ok([1, 2, 3]));\nassert_eq!(<Vec<i32>>::new().try_into(), Ok([]));
\nIf the length doesn’t match, the input comes back in Err:
\n\nlet r: Result<[i32; 4], _> = (0..10).collect::<Vec<_>>().try_into();\nassert_eq!(r, Err(vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9]));
\nIf you’re fine with just getting a prefix of the Vec<T>,\nyou can call .truncate(N) first.
\n\nlet mut v = String::from(\"hello world\").into_bytes();\nv.sort();\nv.truncate(2);\nlet [a, b]: [_; 2] = v.try_into().unwrap();\nassert_eq!(a, b' ');\nassert_eq!(b, b'd');
\n","TryFrom>","iroh_docs::sync::PeerIdBytes"],["1.48.0 · source§impl<T, A, const N: usize> TryFrom<Vec<T, A>> for [T; N]where\n A: Allocator,
source§fn try_from(vec: Vec<T, A>) -> Result<[T; N], Vec<T, A>>
Gets the entire contents of the Vec<T> as an array,\nif its size exactly matches that of the requested array.
\n§Examples
\nassert_eq!(vec![1, 2, 3].try_into(), Ok([1, 2, 3]));\nassert_eq!(<Vec<i32>>::new().try_into(), Ok([]));
\nIf the length doesn’t match, the input comes back in Err:
\n\nlet r: Result<[i32; 4], _> = (0..10).collect::<Vec<_>>().try_into();\nassert_eq!(r, Err(vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9]));
\nIf you’re fine with just getting a prefix of the Vec<T>,\nyou can call .truncate(N) first.
\n\nlet mut v = String::from(\"hello world\").into_bytes();\nv.sort();\nv.truncate(2);\nlet [a, b]: [_; 2] = v.try_into().unwrap();\nassert_eq!(a, b' ');\nassert_eq!(b, b'd');
\n","TryFrom>","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, T, E, const N: usize> TryJoin for [Fut; N]where\n Fut: IntoFuture<Output = Result<T, E>>,
§type Future = TryJoin<<Fut as IntoFuture>::IntoFuture, T, E, N>
Which kind of future are we turning this into?","TryJoin","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> Value for [T; N]where\n T: Value,
§type SelfType<'a> = [<T as Value>::SelfType<'a>; N]\nwhere\n [T; N]: 'a
SelfType<’a> must be the same type as Self with all lifetimes replaced with ’a§type AsBytes<'a> = Vec<u8>\nwhere\n [T; N]: 'a
§fn fixed_width() -> Option<usize>
Width of a fixed type, or None for variable width§fn from_bytes<'a>(data: &'a [u8]) -> [<T as Value>::SelfType<'a>; N]where\n [T; N]: 'a,
Deserializes data\nImplementations may return a view over data, or an owned type","Value","iroh_docs::sync::PeerIdBytes"],["","ValueOrd","iroh_docs::sync::PeerIdBytes"],["§impl<Z, const N: usize> Zeroize for [Z; N]where\n Z: Zeroize,
Impl [Zeroize] on arrays of types that impl [Zeroize].
\n","Zeroize","iroh_docs::sync::PeerIdBytes"],["","Zip","iroh_docs::sync::PeerIdBytes"],["source§impl<T, const N: usize> ConstParamTy for [T; N]where\n T: ConstParamTy,
","ConstParamTy","iroh_docs::sync::PeerIdBytes"],["1.58.0 · source§impl<T, const N: usize> Copy for [T; N]where\n T: Copy,
","Copy","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Eq for [T; N]where\n T: Eq,
","Eq","iroh_docs::sync::PeerIdBytes"],["source§impl<T, const N: usize> StructuralPartialEq for [T; N]
","StructuralPartialEq","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> Unaligned for [T; N]where\n T: Unaligned,
","Unaligned","iroh_docs::sync::PeerIdBytes"],["§impl<Z, const N: usize> ZeroizeOnDrop for [Z; N]where\n Z: ZeroizeOnDrop,
Impl [ZeroizeOnDrop] on arrays of types that impl [ZeroizeOnDrop].
\n","ZeroizeOnDrop","iroh_docs::sync::PeerIdBytes"]]
+"iroh_docs":[["source§impl<T, const N: usize> [T; N]
1.55.0 · sourcepub fn map<F, U>(self, f: F) -> [U; N]where\n F: FnMut(T) -> U,
Returns an array of the same size as self, with function f applied to each element\nin order.
\nIf you don’t necessarily need a new fixed-size array, consider using\nIterator::map instead.
\n§Note on performance and stack usage
\nUnfortunately, usages of this method are currently not always optimized\nas well as they could be. This mainly concerns large arrays, as mapping\nover small arrays seem to be optimized just fine. Also note that in\ndebug mode (i.e. without any optimizations), this method can use a lot\nof stack space (a few times the size of the array or more).
\nTherefore, in performance-critical code, try to avoid using this method\non large arrays or check the emitted code. Also try to avoid chained\nmaps (e.g. arr.map(...).map(...)).
\nIn many cases, you can instead use Iterator::map by calling .iter()\nor .into_iter() on your array. [T; N]::map is only necessary if you\nreally need a new array of the same size as the result. Rust’s lazy\niterators tend to get optimized very well.
\n§Examples
\nlet x = [1, 2, 3];\nlet y = x.map(|v| v + 1);\nassert_eq!(y, [2, 3, 4]);\n\nlet x = [1, 2, 3];\nlet mut temp = 0;\nlet y = x.map(|v| { temp += 1; v * temp });\nassert_eq!(y, [1, 4, 9]);\n\nlet x = [\"Ferris\", \"Bueller's\", \"Day\", \"Off\"];\nlet y = x.map(|v| v.len());\nassert_eq!(y, [6, 9, 3, 3]);
\nsourcepub fn try_map<F, R>(\n self,\n f: F\n) -> <<R as Try>::Residual as Residual<[<R as Try>::Output; N]>>::TryType
🔬This is a nightly-only experimental API. (array_try_map)
A fallible function f applied to each element on array self in order to\nreturn an array the same size as self or the first error encountered.
\nThe return type of this function depends on the return type of the closure.\nIf you return Result<T, E> from the closure, you’ll get a Result<[T; N], E>.\nIf you return Option<T> from the closure, you’ll get an Option<[T; N]>.
\n§Examples
\n#![feature(array_try_map)]\n\nlet a = [\"1\", \"2\", \"3\"];\nlet b = a.try_map(|v| v.parse::<u32>()).unwrap().map(|v| v + 1);\nassert_eq!(b, [2, 3, 4]);\n\nlet a = [\"1\", \"2a\", \"3\"];\nlet b = a.try_map(|v| v.parse::<u32>());\nassert!(b.is_err());\n\nuse std::num::NonZero;\n\nlet z = [1, 2, 0, 3, 4];\nassert_eq!(z.try_map(NonZero::new), None);\n\nlet a = [1, 2, 3];\nlet b = a.try_map(NonZero::new);\nlet c = b.map(|x| x.map(NonZero::get));\nassert_eq!(c, Some(a));
\n1.57.0 (const: 1.57.0) · sourcepub const fn as_slice(&self) -> &[T]
Returns a slice containing the entire array. Equivalent to &s[..].
\n1.57.0 · sourcepub fn as_mut_slice(&mut self) -> &mut [T]
Returns a mutable slice containing the entire array. Equivalent to\n&mut s[..].
\n1.77.0 · sourcepub fn each_ref(&self) -> [&T; N]
Borrows each element and returns an array of references with the same\nsize as self.
\n§Example
\nlet floats = [3.1, 2.7, -1.0];\nlet float_refs: [&f64; 3] = floats.each_ref();\nassert_eq!(float_refs, [&3.1, &2.7, &-1.0]);
\nThis method is particularly useful if combined with other methods, like\nmap. This way, you can avoid moving the original\narray if its elements are not Copy.
\n\nlet strings = [\"Ferris\".to_string(), \"♥\".to_string(), \"Rust\".to_string()];\nlet is_ascii = strings.each_ref().map(|s| s.is_ascii());\nassert_eq!(is_ascii, [true, false, true]);\n\n// We can still access the original array: it has not been moved.\nassert_eq!(strings.len(), 3);
\n1.77.0 · sourcepub fn each_mut(&mut self) -> [&mut T; N]
Borrows each element mutably and returns an array of mutable references\nwith the same size as self.
\n§Example
\n\nlet mut floats = [3.1, 2.7, -1.0];\nlet float_refs: [&mut f64; 3] = floats.each_mut();\n*float_refs[0] = 0.0;\nassert_eq!(float_refs, [&mut 0.0, &mut 2.7, &mut -1.0]);\nassert_eq!(floats, [0.0, 2.7, -1.0]);
\nsourcepub fn split_array_ref<const M: usize>(&self) -> (&[T; M], &[T])
🔬This is a nightly-only experimental API. (split_array)
Divides one array reference into two at an index.
\nThe first will contain all indices from [0, M) (excluding\nthe index M itself) and the second will contain all\nindices from [M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet v = [1, 2, 3, 4, 5, 6];\n\n{\n let (left, right) = v.split_array_ref::<0>();\n assert_eq!(left, &[]);\n assert_eq!(right, &[1, 2, 3, 4, 5, 6]);\n}\n\n{\n let (left, right) = v.split_array_ref::<2>();\n assert_eq!(left, &[1, 2]);\n assert_eq!(right, &[3, 4, 5, 6]);\n}\n\n{\n let (left, right) = v.split_array_ref::<6>();\n assert_eq!(left, &[1, 2, 3, 4, 5, 6]);\n assert_eq!(right, &[]);\n}
\nsourcepub fn split_array_mut<const M: usize>(&mut self) -> (&mut [T; M], &mut [T])
🔬This is a nightly-only experimental API. (split_array)
Divides one mutable array reference into two at an index.
\nThe first will contain all indices from [0, M) (excluding\nthe index M itself) and the second will contain all\nindices from [M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet mut v = [1, 0, 3, 0, 5, 6];\nlet (left, right) = v.split_array_mut::<2>();\nassert_eq!(left, &mut [1, 0][..]);\nassert_eq!(right, &mut [3, 0, 5, 6]);\nleft[1] = 2;\nright[1] = 4;\nassert_eq!(v, [1, 2, 3, 4, 5, 6]);
\nsourcepub fn rsplit_array_ref<const M: usize>(&self) -> (&[T], &[T; M])
🔬This is a nightly-only experimental API. (split_array)
Divides one array reference into two at an index from the end.
\nThe first will contain all indices from [0, N - M) (excluding\nthe index N - M itself) and the second will contain all\nindices from [N - M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet v = [1, 2, 3, 4, 5, 6];\n\n{\n let (left, right) = v.rsplit_array_ref::<0>();\n assert_eq!(left, &[1, 2, 3, 4, 5, 6]);\n assert_eq!(right, &[]);\n}\n\n{\n let (left, right) = v.rsplit_array_ref::<2>();\n assert_eq!(left, &[1, 2, 3, 4]);\n assert_eq!(right, &[5, 6]);\n}\n\n{\n let (left, right) = v.rsplit_array_ref::<6>();\n assert_eq!(left, &[]);\n assert_eq!(right, &[1, 2, 3, 4, 5, 6]);\n}
\nsourcepub fn rsplit_array_mut<const M: usize>(&mut self) -> (&mut [T], &mut [T; M])
🔬This is a nightly-only experimental API. (split_array)
Divides one mutable array reference into two at an index from the end.
\nThe first will contain all indices from [0, N - M) (excluding\nthe index N - M itself) and the second will contain all\nindices from [N - M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet mut v = [1, 0, 3, 0, 5, 6];\nlet (left, right) = v.rsplit_array_mut::<4>();\nassert_eq!(left, &mut [1, 0]);\nassert_eq!(right, &mut [3, 0, 5, 6][..]);\nleft[1] = 2;\nright[1] = 4;\nassert_eq!(v, [1, 2, 3, 4, 5, 6]);
\n",0,"iroh_docs::sync::PeerIdBytes"],["source§impl<const N: usize> [u8; N]
sourcepub const fn as_ascii(&self) -> Option<&[AsciiChar; N]>
🔬This is a nightly-only experimental API. (ascii_char)
Converts this array of bytes into a array of ASCII characters,\nor returns None if any of the characters is non-ASCII.
\n§Examples
\n#![feature(ascii_char)]\n#![feature(const_option)]\n\nconst HEX_DIGITS: [std::ascii::Char; 16] =\n *b\"0123456789abcdef\".as_ascii().unwrap();\n\nassert_eq!(HEX_DIGITS[1].as_str(), \"1\");\nassert_eq!(HEX_DIGITS[10].as_str(), \"a\");
\nsourcepub const unsafe fn as_ascii_unchecked(&self) -> &[AsciiChar; N]
🔬This is a nightly-only experimental API. (ascii_char)
Converts this array of bytes into a array of ASCII characters,\nwithout checking whether they’re valid.
\n§Safety
\nEvery byte in the array must be in 0..=127, or else this is UB.
\n",0,"iroh_docs::sync::PeerIdBytes"],["§impl<T> Array for [T; 32]where\n T: Default,
§fn as_slice_mut(&mut self) -> &mut [T]
Gives a unique slice over the whole thing. Read more","Array","iroh_docs::sync::PeerIdBytes"],["","Array","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> AsBytes for [T; N]where\n T: AsBytes,
§fn write_to_prefix(&self, bytes: &mut [u8]) -> Option<()>
","AsBytes","iroh_docs::sync::PeerIdBytes"],["","AsBytes","iroh_docs::sync::PeerIdBytes"],["","AsMut<[T]>","iroh_docs::sync::PeerIdBytes"],["","AsRef<[T]>","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> BitView for [T; N]where\n T: BitStore,
Note that overly-large arrays may cause the conversions to fail.
\n§fn view_bits<O>(&self) -> &BitSlice<T, O>where\n O: BitOrder,
Views a memory region as an immutable bit-slice.§fn try_view_bits<O>(&self) -> Result<&BitSlice<T, O>, BitSpanError<T>>where\n O: BitOrder,
Attempts to view a memory region as an immutable bit-slice. Read more§fn view_bits_mut<O>(&mut self) -> &mut BitSlice<T, O>where\n O: BitOrder,
Views a memory region as a mutable bit-slice.§fn try_view_bits_mut<O>(\n &mut self\n) -> Result<&mut BitSlice<T, O>, BitSpanError<T>>where\n O: BitOrder,
Attempts to view a memory region as a mutable bit-slice. Read more","BitView","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> BitViewSized for [T; N]where\n T: BitStore,
§fn as_raw_slice(&self) -> &[<[T; N] as BitView>::Store]
Views the type as a slice of its elements.§fn as_raw_mut_slice(&mut self) -> &mut [<[T; N] as BitView>::Store]
Views the type as a mutable slice of its elements.§fn into_bitarray<O>(self) -> BitArray<Self, O>where\n O: BitOrder,
Wraps self in a BitArray.","BitViewSized","iroh_docs::sync::PeerIdBytes"],["","Borrow<[T]>","iroh_docs::sync::PeerIdBytes"],["1.4.0 · source§impl<T, const N: usize> BorrowMut<[T]> for [T; N]
source§fn borrow_mut(&mut self) -> &mut [T]
Mutably borrows from an owned value. Read more","BorrowMut<[T]>","iroh_docs::sync::PeerIdBytes"],["","Chain","iroh_docs::sync::PeerIdBytes"],["","Clone","iroh_docs::sync::PeerIdBytes"],["","Debug","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize> Decode for [u8; N]
Decodes a byte array from byte[n] as described in RFC4251 § 5:
\n\nA byte represents an arbitrary 8-bit value (octet). Fixed length\ndata is sometimes represented as an array of bytes, written\nbyte[n], where n is the number of bytes in the array.
\n
\n","Decode","iroh_docs::sync::PeerIdBytes"],["§impl<'a, T, const N: usize> DecodeValue<'a> for [T; N]where\n T: Decode<'a>,
§fn decode_value<R>(reader: &mut R, header: Header) -> Result<[T; N], Error>where\n R: Reader<'a>,
Attempt to decode this message using the provided [Reader].","DecodeValue<'a>","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["source§impl<'de, T> Deserialize<'de> for [T; 32]where\n T: Deserialize<'de>,
source§fn deserialize<D>(\n deserializer: D\n) -> Result<[T; 32], <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more","Deserialize<'de>","iroh_docs::sync::PeerIdBytes"],["source§impl<'de, const N: usize> Deserialize<'de> for [u8; N]
source§fn deserialize<D>(\n deserializer: D\n) -> Result<[u8; N], <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
","Deserialize<'de>","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize> Encode for [u8; N]
Encodes [u8; N] into byte[n] as described in RFC4251 § 5:
\n\nA byte represents an arbitrary 8-bit value (octet). Fixed length\ndata is sometimes represented as an array of bytes, written\nbyte[n], where n is the number of bytes in the array.
\n
\n§fn encoded_len(&self) -> Result<usize, Error>
Get the length of this type encoded in bytes, prior to Base64 encoding.§fn encode(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value using the provided [Writer].§fn encoded_len_prefixed(&self) -> Result<usize, Error>
Return the length of this type after encoding when prepended with a\nuint32 length prefix.§fn encode_prefixed(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value, first prepending a uint32 length prefix\nset to [Encode::encoded_len].","Encode","iroh_docs::sync::PeerIdBytes"],["","EncodeLabelSet","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> EncodeValue for [T; N]where\n T: Encode,
","EncodeValue","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["§impl<'a> FindToken<&'a u8> for [u8; 32]
§fn find_token(&self, token: &u8) -> bool
Returns true if self contains the token","FindToken<&'a u8>","iroh_docs::sync::PeerIdBytes"],["§impl FindToken<u8> for [u8; 32]
§fn find_token(&self, token: u8) -> bool
Returns true if self contains the token","FindToken","iroh_docs::sync::PeerIdBytes"],["","FixedTag","iroh_docs::sync::PeerIdBytes"],["","From<&Signature>","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["§impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>>> for [T; 32]
","From, B0>, B0>, B0>, B0>, B0>>>","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["","From>","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["source§impl From<NamespaceId> for [u8; 32]
source§fn from(value: NamespaceId) -> Self
Converts to this type from the input type.","From","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["","From>","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> FromBytes for [T; N]where\n T: FromBytes,
§fn slice_from_prefix(bytes: &[u8], count: usize) -> Option<(&[Self], &[u8])>where\n Self: Sized,
Interprets the prefix of the given bytes as a &[Self] with length\nequal to count without copying. Read more§fn slice_from_suffix(bytes: &[u8], count: usize) -> Option<(&[u8], &[Self])>where\n Self: Sized,
Interprets the suffix of the given bytes as a &[Self] with length\nequal to count without copying. Read more§fn read_from_prefix(bytes: &[u8]) -> Option<Self>where\n Self: Sized,
","FromBytes","iroh_docs::sync::PeerIdBytes"],["","FromHex","iroh_docs::sync::PeerIdBytes"],["","FromZeroes","iroh_docs::sync::PeerIdBytes"],["","Hash","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Hash for [T; N]where\n T: Hash,
The hash of an array is the same as that of the corresponding slice,\nas required by the Borrow implementation.
\n\nuse std::hash::BuildHasher;\n\nlet b = std::hash::RandomState::new();\nlet a: [u8; 3] = [0xa8, 0x3c, 0x09];\nlet s: &[u8] = &[0xa8, 0x3c, 0x09];\nassert_eq!(b.hash_one(a), b.hash_one(s));
\n","Hash","iroh_docs::sync::PeerIdBytes"],["","Index","iroh_docs::sync::PeerIdBytes"],["","IndexMut","iroh_docs::sync::PeerIdBytes"],["","InputLength","iroh_docs::sync::PeerIdBytes"],["1.53.0 · source§impl<T, const N: usize> IntoIterator for [T; N]
source§fn into_iter(self) -> <[T; N] as IntoIterator>::IntoIter
Creates a consuming iterator, that is, one that moves each value out of\nthe array (from start to end). The array cannot be used after calling\nthis unless T implements Copy, so the whole array is copied.
\nArrays have special behavior when calling .into_iter() prior to the\n2021 edition – see the array Editions section for more information.
\n","IntoIterator","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize> IntoResponse for [u8; N]
§fn into_response(self) -> Response<Body>
Create a response.","IntoResponse","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, const N: usize> Join for [Fut; N]where\n Fut: IntoFuture,
§type Output = [<Fut as IntoFuture>::Output; N]
The resulting output type.§type Future = Join<<Fut as IntoFuture>::IntoFuture, N>
The Future implementation returned by this method.","Join","iroh_docs::sync::PeerIdBytes"],["","Key","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> MaxSize for [T; N]where\n T: MaxSize,
§const POSTCARD_MAX_SIZE: usize = _
The maximum possible size that the serialization of this\ntype can have, in bytes.","MaxSize","iroh_docs::sync::PeerIdBytes"],["","Merge","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Ord for [T; N]where\n T: Ord,
Implements comparison of arrays lexicographically.
\n1.21.0 · source§fn max(self, other: Self) -> Selfwhere\n Self: Sized,
Compares and returns the maximum of two values. Read more","Ord","iroh_docs::sync::PeerIdBytes"],["","PartialEq<&[U]>","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, U, const N: usize> PartialEq<&mut [U]> for [T; N]where\n T: PartialEq<U>,
","PartialEq<&mut [U]>","iroh_docs::sync::PeerIdBytes"],["","PartialEq<[U]>","iroh_docs::sync::PeerIdBytes"],["","PartialEq<[U; N]>","iroh_docs::sync::PeerIdBytes"],["","PartialEq","iroh_docs::sync::PeerIdBytes"],["§impl<A, B, const N: usize, const M: usize> PartialEq<Vec<A, N>> for [B; M]where\n A: PartialEq<B>,
","PartialEq>","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> PartialOrd for [T; N]where\n T: PartialOrd,
Implements comparison of arrays lexicographically.
\nsource§fn le(&self, other: &[T; N]) -> bool
This method tests less than or equal to (for self and other) and is used by the <=\noperator. Read more","PartialOrd","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, const N: usize> Race for [Fut; N]where\n Fut: IntoFuture,
§type Output = <Fut as IntoFuture>::Output
The resulting output type.§type Future = Race<<Fut as IntoFuture>::IntoFuture, N>
Which kind of future are we turning this into?","Race","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, T, E, const N: usize> RaceOk for [Fut; N]where\n Fut: IntoFuture<Output = Result<T, E>>,
§type Future = RaceOk<<Fut as IntoFuture>::IntoFuture, T, E, N>
Which kind of future are we turning this into?","RaceOk","iroh_docs::sync::PeerIdBytes"],["","Schema","iroh_docs::sync::PeerIdBytes"],["source§impl<T> Serialize for [T; 32]where\n T: 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","iroh_docs::sync::PeerIdBytes"],["source§impl<const N: usize> Serialize for [u8; N]
source§fn serialize<S>(\n &self,\n serializer: S\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where\n S: Serializer,
","Serialize","iroh_docs::sync::PeerIdBytes"],["1.51.0 · source§impl<T, const N: usize> SlicePattern for [T; N]
","SlicePattern","iroh_docs::sync::PeerIdBytes"],["1.34.0 · source§impl<T, const N: usize> TryFrom<&[T]> for [T; N]where\n T: Copy,
Tries to create an array [T; N] by copying from a slice &[T]. Succeeds if\nslice.len() == N.
\n\nlet bytes: [u8; 3] = [1, 0, 2];\n\nlet bytes_head: [u8; 2] = <[u8; 2]>::try_from(&bytes[0..2]).unwrap();\nassert_eq!(1, u16::from_le_bytes(bytes_head));\n\nlet bytes_tail: [u8; 2] = bytes[1..3].try_into().unwrap();\nassert_eq!(512, u16::from_le_bytes(bytes_tail));
\n§type Error = TryFromSliceError
The type returned in the event of a conversion error.","TryFrom<&[T]>","iroh_docs::sync::PeerIdBytes"],["1.59.0 · source§impl<T, const N: usize> TryFrom<&mut [T]> for [T; N]where\n T: Copy,
Tries to create an array [T; N] by copying from a mutable slice &mut [T].\nSucceeds if slice.len() == N.
\n\nlet mut bytes: [u8; 3] = [1, 0, 2];\n\nlet bytes_head: [u8; 2] = <[u8; 2]>::try_from(&mut bytes[0..2]).unwrap();\nassert_eq!(1, u16::from_le_bytes(bytes_head));\n\nlet bytes_tail: [u8; 2] = (&mut bytes[1..3]).try_into().unwrap();\nassert_eq!(512, u16::from_le_bytes(bytes_tail));
\n§type Error = TryFromSliceError
The type returned in the event of a conversion error.","TryFrom<&mut [T]>","iroh_docs::sync::PeerIdBytes"],["§impl<T, A, const N: usize> TryFrom<Vec<T, A>> for [T; N]where\n A: Allocator,
§fn try_from(vec: Vec<T, A>) -> Result<[T; N], Vec<T, A>>
Gets the entire contents of the Vec<T> as an array,\nif its size exactly matches that of the requested array.
\n§Examples
\nassert_eq!(vec![1, 2, 3].try_into(), Ok([1, 2, 3]));\nassert_eq!(<Vec<i32>>::new().try_into(), Ok([]));
\nIf the length doesn’t match, the input comes back in Err:
\n\nlet r: Result<[i32; 4], _> = (0..10).collect::<Vec<_>>().try_into();\nassert_eq!(r, Err(vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9]));
\nIf you’re fine with just getting a prefix of the Vec<T>,\nyou can call .truncate(N) first.
\n\nlet mut v = String::from(\"hello world\").into_bytes();\nv.sort();\nv.truncate(2);\nlet [a, b]: [_; 2] = v.try_into().unwrap();\nassert_eq!(a, b' ');\nassert_eq!(b, b'd');
\n","TryFrom>","iroh_docs::sync::PeerIdBytes"],["1.48.0 · source§impl<T, A, const N: usize> TryFrom<Vec<T, A>> for [T; N]where\n A: Allocator,
source§fn try_from(vec: Vec<T, A>) -> Result<[T; N], Vec<T, A>>
Gets the entire contents of the Vec<T> as an array,\nif its size exactly matches that of the requested array.
\n§Examples
\nassert_eq!(vec![1, 2, 3].try_into(), Ok([1, 2, 3]));\nassert_eq!(<Vec<i32>>::new().try_into(), Ok([]));
\nIf the length doesn’t match, the input comes back in Err:
\n\nlet r: Result<[i32; 4], _> = (0..10).collect::<Vec<_>>().try_into();\nassert_eq!(r, Err(vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9]));
\nIf you’re fine with just getting a prefix of the Vec<T>,\nyou can call .truncate(N) first.
\n\nlet mut v = String::from(\"hello world\").into_bytes();\nv.sort();\nv.truncate(2);\nlet [a, b]: [_; 2] = v.try_into().unwrap();\nassert_eq!(a, b' ');\nassert_eq!(b, b'd');
\n","TryFrom>","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, T, E, const N: usize> TryJoin for [Fut; N]where\n Fut: IntoFuture<Output = Result<T, E>>,
§type Future = TryJoin<<Fut as IntoFuture>::IntoFuture, T, E, N>
Which kind of future are we turning this into?","TryJoin","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> Value for [T; N]where\n T: Value,
§type SelfType<'a> = [<T as Value>::SelfType<'a>; N]\nwhere\n [T; N]: 'a
SelfType<’a> must be the same type as Self with all lifetimes replaced with ’a§type AsBytes<'a> = Vec<u8>\nwhere\n [T; N]: 'a
§fn fixed_width() -> Option<usize>
Width of a fixed type, or None for variable width§fn from_bytes<'a>(data: &'a [u8]) -> [<T as Value>::SelfType<'a>; N]where\n [T; N]: 'a,
Deserializes data\nImplementations may return a view over data, or an owned type","Value","iroh_docs::sync::PeerIdBytes"],["","ValueOrd","iroh_docs::sync::PeerIdBytes"],["§impl<Z, const N: usize> Zeroize for [Z; N]where\n Z: Zeroize,
Impl [Zeroize] on arrays of types that impl [Zeroize].
\n","Zeroize","iroh_docs::sync::PeerIdBytes"],["","Zip","iroh_docs::sync::PeerIdBytes"],["source§impl<T, const N: usize> ConstParamTy for [T; N]where\n T: ConstParamTy,
","ConstParamTy","iroh_docs::sync::PeerIdBytes"],["1.58.0 · source§impl<T, const N: usize> Copy for [T; N]where\n T: Copy,
","Copy","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Eq for [T; N]where\n T: Eq,
","Eq","iroh_docs::sync::PeerIdBytes"],["source§impl<T, const N: usize> StructuralPartialEq for [T; N]
","StructuralPartialEq","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> Unaligned for [T; N]where\n T: Unaligned,
","Unaligned","iroh_docs::sync::PeerIdBytes"],["§impl<Z, const N: usize> ZeroizeOnDrop for [Z; N]where\n Z: ZeroizeOnDrop,
Impl [ZeroizeOnDrop] on arrays of types that impl [ZeroizeOnDrop].
\n","ZeroizeOnDrop","iroh_docs::sync::PeerIdBytes"]]
};if (window.register_type_impls) {window.register_type_impls(type_impls);} else {window.pending_type_impls = type_impls;}})()
\ No newline at end of file
impl<T> Any for Twhere
diff --git a/pr/2595/docs/iroh_blobs/get/db/enum.DownloadProgress.html b/pr/2595/docs/iroh_blobs/get/db/enum.DownloadProgress.html
index 048ea4b8ea..053c531570 100644
--- a/pr/2595/docs/iroh_blobs/get/db/enum.DownloadProgress.html
+++ b/pr/2595/docs/iroh_blobs/get/db/enum.DownloadProgress.html
@@ -25,7 +25,7 @@
id: u64,
},
AllDone(Stats),
- Abort(RpcError),
+ Abort(RpcError),
}Expand description
Progress updates for the get operation.
Variants§
§InitialState(TransferState)
Initial state if subscribing to a running or queued transfer.
§FoundLocal
Data was found locally.
@@ -51,7 +51,7 @@ allows to identify the children by their offset in the hashseq.
§AllDone(Stats)
All operations finished.
This will be the last message in the stream.
-§Abort(RpcError)
We got an error and need to abort.
+§Abort(RpcError)
We got an error and need to abort.
This will be the last message in the stream.
Trait Implementations§
source§impl Clone for DownloadProgress
source§fn clone(&self) -> DownloadProgress
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moresource§impl Debug for DownloadProgress
source§impl<'de> Deserialize<'de> for DownloadProgress
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl Serialize for DownloadProgress
source§fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where
diff --git a/pr/2595/docs/iroh_blobs/provider/enum.AddProgress.html b/pr/2595/docs/iroh_blobs/provider/enum.AddProgress.html
index f66b9300f3..c70929bdee 100644
--- a/pr/2595/docs/iroh_blobs/provider/enum.AddProgress.html
+++ b/pr/2595/docs/iroh_blobs/provider/enum.AddProgress.html
@@ -17,7 +17,7 @@
format: BlobFormat,
tag: Tag,
},
- Abort(RpcError),
+ Abort(RpcError),
}Expand description
Progress updates for the add operation.
Variants§
§Found
An item was found with name name, from now on referred to via id
Fields
§Abort(RpcError)
We got an error and need to abort.
This will be the last message in the stream.
Trait Implementations§
source§impl Debug for AddProgress
source§impl<'de> Deserialize<'de> for AddProgress
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl Serialize for AddProgress
source§fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where
diff --git a/pr/2595/docs/iroh_blobs/store/enum.ConsistencyCheckProgress.html b/pr/2595/docs/iroh_blobs/store/enum.ConsistencyCheckProgress.html
index ad14d9476a..46469fe5e2 100644
--- a/pr/2595/docs/iroh_blobs/store/enum.ConsistencyCheckProgress.html
+++ b/pr/2595/docs/iroh_blobs/store/enum.ConsistencyCheckProgress.html
@@ -6,7 +6,7 @@
level: ReportLevel,
},
Done,
- Abort(RpcError),
+ Abort(RpcError),
}Expand description
Progress updates for the validate operation
Variants§
§level: ReportLevelThe level of the message
§Done
Consistency check ended
-§Abort(RpcError)
We got an error and need to abort.
+§Abort(RpcError)
We got an error and need to abort.
Trait Implementations§
source§impl Debug for ConsistencyCheckProgress
source§impl<'de> Deserialize<'de> for ConsistencyCheckProgress
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreAuto Trait Implementations§
§impl Freeze for ConsistencyCheckProgress
§impl RefUnwindSafe for ConsistencyCheckProgress
§impl Send for ConsistencyCheckProgress
§impl Sync for ConsistencyCheckProgress
§impl Unpin for ConsistencyCheckProgress
§impl UnwindSafe for ConsistencyCheckProgress
Blanket Implementations§
source§impl<T> Any for Twhere
diff --git a/pr/2595/docs/iroh_blobs/store/enum.ValidateProgress.html b/pr/2595/docs/iroh_blobs/store/enum.ValidateProgress.html
index 76a8f01e97..f4494f3a46 100644
--- a/pr/2595/docs/iroh_blobs/store/enum.ValidateProgress.html
+++ b/pr/2595/docs/iroh_blobs/store/enum.ValidateProgress.html
@@ -31,7 +31,7 @@
ranges: RangeSpec,
},
AllDone,
- Abort(RpcError),
+ Abort(RpcError),
}Expand description
Progress updates for the validate operation
Variants§
§Starting
started validating
Fields
§total: u64The total number of entries to validate
@@ -62,7 +62,7 @@ Otherwise it might be an url or something else to uniquely identify the entry.
§AllDone
We are done with the whole operation.
-§Abort(RpcError)
We got an error and need to abort.
+§Abort(RpcError)
We got an error and need to abort.
Trait Implementations§
source§impl Debug for ValidateProgress
source§impl<'de> Deserialize<'de> for ValidateProgress
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreAuto Trait Implementations§
§impl Freeze for ValidateProgress
§impl RefUnwindSafe for ValidateProgress
§impl Send for ValidateProgress
§impl Sync for ValidateProgress
§impl Unpin for ValidateProgress
§impl UnwindSafe for ValidateProgress
Blanket Implementations§
source§impl<T> Any for Twhere
diff --git a/pr/2595/docs/iroh_blobs/struct.Hash.html b/pr/2595/docs/iroh_blobs/struct.Hash.html
index 260e50d4b9..ba12d52876 100644
--- a/pr/2595/docs/iroh_blobs/struct.Hash.html
+++ b/pr/2595/docs/iroh_blobs/struct.Hash.html
@@ -1,36 +1,36 @@
-Hash in iroh_blobs - Rust Struct iroh_blobs::Hash
pub struct Hash(/* private fields */);
Expand description
Hash type used throughout.
-Implementations§
§impl Hash
pub const fn from_bytes(bytes: [u8; 32]) -> Hash
Create a Hash from its raw bytes representation.
-pub fn fmt_short(&self) -> String
Convert to a base32 string limited to the first 10 bytes for a friendly string
+
Hash in iroh_blobs - Rust Struct iroh_blobs::Hash
source · pub struct Hash(/* private fields */);
Expand description
Hash type used throughout.
+Implementations§
Trait Implementations§
Trait Implementations§
source§impl<'de> Deserialize<'de> for Hash
source§fn deserialize<D>(
deserializer: D
) -> Result<Hash, <D as Deserializer<'de>>::Error>where
- D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl FromIterator<Hash> for HashSeq
§impl Hash for Hash
§fn hash<__H>(&self, state: &mut __H)where
+ D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl FromIterator<Hash> for HashSeq
§impl MaxSize for Hash
§const POSTCARD_MAX_SIZE: usize = 32usize
The maximum possible size that the serialization of this
-type can have, in bytes.source§impl MaxSize for Hash
source§const POSTCARD_MAX_SIZE: usize = 32usize
The maximum possible size that the serialization of this
+type can have, in bytes.source§impl Ord for Hash
source§impl PartialEq for Hash
§impl PartialOrd for Hash
source§impl PartialOrd for Hash
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 <=
operator. Read moresource§impl Serialize for Hash
source§fn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
- S: Serializer,
Serialize this value into the given Serde serializer. Read more§impl Value for Hash
§type SelfType<'a> = Hash
SelfType<’a> must be the same type as Self with all lifetimes replaced with ’a§type AsBytes<'a> = &'a [u8; 32]
§fn fixed_width() -> Option<usize>
Width of a fixed type, or None for variable width§fn from_bytes<'a>(data: &'a [u8]) -> <Hash as Value>::SelfType<'a>where
+ S: Serializer,
Serialize this value into the given Serde serializer. Read moresource§impl Value for Hash
§type SelfType<'a> = Hash
SelfType<’a> must be the same type as Self with all lifetimes replaced with ’a§type AsBytes<'a> = &'a [u8; 32]
source§fn fixed_width() -> Option<usize>
Width of a fixed type, or None for variable width§impl Copy for Hash
§impl Eq for Hash
§impl StructuralPartialEq for Hash
Auto Trait Implementations§
§impl Freeze for Hash
§impl RefUnwindSafe for Hash
§impl Send for Hash
§impl Sync for Hash
§impl Unpin for Hash
§impl UnwindSafe for Hash
Blanket Implementations§
source§impl Copy for Hash
source§impl Eq for Hash
source§impl StructuralPartialEq for Hash
Auto Trait Implementations§
§impl Freeze for Hash
§impl RefUnwindSafe for Hash
§impl Send for Hash
§impl Sync for Hash
§impl Unpin for Hash
§impl UnwindSafe for Hash
Blanket Implementations§
§impl<A, T> AsBits<T> for A
§fn as_bits<O>(&self) -> &BitSlice<T, O>where
diff --git a/pr/2595/docs/iroh_blobs/struct.HashAndFormat.html b/pr/2595/docs/iroh_blobs/struct.HashAndFormat.html
index 8eb7ba64d5..421c7e1439 100644
--- a/pr/2595/docs/iroh_blobs/struct.HashAndFormat.html
+++ b/pr/2595/docs/iroh_blobs/struct.HashAndFormat.html
@@ -1,37 +1,37 @@
-HashAndFormat in iroh_blobs - Rust Struct iroh_blobs::HashAndFormat
pub struct HashAndFormat {
+HashAndFormat in iroh_blobs - Rust Struct iroh_blobs::HashAndFormat
source · pub struct HashAndFormat {
pub hash: Hash,
pub format: BlobFormat,
}
Expand description
A hash and format pair
Fields§
§hash: HashThe hash
§format: BlobFormatThe format
-Implementations§
§impl HashAndFormat
pub fn new(hash: Hash, format: BlobFormat) -> HashAndFormat
Create a new hash and format pair.
-pub fn raw(hash: Hash) -> HashAndFormat
Create a new hash and format pair, using the default (raw) format.
-pub fn hash_seq(hash: Hash) -> HashAndFormat
Create a new hash and format pair, using the collection format.
-Trait Implementations§
§impl Clone for HashAndFormat
§fn clone(&self) -> HashAndFormat
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more§impl Debug for HashAndFormat
§impl<'de> Deserialize<'de> for HashAndFormat
§fn deserialize<D>(
+
Implementations§
source§impl HashAndFormat
sourcepub fn new(hash: Hash, format: BlobFormat) -> HashAndFormat
Create a new hash and format pair.
+sourcepub fn raw(hash: Hash) -> HashAndFormat
Create a new hash and format pair, using the default (raw) format.
+sourcepub fn hash_seq(hash: Hash) -> HashAndFormat
Create a new hash and format pair, using the collection format.
+Trait Implementations§
source§impl Clone for HashAndFormat
source§fn clone(&self) -> HashAndFormat
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moresource§impl Debug for HashAndFormat
source§impl<'de> Deserialize<'de> for HashAndFormat
source§fn deserialize<D>(
deserializer: D
) -> Result<HashAndFormat, <D as Deserializer<'de>>::Error>where
- D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more§impl Display for HashAndFormat
source§impl From<DownloadKind> for HashAndFormat
source§fn from(value: DownloadKind) -> Self
Converts to this type from the input type.source§impl From<HashAndFormat> for DownloadKind
source§fn from(value: HashAndFormat) -> Self
Converts to this type from the input type.§impl FromStr for HashAndFormat
§impl Hash for HashAndFormat
§fn hash<__H>(&self, state: &mut __H)where
+ D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl Display for HashAndFormat
source§impl From<DownloadKind> for HashAndFormat
source§fn from(value: DownloadKind) -> Self
Converts to this type from the input type.source§impl From<HashAndFormat> for DownloadKind
source§fn from(value: HashAndFormat) -> Self
Converts to this type from the input type.source§impl FromStr for HashAndFormat
source§impl Hash for HashAndFormat
§impl MaxSize for HashAndFormat
§const POSTCARD_MAX_SIZE: usize = 33usize
The maximum possible size that the serialization of this
-type can have, in bytes.§impl Ord for HashAndFormat
source§impl MaxSize for HashAndFormat
source§const POSTCARD_MAX_SIZE: usize = 33usize
The maximum possible size that the serialization of this
+type can have, in bytes.source§impl Ord for HashAndFormat
source§fn cmp(&self, other: &HashAndFormat) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more§impl PartialEq for HashAndFormat
§fn eq(&self, other: &HashAndFormat) -> bool
Restrict a value to a certain interval. Read moresource§impl PartialEq for HashAndFormat
source§fn eq(&self, other: &HashAndFormat) -> bool
This method tests for self and other values to be equal, and is used
by ==.§impl PartialOrd for HashAndFormat
§fn partial_cmp(&self, other: &HashAndFormat) -> Option<Ordering>
source§impl PartialOrd for HashAndFormat
source§fn partial_cmp(&self, other: &HashAndFormat) -> Option<Ordering>
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 <=
operator. Read moresource§impl Serialize for HashAndFormat
source§fn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
- S: Serializer,
Serialize this value into the given Serde serializer. Read more§impl Value for HashAndFormat
§type SelfType<'a> = HashAndFormat
SelfType<’a> must be the same type as Self with all lifetimes replaced with ’a§type AsBytes<'a> = [u8; 33]
§fn fixed_width() -> Option<usize>
Width of a fixed type, or None for variable width§fn from_bytes<'a>(data: &'a [u8]) -> <HashAndFormat as Value>::SelfType<'a>where
+ S: Serializer,
Serialize this value into the given Serde serializer. Read moresource§impl Value for HashAndFormat
§type SelfType<'a> = HashAndFormat
SelfType<’a> must be the same type as Self with all lifetimes replaced with ’a§type AsBytes<'a> = [u8; 33]
source§fn fixed_width() -> Option<usize>
Width of a fixed type, or None for variable widthsource§fn from_bytes<'a>(data: &'a [u8]) -> <HashAndFormat as Value>::SelfType<'a>where
HashAndFormat: 'a,
Deserializes data
-Implementations may return a view over data, or an owned typesource§fn as_bytes<'a, 'b>(
value: &'a <HashAndFormat as Value>::SelfType<'b>
) -> <HashAndFormat as Value>::AsBytes<'a>where
'b: 'a,
- HashAndFormat: 'a + 'b,
Serialize the value to a slice§impl Copy for HashAndFormat
§impl Eq for HashAndFormat
§impl StructuralPartialEq for HashAndFormat
Auto Trait Implementations§
§impl Freeze for HashAndFormat
§impl RefUnwindSafe for HashAndFormat
§impl Send for HashAndFormat
§impl Sync for HashAndFormat
§impl Unpin for HashAndFormat
§impl UnwindSafe for HashAndFormat
Blanket Implementations§
source§impl<T> Any for Twhere
+ HashAndFormat: 'a + 'b,
Serialize the value to a slicesource§impl Copy for HashAndFormat
source§impl Eq for HashAndFormat
source§impl StructuralPartialEq for HashAndFormat
Auto Trait Implementations§
§impl Freeze for HashAndFormat
§impl RefUnwindSafe for HashAndFormat
§impl Send for HashAndFormat
§impl Sync for HashAndFormat
§impl Unpin for HashAndFormat
§impl UnwindSafe for HashAndFormat
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
diff --git a/pr/2595/docs/iroh_docs/actor/struct.SyncHandle.html b/pr/2595/docs/iroh_docs/actor/struct.SyncHandle.html
index cfd29c2ce8..6c70a0ff39 100644
--- a/pr/2595/docs/iroh_docs/actor/struct.SyncHandle.html
+++ b/pr/2595/docs/iroh_docs/actor/struct.SyncHandle.html
@@ -26,7 +26,7 @@ waiting for the actor to finish happens in an async context, and therefore that
namespace: NamespaceId,
author: AuthorId,
key: Bytes,
- hash: Hash,
+ hash: Hash,
len: u64
) -> Result<()>sourcepub async fn delete_prefix(
&self,
diff --git a/pr/2595/docs/iroh_docs/engine/enum.LiveEvent.html b/pr/2595/docs/iroh_docs/engine/enum.LiveEvent.html
index ceb8545b50..f0d33bcb21 100644
--- a/pr/2595/docs/iroh_docs/engine/enum.LiveEvent.html
+++ b/pr/2595/docs/iroh_docs/engine/enum.LiveEvent.html
@@ -3,34 +3,34 @@
entry: Entry,
},
InsertRemote {
- from: PublicKey,
+ from: PublicKey,
entry: Entry,
content_status: ContentStatus,
},
ContentReady {
- hash: Hash,
+ hash: Hash,
},
PendingContentReady,
- NeighborUp(PublicKey),
- NeighborDown(PublicKey),
+ NeighborUp(PublicKey),
+ NeighborDown(PublicKey),
SyncFinished(SyncEvent),
}Expand description
Events informing about actions of the live sync progress.
Variants§
§InsertLocal
A local insertion.
§InsertRemote
Received a remote insert.
-Fields
§from: PublicKeyThe peer that sent us the entry.
+Fields
§content_status: ContentStatusIf the content is available at the local node
§ContentReady
The content of an entry was downloaded and is now available at the local node
-Fields
§hash: HashThe content hash of the newly available entry content
+§PendingContentReady
All pending content is now ready.
This event signals that all queued content downloads from the last sync run have either
completed or failed.
It will only be emitted after a Self::SyncFinished event, never before.
Receiving this event does not guarantee that all content in the document is available. If
blobs failed to download, this event will still be emitted after all operations completed.
-§NeighborUp(PublicKey)
We have a new neighbor in the swarm.
-§NeighborDown(PublicKey)
We lost a neighbor in the swarm.
+§NeighborUp(PublicKey)
We have a new neighbor in the swarm.
+§NeighborDown(PublicKey)
We lost a neighbor in the swarm.
§SyncFinished(SyncEvent)
A set-reconciliation sync finished.
Trait Implementations§
source§impl<'de> Deserialize<'de> for LiveEvent
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl PartialEq for LiveEvent
source§fn eq(&self, other: &LiveEvent) -> bool
This method tests for self and other values to be equal, and is used
diff --git a/pr/2595/docs/iroh_docs/engine/fn.entry_to_content_status.html b/pr/2595/docs/iroh_docs/engine/fn.entry_to_content_status.html
index 459a6719d2..3b39df6428 100644
--- a/pr/2595/docs/iroh_docs/engine/fn.entry_to_content_status.html
+++ b/pr/2595/docs/iroh_docs/engine/fn.entry_to_content_status.html
@@ -1,2 +1,2 @@
-entry_to_content_status in iroh_docs::engine - Rust Function iroh_docs::engine::entry_to_content_status
source · pub fn entry_to_content_status(entry: Result<EntryStatus>) -> ContentStatus
Expand description
Converts an [EntryStatus] into a [‘ContentStatus’].
+entry_to_content_status in iroh_docs::engine - Rust Function iroh_docs::engine::entry_to_content_status
source · pub fn entry_to_content_status(entry: Result<EntryStatus>) -> ContentStatus
Expand description
Converts an EntryStatus into a [‘ContentStatus’].
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_docs/engine/index.html b/pr/2595/docs/iroh_docs/engine/index.html
index 5f78e23386..622ab4b871 100644
--- a/pr/2595/docs/iroh_docs/engine/index.html
+++ b/pr/2595/docs/iroh_docs/engine/index.html
@@ -1,4 +1,4 @@
iroh_docs::engine - Rust Expand description
Handlers and actors to for live syncing replicas.
crate::Replica is also called documents here.
Structs§
- Persistent default author for a docs engine.
- The sync engine coordinates actors that manage open documents, set-reconciliation syncs with
-peers and a gossip swarm for each syncing document.
- Event emitted when a sync operation completes
Enums§
- Where to persist the default author.
- Events informing about actions of the live sync progress.
- Why we performed a sync exchange
- Why we started a sync request
Functions§
- Converts an [
EntryStatus] into a [‘ContentStatus’].
\ No newline at end of file
+peers and a gossip swarm for each syncing document.Event emitted when a sync operation completes Enums§
- Where to persist the default author.
- Events informing about actions of the live sync progress.
- Why we performed a sync exchange
- Why we started a sync request
Functions§
- Converts an
EntryStatus into a [‘ContentStatus’].
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_docs/engine/struct.Engine.html b/pr/2595/docs/iroh_docs/engine/struct.Engine.html
index 1b88a96726..46cd25179e 100644
--- a/pr/2595/docs/iroh_docs/engine/struct.Engine.html
+++ b/pr/2595/docs/iroh_docs/engine/struct.Engine.html
@@ -8,12 +8,12 @@ peers and a gossip swarm for each syncing document.
Fields§
§endpoint: EndpointEndpoint used by the engine.
§sync: SyncHandleHandle to the actor thread.
The persistent default author for this engine.
-Implementations§
source§impl Engine
Implementations§
source§impl Engine
sourcepub async fn spawn<B: Store>(
endpoint: Endpoint,
- gossip: Gossip,
+ gossip: Gossip,
replica_store: Store,
bao_store: B,
- downloader: Downloader,
+ downloader: Downloader,
default_author_storage: DefaultAuthorStorage
) -> Result<Self>
Start the sync engine.
This will spawn two tokio tasks for the live sync coordination and gossip actors, and a
@@ -21,7 +21,7 @@ thread for the sourcepub async fn start_sync(
&self,
namespace: NamespaceId,
- peers: Vec<NodeAddr>
+ peers: Vec<NodeAddr>
) -> Result<()>
Start to sync a document.
If peers is non-empty, it will both do an initial set-reconciliation sync with each peer,
and join an iroh-gossip swarm with these peers to receive and broadcast document updates.
diff --git a/pr/2595/docs/iroh_docs/engine/struct.SyncEvent.html b/pr/2595/docs/iroh_docs/engine/struct.SyncEvent.html
index 49ba954022..d7eb730d81 100644
--- a/pr/2595/docs/iroh_docs/engine/struct.SyncEvent.html
+++ b/pr/2595/docs/iroh_docs/engine/struct.SyncEvent.html
@@ -1,11 +1,11 @@
SyncEvent in iroh_docs::engine - Rust pub struct SyncEvent {
- pub peer: PublicKey,
+ pub peer: PublicKey,
pub origin: Origin,
pub finished: SystemTime,
pub started: SystemTime,
pub result: Result<SyncDetails, String>,
}
Expand description
Event emitted when a sync operation completes
-Fields§
§peer: PublicKeyPeer we synced with
+Fields§
§peer: PublicKeyPeer we synced with
§origin: OriginOrigin of the sync exchange
§finished: SystemTimeTimestamp when the sync started
§started: SystemTimeTimestamp when the sync finished
diff --git a/pr/2595/docs/iroh_docs/index.html b/pr/2595/docs/iroh_docs/index.html
index a37d30e2a6..41c792c5e5 100644
--- a/pr/2595/docs/iroh_docs/index.html
+++ b/pr/2595/docs/iroh_docs/index.html
@@ -1,7 +1,7 @@
iroh_docs - Rust Expand description
Multi-dimensional key-value documents with an efficient synchronization protocol
The crate operates on Replicas. A replica contains an unlimited number of
Entries. Each entry is identified by a key, its author, and the replica’s
-namespace. Its value is the 32-byte BLAKE3 hash
+namespace. Its value is the 32-byte BLAKE3 hash
of the entry’s content data, the size of this content data, and a timestamp.
The content data itself is not stored or transferred through a replica.
All entries in a replica are signed with two keypairs:
diff --git a/pr/2595/docs/iroh_docs/net/enum.AcceptError.html b/pr/2595/docs/iroh_docs/net/enum.AcceptError.html
index 87e9a07ad3..cf11b5b695 100644
--- a/pr/2595/docs/iroh_docs/net/enum.AcceptError.html
+++ b/pr/2595/docs/iroh_docs/net/enum.AcceptError.html
@@ -3,31 +3,31 @@
error: Error,
},
Open {
- peer: PublicKey,
+ peer: PublicKey,
error: Error,
},
Abort {
- peer: PublicKey,
+ peer: PublicKey,
namespace: NamespaceId,
reason: AbortReason,
},
Sync {
- peer: PublicKey,
+ peer: PublicKey,
namespace: Option<NamespaceId>,
error: Error,
},
Close {
- peer: PublicKey,
+ peer: PublicKey,
namespace: Option<NamespaceId>,
error: Error,
},
}Expand description
Errors that may occur on handling incoming sync connections.
Variants§
§Connect
Failed to establish connection
§Open
Failed to open replica
-§Abort
We aborted the sync request.
-§Sync
Failed to run sync
-§Close
Failed to close
-Implementations§
source§impl AcceptError
Implementations§
Trait Implementations§
source§impl Debug for AcceptError
source§impl Display for AcceptError
source§impl Error for AcceptError
source§fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more1.0.0 · source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()Auto Trait Implementations§
§impl Freeze for AcceptError
§impl RefUnwindSafe for AcceptError
§impl Send for AcceptError
§impl Sync for AcceptError
§impl Unpin for AcceptError
§impl UnwindSafe for AcceptError
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
diff --git a/pr/2595/docs/iroh_docs/net/fn.connect_and_sync.html b/pr/2595/docs/iroh_docs/net/fn.connect_and_sync.html
index 1ee6909d53..7bec313309 100644
--- a/pr/2595/docs/iroh_docs/net/fn.connect_and_sync.html
+++ b/pr/2595/docs/iroh_docs/net/fn.connect_and_sync.html
@@ -2,6 +2,6 @@
endpoint: &Endpoint,
sync: &SyncHandle,
namespace: NamespaceId,
- peer: NodeAddr
+ peer: NodeAddr
) -> Result<SyncFinished, ConnectError>Expand description
Connect to a peer and sync a replica
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_docs/net/fn.handle_connection.html b/pr/2595/docs/iroh_docs/net/fn.handle_connection.html
index 347a0c22bf..e96816b362 100644
--- a/pr/2595/docs/iroh_docs/net/fn.handle_connection.html
+++ b/pr/2595/docs/iroh_docs/net/fn.handle_connection.html
@@ -3,6 +3,6 @@
connecting: Connecting,
accept_cb: F
) -> Result<SyncFinished, AcceptError>where
- F: Fn(NamespaceId, PublicKey) -> Fut,
+ F: Fn(NamespaceId, PublicKey) -> Fut,
Fut: Future<Output = AcceptOutcome>,Expand description
Handle an iroh-docs connection and sync all shared documents in the replica store.
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_docs/net/struct.SyncFinished.html b/pr/2595/docs/iroh_docs/net/struct.SyncFinished.html
index 74ab2f6632..dcd549e6fc 100644
--- a/pr/2595/docs/iroh_docs/net/struct.SyncFinished.html
+++ b/pr/2595/docs/iroh_docs/net/struct.SyncFinished.html
@@ -1,11 +1,11 @@
SyncFinished in iroh_docs::net - Rust Struct iroh_docs::net::SyncFinished
source · pub struct SyncFinished {
pub namespace: NamespaceId,
- pub peer: PublicKey,
+ pub peer: PublicKey,
pub outcome: SyncOutcome,
pub timings: Timings,
}
Expand description
Details of a finished sync operation.
Fields§
§namespace: NamespaceIdThe namespace that was synced.
-§peer: PublicKeyThe peer we syned with.
+§peer: PublicKeyThe peer we syned with.
§outcome: SyncOutcomeThe outcome of the sync operation
§timings: TimingsThe time this operation took
Trait Implementations§
source§impl Clone for SyncFinished
source§fn clone(&self) -> SyncFinished
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moreAuto Trait Implementations§
§impl Freeze for SyncFinished
§impl RefUnwindSafe for SyncFinished
§impl Send for SyncFinished
§impl Sync for SyncFinished
§impl Unpin for SyncFinished
§impl UnwindSafe for SyncFinished
Blanket Implementations§
source§impl<T> Any for Twhere
diff --git a/pr/2595/docs/iroh_docs/store/fs/struct.ContentHashesIterator.html b/pr/2595/docs/iroh_docs/store/fs/struct.ContentHashesIterator.html
index 8bebf68ec6..df1fc8865f 100644
--- a/pr/2595/docs/iroh_docs/store/fs/struct.ContentHashesIterator.html
+++ b/pr/2595/docs/iroh_docs/store/fs/struct.ContentHashesIterator.html
@@ -6,7 +6,7 @@ It needs a copy of a redb::ReadOnlyTable to be self-contained.
Implementations§
Trait Implementations§
source§impl Debug for ContentHashesIterator
Trait Implementations§
source§impl Debug for ContentHashesIterator
source§impl Iterator for ContentHashesIterator
source§fn next(&mut self) -> Option<Self::Item>
Advances the iterator and returns the next value. Read moresource§fn next_chunk<const N: usize>(
&mut self
) -> Result<[Self::Item; N], IntoIter<Self::Item, N>>where
Self: Sized,
🔬This is a nightly-only experimental API. (iter_next_chunk)Advances the iterator and returns an array containing the next N values. Read more1.0.0 · source§fn size_hint(&self) -> (usize, Option<usize>)
Returns the bounds on the remaining length of the iterator. Read more1.0.0 · source§fn count(self) -> usizewhere
diff --git a/pr/2595/docs/iroh_docs/struct.AuthorId.html b/pr/2595/docs/iroh_docs/struct.AuthorId.html
index 7dfa3dea5b..02221b0eb6 100644
--- a/pr/2595/docs/iroh_docs/struct.AuthorId.html
+++ b/pr/2595/docs/iroh_docs/struct.AuthorId.html
@@ -156,6 +156,6 @@ letters are used (e.g. F9B4CA)
Into<Dispatch>, source§fn with_current_subscriber(self) -> WithDispatch<Self>
source§impl<T> DeserializeOwned for Twhere
- T: for<'de> Deserialize<'de>,
§impl<T> PeerIdentity for Twhere
+ T: for<'de> Deserialize<'de>,
source§impl<T> PeerIdentity for T
source§impl<T> RuleType for T
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_docs/struct.AuthorPublicKey.html b/pr/2595/docs/iroh_docs/struct.AuthorPublicKey.html
index 8e72b11c8a..7a83ce68e4 100644
--- a/pr/2595/docs/iroh_docs/struct.AuthorPublicKey.html
+++ b/pr/2595/docs/iroh_docs/struct.AuthorPublicKey.html
@@ -148,6 +148,6 @@ builds. Into<Dispatch>,source§fn with_current_subscriber(self) -> WithDispatch<Self>
source§impl<T> DeserializeOwned for Twhere
- T: for<'de> Deserialize<'de>,
§impl<T> PeerIdentity for Twhere
+ T: for<'de> Deserialize<'de>,
source§impl<T> PeerIdentity for T
source§impl<T> RuleType for T
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_docs/struct.DocTicket.html b/pr/2595/docs/iroh_docs/struct.DocTicket.html
index d53a93c4c4..fd1bb5eb02 100644
--- a/pr/2595/docs/iroh_docs/struct.DocTicket.html
+++ b/pr/2595/docs/iroh_docs/struct.DocTicket.html
@@ -1,13 +1,13 @@
DocTicket in iroh_docs - Rust pub struct DocTicket {
pub capability: Capability,
- pub nodes: Vec<NodeAddr>,
+ pub nodes: Vec<NodeAddr>,
}
Expand description
Contains both a key (either secret or public) to a document, and a list of peers to join.
Fields§
§capability: Capabilityeither a public or private key
-§nodes: Vec<NodeAddr>A list of nodes to contact.
-Implementations§
source§impl DocTicket
sourcepub fn new(capability: Capability, peers: Vec<NodeAddr>) -> Self
Create a new doc ticket
+§nodes: Vec<NodeAddr>A list of nodes to contact.
+Implementations§
Trait Implementations§
source§impl<'de> Deserialize<'de> for DocTicket
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
- __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreAuto Trait Implementations§
§impl Freeze for DocTicket
§impl RefUnwindSafe for DocTicket
§impl Send for DocTicket
§impl Sync for DocTicket
§impl Unpin for DocTicket
§impl UnwindSafe for DocTicket
Blanket Implementations§
source§impl<T> Any for Twhere
+ __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreAuto Trait Implementations§
§impl Freeze for DocTicket
§impl RefUnwindSafe for DocTicket
§impl Send for DocTicket
§impl Sync for DocTicket
§impl Unpin for DocTicket
§impl UnwindSafe for DocTicket
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
diff --git a/pr/2595/docs/iroh_docs/struct.NamespaceId.html b/pr/2595/docs/iroh_docs/struct.NamespaceId.html
index 433d51afc6..f9acda8e94 100644
--- a/pr/2595/docs/iroh_docs/struct.NamespaceId.html
+++ b/pr/2595/docs/iroh_docs/struct.NamespaceId.html
@@ -156,6 +156,6 @@ letters are used (e.g. F9B4CA)
Into<Dispatch>, source§fn with_current_subscriber(self) -> WithDispatch<Self>
source§impl<T> DeserializeOwned for Twhere
- T: for<'de> Deserialize<'de>,
§impl<T> PeerIdentity for Twhere
+ T: for<'de> Deserialize<'de>,
source§impl<T> PeerIdentity for T
source§impl<T> RuleType for T
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_docs/struct.NamespacePublicKey.html b/pr/2595/docs/iroh_docs/struct.NamespacePublicKey.html
index 350dea9049..72b75ed510 100644
--- a/pr/2595/docs/iroh_docs/struct.NamespacePublicKey.html
+++ b/pr/2595/docs/iroh_docs/struct.NamespacePublicKey.html
@@ -147,6 +147,6 @@ builds.Into<Dispatch>,source§fn with_current_subscriber(self) -> WithDispatch<Self>
source§impl<T> DeserializeOwned for Twhere
- T: for<'de> Deserialize<'de>,
§impl<T> PeerIdentity for Twhere
+ T: for<'de> Deserialize<'de>,
source§impl<T> PeerIdentity for T
source§impl<T> RuleType for T
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_docs/sync/struct.Entry.html b/pr/2595/docs/iroh_docs/sync/struct.Entry.html
index 55bf06044f..055a4b6f54 100644
--- a/pr/2595/docs/iroh_docs/sync/struct.Entry.html
+++ b/pr/2595/docs/iroh_docs/sync/struct.Entry.html
@@ -1,6 +1,6 @@
Entry in iroh_docs::sync - Rust pub struct Entry { /* private fields */ }
Expand description
A single entry in a Replica
An entry is identified by a key, its Author, and the Replica’s
-NamespaceSecret. Its value is the 32-byte BLAKE3 hash
+NamespaceSecret. Its value is the 32-byte BLAKE3 hash
of the entry’s content data, the size of this content data, and a timestamp.
Implementations§
source§impl Entry
sourcepub fn new(id: RecordIdentifier, record: Record) -> Self
Create a new entry
sourcepub fn new_empty(id: RecordIdentifier) -> Self
Create a new empty entry with the current timestamp.
@@ -15,7 +15,7 @@ of the entry’s content data, the size of this content data, and a timestamp.
sourcepub fn sign(self, namespace: &NamespaceSecret, author: &Author) -> SignedEntry
Sign this entry with a NamespaceSecret and Author.
Methods from Deref<Target = Record>§
sourcepub fn content_len(&self) -> u64
Get the length of the data addressed by this record’s content hash.
-sourcepub fn content_hash(&self) -> Hash
Get the [struct@Hash] of the content data of this record.
+sourcepub fn content_hash(&self) -> Hash
Get the Hash of the content data of this record.
Trait Implementations§
source§impl<'de> Deserialize<'de> for Entry
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl From<SignedEntry> for Entry
source§fn from(value: SignedEntry) -> Self
Converts to this type from the input type.source§impl Ord for Entry
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
diff --git a/pr/2595/docs/iroh_docs/sync/struct.Record.html b/pr/2595/docs/iroh_docs/sync/struct.Record.html
index 94479a973e..f06cccab52 100644
--- a/pr/2595/docs/iroh_docs/sync/struct.Record.html
+++ b/pr/2595/docs/iroh_docs/sync/struct.Record.html
@@ -1,11 +1,11 @@
Record in iroh_docs::sync - Rust pub struct Record { /* private fields */ }
Expand description
The data part of an entry in a Replica.
-Implementations§
source§impl Record
Implementations§
source§impl Record
sourcepub fn empty_current() -> Self
Create a tombstone record with the timestamp set to now.
sourcepub fn new_current(hash: Hash, len: u64) -> Self
Create a new Record with the timestamp set to now.
+sourcepub fn new_current(hash: Hash, len: u64) -> Self
Create a new Record with the timestamp set to now.
sourcepub fn content_len(&self) -> u64
Get the length of the data addressed by this record’s content hash.
-sourcepub fn content_hash(&self) -> Hash
Get the [struct@Hash] of the content data of this record.
+sourcepub fn content_hash(&self) -> Hash
Get the Hash of the content data of this record.
Trait Implementations§
source§impl<'de> Deserialize<'de> for Record
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl Ord for Record
Ordering for entry values.
diff --git a/pr/2595/docs/iroh_docs/sync/struct.Replica.html b/pr/2595/docs/iroh_docs/sync/struct.Replica.html
index 23a9798651..c4e161f3c3 100644
--- a/pr/2595/docs/iroh_docs/sync/struct.Replica.html
+++ b/pr/2595/docs/iroh_docs/sync/struct.Replica.html
@@ -5,7 +5,7 @@
&mut self,
key: impl AsRef<[u8]>,
author: &Author,
- hash: Hash,
+ hash: Hash,
len: u64
) -> Result<usize, InsertError>Insert a new record at the given key.
The entry will by signed by the provided author.
@@ -35,7 +35,7 @@ or an error if the entry failed to validate or if a store operation failed.
key: impl AsRef<[u8]>,
author: &Author,
data: impl AsRef<[u8]>
-) -> Result<Hash, InsertError>Hashes the given data and inserts it.
+) -> Result<Hash, InsertError>Hashes the given data and inserts it.
This does not store the content, just the record of it.
Returns the calculated hash.
sourcepub fn record_id(
diff --git a/pr/2595/docs/iroh_docs/sync/struct.SignedEntry.html b/pr/2595/docs/iroh_docs/sync/struct.SignedEntry.html
index 21644eacb1..9ef5e98134 100644
--- a/pr/2595/docs/iroh_docs/sync/struct.SignedEntry.html
+++ b/pr/2595/docs/iroh_docs/sync/struct.SignedEntry.html
@@ -14,7 +14,7 @@
sourcepub fn signature(&self) -> &EntrySignature
Get the signature.
sourcepub fn validate_empty(&self) -> Result<(), ValidationFailure>
Validate that the entry has the empty hash if the length is 0, or a non-zero length.
sourcepub fn content_hash(&self) -> Hash
Get the content [struct@Hash] of the entry.
+sourcepub fn content_hash(&self) -> Hash
Get the content Hash of the entry.
sourcepub fn content_len(&self) -> u64
Get the content length of the entry.
Get the author bytes of this entry.
Methods from Deref<Target = Record>§
sourcepub fn content_len(&self) -> u64
Get the length of the data addressed by this record’s content hash.
-sourcepub fn content_hash(&self) -> Hash
Get the [struct@Hash] of the content data of this record.
+sourcepub fn content_hash(&self) -> Hash
Get the Hash of the content data of this record.
Trait Implementations§
source§impl Clone for SignedEntry
source§fn clone(&self) -> SignedEntry
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moresource§impl Debug for SignedEntry
source§impl Deref for SignedEntry
source§impl<'de> Deserialize<'de> for SignedEntry
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl From<SignedEntry> for Entry
source§fn from(value: SignedEntry) -> Self
Converts to this type from the input type.source§impl Ord for SignedEntry
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
diff --git a/pr/2595/docs/iroh_docs/sync/type.ContentStatusCallback.html b/pr/2595/docs/iroh_docs/sync/type.ContentStatusCallback.html
index 46d5a5a49c..84ffdbe8ee 100644
--- a/pr/2595/docs/iroh_docs/sync/type.ContentStatusCallback.html
+++ b/pr/2595/docs/iroh_docs/sync/type.ContentStatusCallback.html
@@ -1,2 +1,2 @@
-ContentStatusCallback in iroh_docs::sync - Rust Type Alias iroh_docs::sync::ContentStatusCallback
source · pub type ContentStatusCallback = Arc<dyn Fn(Hash) -> ContentStatus + Send + Sync + 'static>;
Expand description
Callback that may be set on a replica to determine the availability status for a content hash.
+ContentStatusCallback in iroh_docs::sync - Rust Type Alias iroh_docs::sync::ContentStatusCallback
source · pub type ContentStatusCallback = Arc<dyn Fn(Hash) -> ContentStatus + Send + Sync + 'static>;
Expand description
Callback that may be set on a replica to determine the availability status for a content hash.
Aliased Type§
struct ContentStatusCallback { /* private fields */ }
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_net/discovery/dns/index.html b/pr/2595/docs/iroh_net/discovery/dns/index.html
index 5a80538422..a752b49d78 100644
--- a/pr/2595/docs/iroh_net/discovery/dns/index.html
+++ b/pr/2595/docs/iroh_net/discovery/dns/index.html
@@ -1,2 +1,2 @@
-iroh_net::discovery::dns - Rust Expand description
DNS node discovery for iroh-net
+iroh_net::discovery::dns - Rust Expand description
DNS node discovery for iroh-net
Structs§
- DNS node discovery
Constants§
- The n0 testing DNS node origin, for production.
- The n0 testing DNS node origin, for testing.
- Testing DNS node origin, must run server from
crate::test_utils::DnsPkarrServer.
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_net/discovery/dns/struct.DnsDiscovery.html b/pr/2595/docs/iroh_net/discovery/dns/struct.DnsDiscovery.html
index 3e7d5d71cc..7628fb45a9 100644
--- a/pr/2595/docs/iroh_net/discovery/dns/struct.DnsDiscovery.html
+++ b/pr/2595/docs/iroh_net/discovery/dns/struct.DnsDiscovery.html
@@ -28,7 +28,7 @@ custom discovery mechanism.
For testing it is also possible to use the N0_DNS_NODE_ORIGIN_STAGING domain
with DnsDiscovery::new. This would then use a hosted discovery service again,
but for testing purposes.
-Trait Implementations§
Trait Implementations§
source§impl Debug for DnsDiscovery
source§impl Discovery for DnsDiscovery
source§fn resolve(
&self,
ep: Endpoint,
node_id: NodeId
diff --git a/pr/2595/docs/iroh_net/discovery/trait.Discovery.html b/pr/2595/docs/iroh_net/discovery/trait.Discovery.html
index a53a618708..d3832a56b5 100644
--- a/pr/2595/docs/iroh_net/discovery/trait.Discovery.html
+++ b/pr/2595/docs/iroh_net/discovery/trait.Discovery.html
@@ -29,4 +29,4 @@ These tasks will be run on the runtime of the Option<BoxStream<Result<DiscoveryItem>>>
Implementors§
source§impl Discovery for DnsDiscovery
source§impl Discovery for LocalSwarmDiscovery
source§impl Discovery for PkarrPublisher
source§impl Discovery for PkarrResolver
source§impl Discovery for ConcurrentDiscovery
\ No newline at end of file
+
Implementors§
source§impl Discovery for DnsDiscovery
source§impl Discovery for LocalSwarmDiscovery
source§impl Discovery for PkarrPublisher
source§impl Discovery for PkarrResolver
source§impl Discovery for ConcurrentDiscovery
\ No newline at end of file
diff --git a/pr/2595/docs/src/iroh_net/discovery/dns.rs.html b/pr/2595/docs/src/iroh_net/discovery/dns.rs.html
index dd1a279fb3..1d32545ed3 100644
--- a/pr/2595/docs/src/iroh_net/discovery/dns.rs.html
+++ b/pr/2595/docs/src/iroh_net/discovery/dns.rs.html
@@ -97,6 +97,10 @@
97
98
99
+100
+101
+102
+103
//! DNS node discovery for iroh-net
use anyhow::Result;
@@ -182,6 +186,10 @@
fn resolve(&self, ep: Endpoint, node_id: NodeId) -> Option<BoxStream<Result<DiscoveryItem>>> {
let resolver = ep.dns_resolver().clone();
let origin_domain = self.origin_domain.clone();
+ #[cfg(any(test, feature = "test-utils"))]
+ if origin_domain.contains(&TEST_DNS_NODE_ORIGIN.to_string()) {
+ panic!("wait. THIS IS ILLEGAL!");
+ }
let fut = async move {
let node_addr = resolver
.lookup_by_id_staggered(&node_id, &origin_domain, DNS_STAGGERING_MS)
diff --git a/pr/2595/docs/trait.impl/iroh_base/ticket/trait.Ticket.js b/pr/2595/docs/trait.impl/iroh_base/ticket/trait.Ticket.js
index 12fa1e3ee5..5d209fabd2 100644
--- a/pr/2595/docs/trait.impl/iroh_base/ticket/trait.Ticket.js
+++ b/pr/2595/docs/trait.impl/iroh_base/ticket/trait.Ticket.js
@@ -1,5 +1,5 @@
(function() {var implementors = {
"iroh":[],
"iroh_base":[],
-"iroh_docs":[["impl Ticket for DocTicket"]]
+"iroh_docs":[["impl Ticket for DocTicket"]]
};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
diff --git a/pr/2595/docs/type.impl/std/primitive.array.js b/pr/2595/docs/type.impl/std/primitive.array.js
index 588a8b53a3..3006964922 100644
--- a/pr/2595/docs/type.impl/std/primitive.array.js
+++ b/pr/2595/docs/type.impl/std/primitive.array.js
@@ -1,4 +1,4 @@
(function() {var type_impls = {
"iroh":[["source§impl<T, const N: usize> [T; N]
1.55.0 · sourcepub fn map<F, U>(self, f: F) -> [U; N]where\n F: FnMut(T) -> U,
Returns an array of the same size as self, with function f applied to each element\nin order.
\nIf you don’t necessarily need a new fixed-size array, consider using\nIterator::map instead.
\n§Note on performance and stack usage
\nUnfortunately, usages of this method are currently not always optimized\nas well as they could be. This mainly concerns large arrays, as mapping\nover small arrays seem to be optimized just fine. Also note that in\ndebug mode (i.e. without any optimizations), this method can use a lot\nof stack space (a few times the size of the array or more).
\nTherefore, in performance-critical code, try to avoid using this method\non large arrays or check the emitted code. Also try to avoid chained\nmaps (e.g. arr.map(...).map(...)).
\nIn many cases, you can instead use Iterator::map by calling .iter()\nor .into_iter() on your array. [T; N]::map is only necessary if you\nreally need a new array of the same size as the result. Rust’s lazy\niterators tend to get optimized very well.
\n§Examples
\nlet x = [1, 2, 3];\nlet y = x.map(|v| v + 1);\nassert_eq!(y, [2, 3, 4]);\n\nlet x = [1, 2, 3];\nlet mut temp = 0;\nlet y = x.map(|v| { temp += 1; v * temp });\nassert_eq!(y, [1, 4, 9]);\n\nlet x = [\"Ferris\", \"Bueller's\", \"Day\", \"Off\"];\nlet y = x.map(|v| v.len());\nassert_eq!(y, [6, 9, 3, 3]);
\nsourcepub fn try_map<F, R>(\n self,\n f: F\n) -> <<R as Try>::Residual as Residual<[<R as Try>::Output; N]>>::TryType
🔬This is a nightly-only experimental API. (array_try_map)
A fallible function f applied to each element on array self in order to\nreturn an array the same size as self or the first error encountered.
\nThe return type of this function depends on the return type of the closure.\nIf you return Result<T, E> from the closure, you’ll get a Result<[T; N], E>.\nIf you return Option<T> from the closure, you’ll get an Option<[T; N]>.
\n§Examples
\n#![feature(array_try_map)]\n\nlet a = [\"1\", \"2\", \"3\"];\nlet b = a.try_map(|v| v.parse::<u32>()).unwrap().map(|v| v + 1);\nassert_eq!(b, [2, 3, 4]);\n\nlet a = [\"1\", \"2a\", \"3\"];\nlet b = a.try_map(|v| v.parse::<u32>());\nassert!(b.is_err());\n\nuse std::num::NonZero;\n\nlet z = [1, 2, 0, 3, 4];\nassert_eq!(z.try_map(NonZero::new), None);\n\nlet a = [1, 2, 3];\nlet b = a.try_map(NonZero::new);\nlet c = b.map(|x| x.map(NonZero::get));\nassert_eq!(c, Some(a));
\n1.57.0 (const: 1.57.0) · sourcepub const fn as_slice(&self) -> &[T]
Returns a slice containing the entire array. Equivalent to &s[..].
\n1.57.0 · sourcepub fn as_mut_slice(&mut self) -> &mut [T]
Returns a mutable slice containing the entire array. Equivalent to\n&mut s[..].
\n1.77.0 · sourcepub fn each_ref(&self) -> [&T; N]
Borrows each element and returns an array of references with the same\nsize as self.
\n§Example
\nlet floats = [3.1, 2.7, -1.0];\nlet float_refs: [&f64; 3] = floats.each_ref();\nassert_eq!(float_refs, [&3.1, &2.7, &-1.0]);
\nThis method is particularly useful if combined with other methods, like\nmap. This way, you can avoid moving the original\narray if its elements are not Copy.
\n\nlet strings = [\"Ferris\".to_string(), \"♥\".to_string(), \"Rust\".to_string()];\nlet is_ascii = strings.each_ref().map(|s| s.is_ascii());\nassert_eq!(is_ascii, [true, false, true]);\n\n// We can still access the original array: it has not been moved.\nassert_eq!(strings.len(), 3);
\n1.77.0 · sourcepub fn each_mut(&mut self) -> [&mut T; N]
Borrows each element mutably and returns an array of mutable references\nwith the same size as self.
\n§Example
\n\nlet mut floats = [3.1, 2.7, -1.0];\nlet float_refs: [&mut f64; 3] = floats.each_mut();\n*float_refs[0] = 0.0;\nassert_eq!(float_refs, [&mut 0.0, &mut 2.7, &mut -1.0]);\nassert_eq!(floats, [0.0, 2.7, -1.0]);
\nsourcepub fn split_array_ref<const M: usize>(&self) -> (&[T; M], &[T])
🔬This is a nightly-only experimental API. (split_array)
Divides one array reference into two at an index.
\nThe first will contain all indices from [0, M) (excluding\nthe index M itself) and the second will contain all\nindices from [M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet v = [1, 2, 3, 4, 5, 6];\n\n{\n let (left, right) = v.split_array_ref::<0>();\n assert_eq!(left, &[]);\n assert_eq!(right, &[1, 2, 3, 4, 5, 6]);\n}\n\n{\n let (left, right) = v.split_array_ref::<2>();\n assert_eq!(left, &[1, 2]);\n assert_eq!(right, &[3, 4, 5, 6]);\n}\n\n{\n let (left, right) = v.split_array_ref::<6>();\n assert_eq!(left, &[1, 2, 3, 4, 5, 6]);\n assert_eq!(right, &[]);\n}
\nsourcepub fn split_array_mut<const M: usize>(&mut self) -> (&mut [T; M], &mut [T])
🔬This is a nightly-only experimental API. (split_array)
Divides one mutable array reference into two at an index.
\nThe first will contain all indices from [0, M) (excluding\nthe index M itself) and the second will contain all\nindices from [M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet mut v = [1, 0, 3, 0, 5, 6];\nlet (left, right) = v.split_array_mut::<2>();\nassert_eq!(left, &mut [1, 0][..]);\nassert_eq!(right, &mut [3, 0, 5, 6]);\nleft[1] = 2;\nright[1] = 4;\nassert_eq!(v, [1, 2, 3, 4, 5, 6]);
\nsourcepub fn rsplit_array_ref<const M: usize>(&self) -> (&[T], &[T; M])
🔬This is a nightly-only experimental API. (split_array)
Divides one array reference into two at an index from the end.
\nThe first will contain all indices from [0, N - M) (excluding\nthe index N - M itself) and the second will contain all\nindices from [N - M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet v = [1, 2, 3, 4, 5, 6];\n\n{\n let (left, right) = v.rsplit_array_ref::<0>();\n assert_eq!(left, &[1, 2, 3, 4, 5, 6]);\n assert_eq!(right, &[]);\n}\n\n{\n let (left, right) = v.rsplit_array_ref::<2>();\n assert_eq!(left, &[1, 2, 3, 4]);\n assert_eq!(right, &[5, 6]);\n}\n\n{\n let (left, right) = v.rsplit_array_ref::<6>();\n assert_eq!(left, &[]);\n assert_eq!(right, &[1, 2, 3, 4, 5, 6]);\n}
\nsourcepub fn rsplit_array_mut<const M: usize>(&mut self) -> (&mut [T], &mut [T; M])
🔬This is a nightly-only experimental API. (split_array)
Divides one mutable array reference into two at an index from the end.
\nThe first will contain all indices from [0, N - M) (excluding\nthe index N - M itself) and the second will contain all\nindices from [N - M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet mut v = [1, 0, 3, 0, 5, 6];\nlet (left, right) = v.rsplit_array_mut::<4>();\nassert_eq!(left, &mut [1, 0]);\nassert_eq!(right, &mut [3, 0, 5, 6][..]);\nleft[1] = 2;\nright[1] = 4;\nassert_eq!(v, [1, 2, 3, 4, 5, 6]);
\n",0,"iroh::docs::PeerIdBytes"],["source§impl<const N: usize> [u8; N]
sourcepub const fn as_ascii(&self) -> Option<&[AsciiChar; N]>
🔬This is a nightly-only experimental API. (ascii_char)
Converts this array of bytes into a array of ASCII characters,\nor returns None if any of the characters is non-ASCII.
\n§Examples
\n#![feature(ascii_char)]\n#![feature(const_option)]\n\nconst HEX_DIGITS: [std::ascii::Char; 16] =\n *b\"0123456789abcdef\".as_ascii().unwrap();\n\nassert_eq!(HEX_DIGITS[1].as_str(), \"1\");\nassert_eq!(HEX_DIGITS[10].as_str(), \"a\");
\nsourcepub const unsafe fn as_ascii_unchecked(&self) -> &[AsciiChar; N]
🔬This is a nightly-only experimental API. (ascii_char)
Converts this array of bytes into a array of ASCII characters,\nwithout checking whether they’re valid.
\n§Safety
\nEvery byte in the array must be in 0..=127, or else this is UB.
\n",0,"iroh::docs::PeerIdBytes"],["§impl<T> Array for [T; 32]where\n T: Default,
§fn as_slice_mut(&mut self) -> &mut [T]
Gives a unique slice over the whole thing. Read more","Array","iroh::docs::PeerIdBytes"],["","Array","iroh::docs::PeerIdBytes"],["§impl<const N: usize, T> AsBytes for [T; N]where\n T: AsBytes,
§fn write_to_prefix(&self, bytes: &mut [u8]) -> Option<()>
","AsBytes","iroh::docs::PeerIdBytes"],["","AsBytes","iroh::docs::PeerIdBytes"],["","AsMut<[T]>","iroh::docs::PeerIdBytes"],["","AsRef<[T]>","iroh::docs::PeerIdBytes"],["§impl<T, const N: usize> BitView for [T; N]where\n T: BitStore,
Note that overly-large arrays may cause the conversions to fail.
\n§fn view_bits<O>(&self) -> &BitSlice<T, O>where\n O: BitOrder,
Views a memory region as an immutable bit-slice.§fn try_view_bits<O>(&self) -> Result<&BitSlice<T, O>, BitSpanError<T>>where\n O: BitOrder,
Attempts to view a memory region as an immutable bit-slice. Read more§fn view_bits_mut<O>(&mut self) -> &mut BitSlice<T, O>where\n O: BitOrder,
Views a memory region as a mutable bit-slice.§fn try_view_bits_mut<O>(\n &mut self\n) -> Result<&mut BitSlice<T, O>, BitSpanError<T>>where\n O: BitOrder,
Attempts to view a memory region as a mutable bit-slice. Read more","BitView","iroh::docs::PeerIdBytes"],["§impl<T, const N: usize> BitViewSized for [T; N]where\n T: BitStore,
§fn as_raw_slice(&self) -> &[<[T; N] as BitView>::Store]
Views the type as a slice of its elements.§fn as_raw_mut_slice(&mut self) -> &mut [<[T; N] as BitView>::Store]
Views the type as a mutable slice of its elements.§fn into_bitarray<O>(self) -> BitArray<Self, O>where\n O: BitOrder,
Wraps self in a BitArray.","BitViewSized","iroh::docs::PeerIdBytes"],["","Borrow<[T]>","iroh::docs::PeerIdBytes"],["1.4.0 · source§impl<T, const N: usize> BorrowMut<[T]> for [T; N]
source§fn borrow_mut(&mut self) -> &mut [T]
Mutably borrows from an owned value. Read more","BorrowMut<[T]>","iroh::docs::PeerIdBytes"],["","Chain","iroh::docs::PeerIdBytes"],["","Clone","iroh::docs::PeerIdBytes"],["","Debug","iroh::docs::PeerIdBytes"],["§impl<const N: usize> Decode for [u8; N]
Decodes a byte array from byte[n] as described in RFC4251 § 5:
\n\nA byte represents an arbitrary 8-bit value (octet). Fixed length\ndata is sometimes represented as an array of bytes, written\nbyte[n], where n is the number of bytes in the array.
\n
\n","Decode","iroh::docs::PeerIdBytes"],["§impl<'a, T, const N: usize> DecodeValue<'a> for [T; N]where\n T: Decode<'a>,
§fn decode_value<R>(reader: &mut R, header: Header) -> Result<[T; N], Error>where\n R: Reader<'a>,
Attempt to decode this message using the provided [Reader].","DecodeValue<'a>","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["source§impl<'de, T> Deserialize<'de> for [T; 32]where\n T: Deserialize<'de>,
source§fn deserialize<D>(\n deserializer: D\n) -> Result<[T; 32], <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more","Deserialize<'de>","iroh::docs::PeerIdBytes"],["source§impl<'de, const N: usize> Deserialize<'de> for [u8; N]
source§fn deserialize<D>(\n deserializer: D\n) -> Result<[u8; N], <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
","Deserialize<'de>","iroh::docs::PeerIdBytes"],["§impl<const N: usize> Encode for [u8; N]
Encodes [u8; N] into byte[n] as described in RFC4251 § 5:
\n\nA byte represents an arbitrary 8-bit value (octet). Fixed length\ndata is sometimes represented as an array of bytes, written\nbyte[n], where n is the number of bytes in the array.
\n
\n§fn encoded_len(&self) -> Result<usize, Error>
Get the length of this type encoded in bytes, prior to Base64 encoding.§fn encode(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value using the provided [Writer].§fn encoded_len_prefixed(&self) -> Result<usize, Error>
Return the length of this type after encoding when prepended with a\nuint32 length prefix.§fn encode_prefixed(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value, first prepending a uint32 length prefix\nset to [Encode::encoded_len].","Encode","iroh::docs::PeerIdBytes"],["","EncodeLabelSet","iroh::docs::PeerIdBytes"],["§impl<T, const N: usize> EncodeValue for [T; N]where\n T: Encode,
","EncodeValue","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["§impl<'a> FindToken<&'a u8> for [u8; 32]
§fn find_token(&self, token: &u8) -> bool
Returns true if self contains the token","FindToken<&'a u8>","iroh::docs::PeerIdBytes"],["§impl FindToken<u8> for [u8; 32]
§fn find_token(&self, token: u8) -> bool
Returns true if self contains the token","FindToken","iroh::docs::PeerIdBytes"],["","FixedTag","iroh::docs::PeerIdBytes"],["","From<&Signature>","iroh::docs::PeerIdBytes"],["","From","iroh::docs::PeerIdBytes"],["§impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>>> for [T; 32]
","From, B0>, B0>, B0>, B0>, B0>>>","iroh::docs::PeerIdBytes"],["","From","iroh::docs::PeerIdBytes"],["","From","iroh::docs::PeerIdBytes"],["","From>","iroh::docs::PeerIdBytes"],["","From","iroh::docs::PeerIdBytes"],["","From","iroh::docs::PeerIdBytes"],["","From","iroh::docs::PeerIdBytes"],["","From>","iroh::docs::PeerIdBytes"],["§impl<const N: usize, T> FromBytes for [T; N]where\n T: FromBytes,
§fn slice_from_prefix(bytes: &[u8], count: usize) -> Option<(&[Self], &[u8])>where\n Self: Sized,
Interprets the prefix of the given bytes as a &[Self] with length\nequal to count without copying. Read more§fn slice_from_suffix(bytes: &[u8], count: usize) -> Option<(&[u8], &[Self])>where\n Self: Sized,
Interprets the suffix of the given bytes as a &[Self] with length\nequal to count without copying. Read more§fn read_from_prefix(bytes: &[u8]) -> Option<Self>where\n Self: Sized,
","FromBytes","iroh::docs::PeerIdBytes"],["","FromHex","iroh::docs::PeerIdBytes"],["","FromZeroes","iroh::docs::PeerIdBytes"],["","Hash","iroh::docs::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Hash for [T; N]where\n T: Hash,
The hash of an array is the same as that of the corresponding slice,\nas required by the Borrow implementation.
\n\nuse std::hash::BuildHasher;\n\nlet b = std::hash::RandomState::new();\nlet a: [u8; 3] = [0xa8, 0x3c, 0x09];\nlet s: &[u8] = &[0xa8, 0x3c, 0x09];\nassert_eq!(b.hash_one(a), b.hash_one(s));
\n","Hash","iroh::docs::PeerIdBytes"],["","Index","iroh::docs::PeerIdBytes"],["","IndexMut","iroh::docs::PeerIdBytes"],["","InputLength","iroh::docs::PeerIdBytes"],["1.53.0 · source§impl<T, const N: usize> IntoIterator for [T; N]
source§fn into_iter(self) -> <[T; N] as IntoIterator>::IntoIter
Creates a consuming iterator, that is, one that moves each value out of\nthe array (from start to end). The array cannot be used after calling\nthis unless T implements Copy, so the whole array is copied.
\nArrays have special behavior when calling .into_iter() prior to the\n2021 edition – see the array Editions section for more information.
\n","IntoIterator","iroh::docs::PeerIdBytes"],["§impl<const N: usize> IntoResponse for [u8; N]
§fn into_response(self) -> Response<Body>
Create a response.","IntoResponse","iroh::docs::PeerIdBytes"],["§impl<Fut, const N: usize> Join for [Fut; N]where\n Fut: IntoFuture,
§type Output = [<Fut as IntoFuture>::Output; N]
The resulting output type.§type Future = Join<<Fut as IntoFuture>::IntoFuture, N>
The Future implementation returned by this method.","Join","iroh::docs::PeerIdBytes"],["","Key","iroh::docs::PeerIdBytes"],["§impl<T, const N: usize> MaxSize for [T; N]where\n T: MaxSize,
§const POSTCARD_MAX_SIZE: usize = _
The maximum possible size that the serialization of this\ntype can have, in bytes.","MaxSize","iroh::docs::PeerIdBytes"],["","Merge","iroh::docs::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Ord for [T; N]where\n T: Ord,
Implements comparison of arrays lexicographically.
\n1.21.0 · source§fn max(self, other: Self) -> Selfwhere\n Self: Sized,
Compares and returns the maximum of two values. Read more","Ord","iroh::docs::PeerIdBytes"],["","PartialEq<&[U]>","iroh::docs::PeerIdBytes"],["1.0.0 · source§impl<T, U, const N: usize> PartialEq<&mut [U]> for [T; N]where\n T: PartialEq<U>,
","PartialEq<&mut [U]>","iroh::docs::PeerIdBytes"],["","PartialEq<[U]>","iroh::docs::PeerIdBytes"],["","PartialEq<[U; N]>","iroh::docs::PeerIdBytes"],["","PartialEq","iroh::docs::PeerIdBytes"],["§impl<A, B, const N: usize, const M: usize> PartialEq<Vec<A, N>> for [B; M]where\n A: PartialEq<B>,
","PartialEq>","iroh::docs::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> PartialOrd for [T; N]where\n T: PartialOrd,
Implements comparison of arrays lexicographically.
\nsource§fn le(&self, other: &[T; N]) -> bool
This method tests less than or equal to (for self and other) and is used by the <=\noperator. Read more","PartialOrd","iroh::docs::PeerIdBytes"],["§impl<Fut, const N: usize> Race for [Fut; N]where\n Fut: IntoFuture,
§type Output = <Fut as IntoFuture>::Output
The resulting output type.§type Future = Race<<Fut as IntoFuture>::IntoFuture, N>
Which kind of future are we turning this into?","Race","iroh::docs::PeerIdBytes"],["§impl<Fut, T, E, const N: usize> RaceOk for [Fut; N]where\n Fut: IntoFuture<Output = Result<T, E>>,
§type Future = RaceOk<<Fut as IntoFuture>::IntoFuture, T, E, N>
Which kind of future are we turning this into?","RaceOk","iroh::docs::PeerIdBytes"],["","Schema","iroh::docs::PeerIdBytes"],["source§impl<T> Serialize for [T; 32]where\n T: 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","iroh::docs::PeerIdBytes"],["source§impl<const N: usize> Serialize for [u8; N]
source§fn serialize<S>(\n &self,\n serializer: S\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where\n S: Serializer,
","Serialize","iroh::docs::PeerIdBytes"],["1.51.0 · source§impl<T, const N: usize> SlicePattern for [T; N]
","SlicePattern","iroh::docs::PeerIdBytes"],["1.34.0 · source§impl<T, const N: usize> TryFrom<&[T]> for [T; N]where\n T: Copy,
Tries to create an array [T; N] by copying from a slice &[T]. Succeeds if\nslice.len() == N.
\n\nlet bytes: [u8; 3] = [1, 0, 2];\n\nlet bytes_head: [u8; 2] = <[u8; 2]>::try_from(&bytes[0..2]).unwrap();\nassert_eq!(1, u16::from_le_bytes(bytes_head));\n\nlet bytes_tail: [u8; 2] = bytes[1..3].try_into().unwrap();\nassert_eq!(512, u16::from_le_bytes(bytes_tail));
\n§type Error = TryFromSliceError
The type returned in the event of a conversion error.","TryFrom<&[T]>","iroh::docs::PeerIdBytes"],["1.59.0 · source§impl<T, const N: usize> TryFrom<&mut [T]> for [T; N]where\n T: Copy,
Tries to create an array [T; N] by copying from a mutable slice &mut [T].\nSucceeds if slice.len() == N.
\n\nlet mut bytes: [u8; 3] = [1, 0, 2];\n\nlet bytes_head: [u8; 2] = <[u8; 2]>::try_from(&mut bytes[0..2]).unwrap();\nassert_eq!(1, u16::from_le_bytes(bytes_head));\n\nlet bytes_tail: [u8; 2] = (&mut bytes[1..3]).try_into().unwrap();\nassert_eq!(512, u16::from_le_bytes(bytes_tail));
\n§type Error = TryFromSliceError
The type returned in the event of a conversion error.","TryFrom<&mut [T]>","iroh::docs::PeerIdBytes"],["§impl<T, A, const N: usize> TryFrom<Vec<T, A>> for [T; N]where\n A: Allocator,
§fn try_from(vec: Vec<T, A>) -> Result<[T; N], Vec<T, A>>
Gets the entire contents of the Vec<T> as an array,\nif its size exactly matches that of the requested array.
\n§Examples
\nassert_eq!(vec![1, 2, 3].try_into(), Ok([1, 2, 3]));\nassert_eq!(<Vec<i32>>::new().try_into(), Ok([]));
\nIf the length doesn’t match, the input comes back in Err:
\n\nlet r: Result<[i32; 4], _> = (0..10).collect::<Vec<_>>().try_into();\nassert_eq!(r, Err(vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9]));
\nIf you’re fine with just getting a prefix of the Vec<T>,\nyou can call .truncate(N) first.
\n\nlet mut v = String::from(\"hello world\").into_bytes();\nv.sort();\nv.truncate(2);\nlet [a, b]: [_; 2] = v.try_into().unwrap();\nassert_eq!(a, b' ');\nassert_eq!(b, b'd');
\n","TryFrom>","iroh::docs::PeerIdBytes"],["1.48.0 · source§impl<T, A, const N: usize> TryFrom<Vec<T, A>> for [T; N]where\n A: Allocator,
source§fn try_from(vec: Vec<T, A>) -> Result<[T; N], Vec<T, A>>
Gets the entire contents of the Vec<T> as an array,\nif its size exactly matches that of the requested array.
\n§Examples
\nassert_eq!(vec![1, 2, 3].try_into(), Ok([1, 2, 3]));\nassert_eq!(<Vec<i32>>::new().try_into(), Ok([]));
\nIf the length doesn’t match, the input comes back in Err:
\n\nlet r: Result<[i32; 4], _> = (0..10).collect::<Vec<_>>().try_into();\nassert_eq!(r, Err(vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9]));
\nIf you’re fine with just getting a prefix of the Vec<T>,\nyou can call .truncate(N) first.
\n\nlet mut v = String::from(\"hello world\").into_bytes();\nv.sort();\nv.truncate(2);\nlet [a, b]: [_; 2] = v.try_into().unwrap();\nassert_eq!(a, b' ');\nassert_eq!(b, b'd');
\n","TryFrom>","iroh::docs::PeerIdBytes"],["§impl<Fut, T, E, const N: usize> TryJoin for [Fut; N]where\n Fut: IntoFuture<Output = Result<T, E>>,
§type Future = TryJoin<<Fut as IntoFuture>::IntoFuture, T, E, N>
Which kind of future are we turning this into?","TryJoin","iroh::docs::PeerIdBytes"],["§impl<const N: usize, T> Value for [T; N]where\n T: Value,
§type SelfType<'a> = [<T as Value>::SelfType<'a>; N]\nwhere\n [T; N]: 'a
SelfType<’a> must be the same type as Self with all lifetimes replaced with ’a§type AsBytes<'a> = Vec<u8>\nwhere\n [T; N]: 'a
§fn fixed_width() -> Option<usize>
Width of a fixed type, or None for variable width§fn from_bytes<'a>(data: &'a [u8]) -> [<T as Value>::SelfType<'a>; N]where\n [T; N]: 'a,
Deserializes data\nImplementations may return a view over data, or an owned type","Value","iroh::docs::PeerIdBytes"],["","ValueOrd","iroh::docs::PeerIdBytes"],["§impl<Z, const N: usize> Zeroize for [Z; N]where\n Z: Zeroize,
Impl [Zeroize] on arrays of types that impl [Zeroize].
\n","Zeroize","iroh::docs::PeerIdBytes"],["","Zip","iroh::docs::PeerIdBytes"],["source§impl<T, const N: usize> ConstParamTy for [T; N]where\n T: ConstParamTy,
","ConstParamTy","iroh::docs::PeerIdBytes"],["1.58.0 · source§impl<T, const N: usize> Copy for [T; N]where\n T: Copy,
","Copy","iroh::docs::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Eq for [T; N]where\n T: Eq,
","Eq","iroh::docs::PeerIdBytes"],["source§impl<T, const N: usize> StructuralPartialEq for [T; N]
","StructuralPartialEq","iroh::docs::PeerIdBytes"],["§impl<const N: usize, T> Unaligned for [T; N]where\n T: Unaligned,
","Unaligned","iroh::docs::PeerIdBytes"],["§impl<Z, const N: usize> ZeroizeOnDrop for [Z; N]where\n Z: ZeroizeOnDrop,
Impl [ZeroizeOnDrop] on arrays of types that impl [ZeroizeOnDrop].
\n","ZeroizeOnDrop","iroh::docs::PeerIdBytes"]],
-"iroh_docs":[["source§impl<T, const N: usize> [T; N]
1.55.0 · sourcepub fn map<F, U>(self, f: F) -> [U; N]where\n F: FnMut(T) -> U,
Returns an array of the same size as self, with function f applied to each element\nin order.
\nIf you don’t necessarily need a new fixed-size array, consider using\nIterator::map instead.
\n§Note on performance and stack usage
\nUnfortunately, usages of this method are currently not always optimized\nas well as they could be. This mainly concerns large arrays, as mapping\nover small arrays seem to be optimized just fine. Also note that in\ndebug mode (i.e. without any optimizations), this method can use a lot\nof stack space (a few times the size of the array or more).
\nTherefore, in performance-critical code, try to avoid using this method\non large arrays or check the emitted code. Also try to avoid chained\nmaps (e.g. arr.map(...).map(...)).
\nIn many cases, you can instead use Iterator::map by calling .iter()\nor .into_iter() on your array. [T; N]::map is only necessary if you\nreally need a new array of the same size as the result. Rust’s lazy\niterators tend to get optimized very well.
\n§Examples
\nlet x = [1, 2, 3];\nlet y = x.map(|v| v + 1);\nassert_eq!(y, [2, 3, 4]);\n\nlet x = [1, 2, 3];\nlet mut temp = 0;\nlet y = x.map(|v| { temp += 1; v * temp });\nassert_eq!(y, [1, 4, 9]);\n\nlet x = [\"Ferris\", \"Bueller's\", \"Day\", \"Off\"];\nlet y = x.map(|v| v.len());\nassert_eq!(y, [6, 9, 3, 3]);
\nsourcepub fn try_map<F, R>(\n self,\n f: F\n) -> <<R as Try>::Residual as Residual<[<R as Try>::Output; N]>>::TryType
🔬This is a nightly-only experimental API. (array_try_map)
A fallible function f applied to each element on array self in order to\nreturn an array the same size as self or the first error encountered.
\nThe return type of this function depends on the return type of the closure.\nIf you return Result<T, E> from the closure, you’ll get a Result<[T; N], E>.\nIf you return Option<T> from the closure, you’ll get an Option<[T; N]>.
\n§Examples
\n#![feature(array_try_map)]\n\nlet a = [\"1\", \"2\", \"3\"];\nlet b = a.try_map(|v| v.parse::<u32>()).unwrap().map(|v| v + 1);\nassert_eq!(b, [2, 3, 4]);\n\nlet a = [\"1\", \"2a\", \"3\"];\nlet b = a.try_map(|v| v.parse::<u32>());\nassert!(b.is_err());\n\nuse std::num::NonZero;\n\nlet z = [1, 2, 0, 3, 4];\nassert_eq!(z.try_map(NonZero::new), None);\n\nlet a = [1, 2, 3];\nlet b = a.try_map(NonZero::new);\nlet c = b.map(|x| x.map(NonZero::get));\nassert_eq!(c, Some(a));
\n1.57.0 (const: 1.57.0) · sourcepub const fn as_slice(&self) -> &[T]
Returns a slice containing the entire array. Equivalent to &s[..].
\n1.57.0 · sourcepub fn as_mut_slice(&mut self) -> &mut [T]
Returns a mutable slice containing the entire array. Equivalent to\n&mut s[..].
\n1.77.0 · sourcepub fn each_ref(&self) -> [&T; N]
Borrows each element and returns an array of references with the same\nsize as self.
\n§Example
\nlet floats = [3.1, 2.7, -1.0];\nlet float_refs: [&f64; 3] = floats.each_ref();\nassert_eq!(float_refs, [&3.1, &2.7, &-1.0]);
\nThis method is particularly useful if combined with other methods, like\nmap. This way, you can avoid moving the original\narray if its elements are not Copy.
\n\nlet strings = [\"Ferris\".to_string(), \"♥\".to_string(), \"Rust\".to_string()];\nlet is_ascii = strings.each_ref().map(|s| s.is_ascii());\nassert_eq!(is_ascii, [true, false, true]);\n\n// We can still access the original array: it has not been moved.\nassert_eq!(strings.len(), 3);
\n1.77.0 · sourcepub fn each_mut(&mut self) -> [&mut T; N]
Borrows each element mutably and returns an array of mutable references\nwith the same size as self.
\n§Example
\n\nlet mut floats = [3.1, 2.7, -1.0];\nlet float_refs: [&mut f64; 3] = floats.each_mut();\n*float_refs[0] = 0.0;\nassert_eq!(float_refs, [&mut 0.0, &mut 2.7, &mut -1.0]);\nassert_eq!(floats, [0.0, 2.7, -1.0]);
\nsourcepub fn split_array_ref<const M: usize>(&self) -> (&[T; M], &[T])
🔬This is a nightly-only experimental API. (split_array)
Divides one array reference into two at an index.
\nThe first will contain all indices from [0, M) (excluding\nthe index M itself) and the second will contain all\nindices from [M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet v = [1, 2, 3, 4, 5, 6];\n\n{\n let (left, right) = v.split_array_ref::<0>();\n assert_eq!(left, &[]);\n assert_eq!(right, &[1, 2, 3, 4, 5, 6]);\n}\n\n{\n let (left, right) = v.split_array_ref::<2>();\n assert_eq!(left, &[1, 2]);\n assert_eq!(right, &[3, 4, 5, 6]);\n}\n\n{\n let (left, right) = v.split_array_ref::<6>();\n assert_eq!(left, &[1, 2, 3, 4, 5, 6]);\n assert_eq!(right, &[]);\n}
\nsourcepub fn split_array_mut<const M: usize>(&mut self) -> (&mut [T; M], &mut [T])
🔬This is a nightly-only experimental API. (split_array)
Divides one mutable array reference into two at an index.
\nThe first will contain all indices from [0, M) (excluding\nthe index M itself) and the second will contain all\nindices from [M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet mut v = [1, 0, 3, 0, 5, 6];\nlet (left, right) = v.split_array_mut::<2>();\nassert_eq!(left, &mut [1, 0][..]);\nassert_eq!(right, &mut [3, 0, 5, 6]);\nleft[1] = 2;\nright[1] = 4;\nassert_eq!(v, [1, 2, 3, 4, 5, 6]);
\nsourcepub fn rsplit_array_ref<const M: usize>(&self) -> (&[T], &[T; M])
🔬This is a nightly-only experimental API. (split_array)
Divides one array reference into two at an index from the end.
\nThe first will contain all indices from [0, N - M) (excluding\nthe index N - M itself) and the second will contain all\nindices from [N - M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet v = [1, 2, 3, 4, 5, 6];\n\n{\n let (left, right) = v.rsplit_array_ref::<0>();\n assert_eq!(left, &[1, 2, 3, 4, 5, 6]);\n assert_eq!(right, &[]);\n}\n\n{\n let (left, right) = v.rsplit_array_ref::<2>();\n assert_eq!(left, &[1, 2, 3, 4]);\n assert_eq!(right, &[5, 6]);\n}\n\n{\n let (left, right) = v.rsplit_array_ref::<6>();\n assert_eq!(left, &[]);\n assert_eq!(right, &[1, 2, 3, 4, 5, 6]);\n}
\nsourcepub fn rsplit_array_mut<const M: usize>(&mut self) -> (&mut [T], &mut [T; M])
🔬This is a nightly-only experimental API. (split_array)
Divides one mutable array reference into two at an index from the end.
\nThe first will contain all indices from [0, N - M) (excluding\nthe index N - M itself) and the second will contain all\nindices from [N - M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet mut v = [1, 0, 3, 0, 5, 6];\nlet (left, right) = v.rsplit_array_mut::<4>();\nassert_eq!(left, &mut [1, 0]);\nassert_eq!(right, &mut [3, 0, 5, 6][..]);\nleft[1] = 2;\nright[1] = 4;\nassert_eq!(v, [1, 2, 3, 4, 5, 6]);
\n",0,"iroh_docs::sync::PeerIdBytes"],["source§impl<const N: usize> [u8; N]
sourcepub const fn as_ascii(&self) -> Option<&[AsciiChar; N]>
🔬This is a nightly-only experimental API. (ascii_char)
Converts this array of bytes into a array of ASCII characters,\nor returns None if any of the characters is non-ASCII.
\n§Examples
\n#![feature(ascii_char)]\n#![feature(const_option)]\n\nconst HEX_DIGITS: [std::ascii::Char; 16] =\n *b\"0123456789abcdef\".as_ascii().unwrap();\n\nassert_eq!(HEX_DIGITS[1].as_str(), \"1\");\nassert_eq!(HEX_DIGITS[10].as_str(), \"a\");
\nsourcepub const unsafe fn as_ascii_unchecked(&self) -> &[AsciiChar; N]
🔬This is a nightly-only experimental API. (ascii_char)
Converts this array of bytes into a array of ASCII characters,\nwithout checking whether they’re valid.
\n§Safety
\nEvery byte in the array must be in 0..=127, or else this is UB.
\n",0,"iroh_docs::sync::PeerIdBytes"],["§impl<T> Array for [T; 32]where\n T: Default,
§fn as_slice_mut(&mut self) -> &mut [T]
Gives a unique slice over the whole thing. Read more","Array","iroh_docs::sync::PeerIdBytes"],["","Array","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> AsBytes for [T; N]where\n T: AsBytes,
§fn write_to_prefix(&self, bytes: &mut [u8]) -> Option<()>
","AsBytes","iroh_docs::sync::PeerIdBytes"],["","AsBytes","iroh_docs::sync::PeerIdBytes"],["","AsMut<[T]>","iroh_docs::sync::PeerIdBytes"],["","AsRef<[T]>","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> BitView for [T; N]where\n T: BitStore,
Note that overly-large arrays may cause the conversions to fail.
\n§fn view_bits<O>(&self) -> &BitSlice<T, O>where\n O: BitOrder,
Views a memory region as an immutable bit-slice.§fn try_view_bits<O>(&self) -> Result<&BitSlice<T, O>, BitSpanError<T>>where\n O: BitOrder,
Attempts to view a memory region as an immutable bit-slice. Read more§fn view_bits_mut<O>(&mut self) -> &mut BitSlice<T, O>where\n O: BitOrder,
Views a memory region as a mutable bit-slice.§fn try_view_bits_mut<O>(\n &mut self\n) -> Result<&mut BitSlice<T, O>, BitSpanError<T>>where\n O: BitOrder,
Attempts to view a memory region as a mutable bit-slice. Read more","BitView","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> BitViewSized for [T; N]where\n T: BitStore,
§fn as_raw_slice(&self) -> &[<[T; N] as BitView>::Store]
Views the type as a slice of its elements.§fn as_raw_mut_slice(&mut self) -> &mut [<[T; N] as BitView>::Store]
Views the type as a mutable slice of its elements.§fn into_bitarray<O>(self) -> BitArray<Self, O>where\n O: BitOrder,
Wraps self in a BitArray.","BitViewSized","iroh_docs::sync::PeerIdBytes"],["","Borrow<[T]>","iroh_docs::sync::PeerIdBytes"],["1.4.0 · source§impl<T, const N: usize> BorrowMut<[T]> for [T; N]
source§fn borrow_mut(&mut self) -> &mut [T]
Mutably borrows from an owned value. Read more","BorrowMut<[T]>","iroh_docs::sync::PeerIdBytes"],["","Chain","iroh_docs::sync::PeerIdBytes"],["","Clone","iroh_docs::sync::PeerIdBytes"],["","Debug","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize> Decode for [u8; N]
Decodes a byte array from byte[n] as described in RFC4251 § 5:
\n\nA byte represents an arbitrary 8-bit value (octet). Fixed length\ndata is sometimes represented as an array of bytes, written\nbyte[n], where n is the number of bytes in the array.
\n
\n","Decode","iroh_docs::sync::PeerIdBytes"],["§impl<'a, T, const N: usize> DecodeValue<'a> for [T; N]where\n T: Decode<'a>,
§fn decode_value<R>(reader: &mut R, header: Header) -> Result<[T; N], Error>where\n R: Reader<'a>,
Attempt to decode this message using the provided [Reader].","DecodeValue<'a>","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["source§impl<'de, T> Deserialize<'de> for [T; 32]where\n T: Deserialize<'de>,
source§fn deserialize<D>(\n deserializer: D\n) -> Result<[T; 32], <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more","Deserialize<'de>","iroh_docs::sync::PeerIdBytes"],["source§impl<'de, const N: usize> Deserialize<'de> for [u8; N]
source§fn deserialize<D>(\n deserializer: D\n) -> Result<[u8; N], <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
","Deserialize<'de>","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize> Encode for [u8; N]
Encodes [u8; N] into byte[n] as described in RFC4251 § 5:
\n\nA byte represents an arbitrary 8-bit value (octet). Fixed length\ndata is sometimes represented as an array of bytes, written\nbyte[n], where n is the number of bytes in the array.
\n
\n§fn encoded_len(&self) -> Result<usize, Error>
Get the length of this type encoded in bytes, prior to Base64 encoding.§fn encode(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value using the provided [Writer].§fn encoded_len_prefixed(&self) -> Result<usize, Error>
Return the length of this type after encoding when prepended with a\nuint32 length prefix.§fn encode_prefixed(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value, first prepending a uint32 length prefix\nset to [Encode::encoded_len].","Encode","iroh_docs::sync::PeerIdBytes"],["","EncodeLabelSet","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> EncodeValue for [T; N]where\n T: Encode,
","EncodeValue","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["§impl<'a> FindToken<&'a u8> for [u8; 32]
§fn find_token(&self, token: &u8) -> bool
Returns true if self contains the token","FindToken<&'a u8>","iroh_docs::sync::PeerIdBytes"],["§impl FindToken<u8> for [u8; 32]
§fn find_token(&self, token: u8) -> bool
Returns true if self contains the token","FindToken","iroh_docs::sync::PeerIdBytes"],["","FixedTag","iroh_docs::sync::PeerIdBytes"],["","From<&Signature>","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["§impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>>> for [T; 32]
","From, B0>, B0>, B0>, B0>, B0>>>","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["","From>","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["source§impl From<NamespaceId> for [u8; 32]
source§fn from(value: NamespaceId) -> Self
Converts to this type from the input type.","From","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["","From>","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> FromBytes for [T; N]where\n T: FromBytes,
§fn slice_from_prefix(bytes: &[u8], count: usize) -> Option<(&[Self], &[u8])>where\n Self: Sized,
Interprets the prefix of the given bytes as a &[Self] with length\nequal to count without copying. Read more§fn slice_from_suffix(bytes: &[u8], count: usize) -> Option<(&[u8], &[Self])>where\n Self: Sized,
Interprets the suffix of the given bytes as a &[Self] with length\nequal to count without copying. Read more§fn read_from_prefix(bytes: &[u8]) -> Option<Self>where\n Self: Sized,
","FromBytes","iroh_docs::sync::PeerIdBytes"],["","FromHex","iroh_docs::sync::PeerIdBytes"],["","FromZeroes","iroh_docs::sync::PeerIdBytes"],["","Hash","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Hash for [T; N]where\n T: Hash,
The hash of an array is the same as that of the corresponding slice,\nas required by the Borrow implementation.
\n\nuse std::hash::BuildHasher;\n\nlet b = std::hash::RandomState::new();\nlet a: [u8; 3] = [0xa8, 0x3c, 0x09];\nlet s: &[u8] = &[0xa8, 0x3c, 0x09];\nassert_eq!(b.hash_one(a), b.hash_one(s));
\n","Hash","iroh_docs::sync::PeerIdBytes"],["","Index","iroh_docs::sync::PeerIdBytes"],["","IndexMut","iroh_docs::sync::PeerIdBytes"],["","InputLength","iroh_docs::sync::PeerIdBytes"],["1.53.0 · source§impl<T, const N: usize> IntoIterator for [T; N]
source§fn into_iter(self) -> <[T; N] as IntoIterator>::IntoIter
Creates a consuming iterator, that is, one that moves each value out of\nthe array (from start to end). The array cannot be used after calling\nthis unless T implements Copy, so the whole array is copied.
\nArrays have special behavior when calling .into_iter() prior to the\n2021 edition – see the array Editions section for more information.
\n","IntoIterator","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize> IntoResponse for [u8; N]
§fn into_response(self) -> Response<Body>
Create a response.","IntoResponse","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, const N: usize> Join for [Fut; N]where\n Fut: IntoFuture,
§type Output = [<Fut as IntoFuture>::Output; N]
The resulting output type.§type Future = Join<<Fut as IntoFuture>::IntoFuture, N>
The Future implementation returned by this method.","Join","iroh_docs::sync::PeerIdBytes"],["","Key","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> MaxSize for [T; N]where\n T: MaxSize,
§const POSTCARD_MAX_SIZE: usize = _
The maximum possible size that the serialization of this\ntype can have, in bytes.","MaxSize","iroh_docs::sync::PeerIdBytes"],["","Merge","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Ord for [T; N]where\n T: Ord,
Implements comparison of arrays lexicographically.
\n1.21.0 · source§fn max(self, other: Self) -> Selfwhere\n Self: Sized,
Compares and returns the maximum of two values. Read more","Ord","iroh_docs::sync::PeerIdBytes"],["","PartialEq<&[U]>","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, U, const N: usize> PartialEq<&mut [U]> for [T; N]where\n T: PartialEq<U>,
","PartialEq<&mut [U]>","iroh_docs::sync::PeerIdBytes"],["","PartialEq<[U]>","iroh_docs::sync::PeerIdBytes"],["","PartialEq<[U; N]>","iroh_docs::sync::PeerIdBytes"],["","PartialEq","iroh_docs::sync::PeerIdBytes"],["§impl<A, B, const N: usize, const M: usize> PartialEq<Vec<A, N>> for [B; M]where\n A: PartialEq<B>,
","PartialEq>","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> PartialOrd for [T; N]where\n T: PartialOrd,
Implements comparison of arrays lexicographically.
\nsource§fn le(&self, other: &[T; N]) -> bool
This method tests less than or equal to (for self and other) and is used by the <=\noperator. Read more","PartialOrd","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, const N: usize> Race for [Fut; N]where\n Fut: IntoFuture,
§type Output = <Fut as IntoFuture>::Output
The resulting output type.§type Future = Race<<Fut as IntoFuture>::IntoFuture, N>
Which kind of future are we turning this into?","Race","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, T, E, const N: usize> RaceOk for [Fut; N]where\n Fut: IntoFuture<Output = Result<T, E>>,
§type Future = RaceOk<<Fut as IntoFuture>::IntoFuture, T, E, N>
Which kind of future are we turning this into?","RaceOk","iroh_docs::sync::PeerIdBytes"],["","Schema","iroh_docs::sync::PeerIdBytes"],["source§impl<T> Serialize for [T; 32]where\n T: 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","iroh_docs::sync::PeerIdBytes"],["source§impl<const N: usize> Serialize for [u8; N]
source§fn serialize<S>(\n &self,\n serializer: S\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where\n S: Serializer,
","Serialize","iroh_docs::sync::PeerIdBytes"],["1.51.0 · source§impl<T, const N: usize> SlicePattern for [T; N]
","SlicePattern","iroh_docs::sync::PeerIdBytes"],["1.34.0 · source§impl<T, const N: usize> TryFrom<&[T]> for [T; N]where\n T: Copy,
Tries to create an array [T; N] by copying from a slice &[T]. Succeeds if\nslice.len() == N.
\n\nlet bytes: [u8; 3] = [1, 0, 2];\n\nlet bytes_head: [u8; 2] = <[u8; 2]>::try_from(&bytes[0..2]).unwrap();\nassert_eq!(1, u16::from_le_bytes(bytes_head));\n\nlet bytes_tail: [u8; 2] = bytes[1..3].try_into().unwrap();\nassert_eq!(512, u16::from_le_bytes(bytes_tail));
\n§type Error = TryFromSliceError
The type returned in the event of a conversion error.","TryFrom<&[T]>","iroh_docs::sync::PeerIdBytes"],["1.59.0 · source§impl<T, const N: usize> TryFrom<&mut [T]> for [T; N]where\n T: Copy,
Tries to create an array [T; N] by copying from a mutable slice &mut [T].\nSucceeds if slice.len() == N.
\n\nlet mut bytes: [u8; 3] = [1, 0, 2];\n\nlet bytes_head: [u8; 2] = <[u8; 2]>::try_from(&mut bytes[0..2]).unwrap();\nassert_eq!(1, u16::from_le_bytes(bytes_head));\n\nlet bytes_tail: [u8; 2] = (&mut bytes[1..3]).try_into().unwrap();\nassert_eq!(512, u16::from_le_bytes(bytes_tail));
\n§type Error = TryFromSliceError
The type returned in the event of a conversion error.","TryFrom<&mut [T]>","iroh_docs::sync::PeerIdBytes"],["§impl<T, A, const N: usize> TryFrom<Vec<T, A>> for [T; N]where\n A: Allocator,
§fn try_from(vec: Vec<T, A>) -> Result<[T; N], Vec<T, A>>
Gets the entire contents of the Vec<T> as an array,\nif its size exactly matches that of the requested array.
\n§Examples
\nassert_eq!(vec![1, 2, 3].try_into(), Ok([1, 2, 3]));\nassert_eq!(<Vec<i32>>::new().try_into(), Ok([]));
\nIf the length doesn’t match, the input comes back in Err:
\n\nlet r: Result<[i32; 4], _> = (0..10).collect::<Vec<_>>().try_into();\nassert_eq!(r, Err(vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9]));
\nIf you’re fine with just getting a prefix of the Vec<T>,\nyou can call .truncate(N) first.
\n\nlet mut v = String::from(\"hello world\").into_bytes();\nv.sort();\nv.truncate(2);\nlet [a, b]: [_; 2] = v.try_into().unwrap();\nassert_eq!(a, b' ');\nassert_eq!(b, b'd');
\n","TryFrom>","iroh_docs::sync::PeerIdBytes"],["1.48.0 · source§impl<T, A, const N: usize> TryFrom<Vec<T, A>> for [T; N]where\n A: Allocator,
source§fn try_from(vec: Vec<T, A>) -> Result<[T; N], Vec<T, A>>
Gets the entire contents of the Vec<T> as an array,\nif its size exactly matches that of the requested array.
\n§Examples
\nassert_eq!(vec![1, 2, 3].try_into(), Ok([1, 2, 3]));\nassert_eq!(<Vec<i32>>::new().try_into(), Ok([]));
\nIf the length doesn’t match, the input comes back in Err:
\n\nlet r: Result<[i32; 4], _> = (0..10).collect::<Vec<_>>().try_into();\nassert_eq!(r, Err(vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9]));
\nIf you’re fine with just getting a prefix of the Vec<T>,\nyou can call .truncate(N) first.
\n\nlet mut v = String::from(\"hello world\").into_bytes();\nv.sort();\nv.truncate(2);\nlet [a, b]: [_; 2] = v.try_into().unwrap();\nassert_eq!(a, b' ');\nassert_eq!(b, b'd');
\n","TryFrom>","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, T, E, const N: usize> TryJoin for [Fut; N]where\n Fut: IntoFuture<Output = Result<T, E>>,
§type Future = TryJoin<<Fut as IntoFuture>::IntoFuture, T, E, N>
Which kind of future are we turning this into?","TryJoin","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> Value for [T; N]where\n T: Value,
§type SelfType<'a> = [<T as Value>::SelfType<'a>; N]\nwhere\n [T; N]: 'a
SelfType<’a> must be the same type as Self with all lifetimes replaced with ’a§type AsBytes<'a> = Vec<u8>\nwhere\n [T; N]: 'a
§fn fixed_width() -> Option<usize>
Width of a fixed type, or None for variable width§fn from_bytes<'a>(data: &'a [u8]) -> [<T as Value>::SelfType<'a>; N]where\n [T; N]: 'a,
Deserializes data\nImplementations may return a view over data, or an owned type","Value","iroh_docs::sync::PeerIdBytes"],["","ValueOrd","iroh_docs::sync::PeerIdBytes"],["§impl<Z, const N: usize> Zeroize for [Z; N]where\n Z: Zeroize,
Impl [Zeroize] on arrays of types that impl [Zeroize].
\n","Zeroize","iroh_docs::sync::PeerIdBytes"],["","Zip","iroh_docs::sync::PeerIdBytes"],["source§impl<T, const N: usize> ConstParamTy for [T; N]where\n T: ConstParamTy,
","ConstParamTy","iroh_docs::sync::PeerIdBytes"],["1.58.0 · source§impl<T, const N: usize> Copy for [T; N]where\n T: Copy,
","Copy","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Eq for [T; N]where\n T: Eq,
","Eq","iroh_docs::sync::PeerIdBytes"],["source§impl<T, const N: usize> StructuralPartialEq for [T; N]
","StructuralPartialEq","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> Unaligned for [T; N]where\n T: Unaligned,
","Unaligned","iroh_docs::sync::PeerIdBytes"],["§impl<Z, const N: usize> ZeroizeOnDrop for [Z; N]where\n Z: ZeroizeOnDrop,
Impl [ZeroizeOnDrop] on arrays of types that impl [ZeroizeOnDrop].
\n","ZeroizeOnDrop","iroh_docs::sync::PeerIdBytes"]]
+"iroh_docs":[["source§impl<T, const N: usize> [T; N]
1.55.0 · sourcepub fn map<F, U>(self, f: F) -> [U; N]where\n F: FnMut(T) -> U,
Returns an array of the same size as self, with function f applied to each element\nin order.
\nIf you don’t necessarily need a new fixed-size array, consider using\nIterator::map instead.
\n§Note on performance and stack usage
\nUnfortunately, usages of this method are currently not always optimized\nas well as they could be. This mainly concerns large arrays, as mapping\nover small arrays seem to be optimized just fine. Also note that in\ndebug mode (i.e. without any optimizations), this method can use a lot\nof stack space (a few times the size of the array or more).
\nTherefore, in performance-critical code, try to avoid using this method\non large arrays or check the emitted code. Also try to avoid chained\nmaps (e.g. arr.map(...).map(...)).
\nIn many cases, you can instead use Iterator::map by calling .iter()\nor .into_iter() on your array. [T; N]::map is only necessary if you\nreally need a new array of the same size as the result. Rust’s lazy\niterators tend to get optimized very well.
\n§Examples
\nlet x = [1, 2, 3];\nlet y = x.map(|v| v + 1);\nassert_eq!(y, [2, 3, 4]);\n\nlet x = [1, 2, 3];\nlet mut temp = 0;\nlet y = x.map(|v| { temp += 1; v * temp });\nassert_eq!(y, [1, 4, 9]);\n\nlet x = [\"Ferris\", \"Bueller's\", \"Day\", \"Off\"];\nlet y = x.map(|v| v.len());\nassert_eq!(y, [6, 9, 3, 3]);
\nsourcepub fn try_map<F, R>(\n self,\n f: F\n) -> <<R as Try>::Residual as Residual<[<R as Try>::Output; N]>>::TryType
🔬This is a nightly-only experimental API. (array_try_map)
A fallible function f applied to each element on array self in order to\nreturn an array the same size as self or the first error encountered.
\nThe return type of this function depends on the return type of the closure.\nIf you return Result<T, E> from the closure, you’ll get a Result<[T; N], E>.\nIf you return Option<T> from the closure, you’ll get an Option<[T; N]>.
\n§Examples
\n#![feature(array_try_map)]\n\nlet a = [\"1\", \"2\", \"3\"];\nlet b = a.try_map(|v| v.parse::<u32>()).unwrap().map(|v| v + 1);\nassert_eq!(b, [2, 3, 4]);\n\nlet a = [\"1\", \"2a\", \"3\"];\nlet b = a.try_map(|v| v.parse::<u32>());\nassert!(b.is_err());\n\nuse std::num::NonZero;\n\nlet z = [1, 2, 0, 3, 4];\nassert_eq!(z.try_map(NonZero::new), None);\n\nlet a = [1, 2, 3];\nlet b = a.try_map(NonZero::new);\nlet c = b.map(|x| x.map(NonZero::get));\nassert_eq!(c, Some(a));
\n1.57.0 (const: 1.57.0) · sourcepub const fn as_slice(&self) -> &[T]
Returns a slice containing the entire array. Equivalent to &s[..].
\n1.57.0 · sourcepub fn as_mut_slice(&mut self) -> &mut [T]
Returns a mutable slice containing the entire array. Equivalent to\n&mut s[..].
\n1.77.0 · sourcepub fn each_ref(&self) -> [&T; N]
Borrows each element and returns an array of references with the same\nsize as self.
\n§Example
\nlet floats = [3.1, 2.7, -1.0];\nlet float_refs: [&f64; 3] = floats.each_ref();\nassert_eq!(float_refs, [&3.1, &2.7, &-1.0]);
\nThis method is particularly useful if combined with other methods, like\nmap. This way, you can avoid moving the original\narray if its elements are not Copy.
\n\nlet strings = [\"Ferris\".to_string(), \"♥\".to_string(), \"Rust\".to_string()];\nlet is_ascii = strings.each_ref().map(|s| s.is_ascii());\nassert_eq!(is_ascii, [true, false, true]);\n\n// We can still access the original array: it has not been moved.\nassert_eq!(strings.len(), 3);
\n1.77.0 · sourcepub fn each_mut(&mut self) -> [&mut T; N]
Borrows each element mutably and returns an array of mutable references\nwith the same size as self.
\n§Example
\n\nlet mut floats = [3.1, 2.7, -1.0];\nlet float_refs: [&mut f64; 3] = floats.each_mut();\n*float_refs[0] = 0.0;\nassert_eq!(float_refs, [&mut 0.0, &mut 2.7, &mut -1.0]);\nassert_eq!(floats, [0.0, 2.7, -1.0]);
\nsourcepub fn split_array_ref<const M: usize>(&self) -> (&[T; M], &[T])
🔬This is a nightly-only experimental API. (split_array)
Divides one array reference into two at an index.
\nThe first will contain all indices from [0, M) (excluding\nthe index M itself) and the second will contain all\nindices from [M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet v = [1, 2, 3, 4, 5, 6];\n\n{\n let (left, right) = v.split_array_ref::<0>();\n assert_eq!(left, &[]);\n assert_eq!(right, &[1, 2, 3, 4, 5, 6]);\n}\n\n{\n let (left, right) = v.split_array_ref::<2>();\n assert_eq!(left, &[1, 2]);\n assert_eq!(right, &[3, 4, 5, 6]);\n}\n\n{\n let (left, right) = v.split_array_ref::<6>();\n assert_eq!(left, &[1, 2, 3, 4, 5, 6]);\n assert_eq!(right, &[]);\n}
\nsourcepub fn split_array_mut<const M: usize>(&mut self) -> (&mut [T; M], &mut [T])
🔬This is a nightly-only experimental API. (split_array)
Divides one mutable array reference into two at an index.
\nThe first will contain all indices from [0, M) (excluding\nthe index M itself) and the second will contain all\nindices from [M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet mut v = [1, 0, 3, 0, 5, 6];\nlet (left, right) = v.split_array_mut::<2>();\nassert_eq!(left, &mut [1, 0][..]);\nassert_eq!(right, &mut [3, 0, 5, 6]);\nleft[1] = 2;\nright[1] = 4;\nassert_eq!(v, [1, 2, 3, 4, 5, 6]);
\nsourcepub fn rsplit_array_ref<const M: usize>(&self) -> (&[T], &[T; M])
🔬This is a nightly-only experimental API. (split_array)
Divides one array reference into two at an index from the end.
\nThe first will contain all indices from [0, N - M) (excluding\nthe index N - M itself) and the second will contain all\nindices from [N - M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet v = [1, 2, 3, 4, 5, 6];\n\n{\n let (left, right) = v.rsplit_array_ref::<0>();\n assert_eq!(left, &[1, 2, 3, 4, 5, 6]);\n assert_eq!(right, &[]);\n}\n\n{\n let (left, right) = v.rsplit_array_ref::<2>();\n assert_eq!(left, &[1, 2, 3, 4]);\n assert_eq!(right, &[5, 6]);\n}\n\n{\n let (left, right) = v.rsplit_array_ref::<6>();\n assert_eq!(left, &[]);\n assert_eq!(right, &[1, 2, 3, 4, 5, 6]);\n}
\nsourcepub fn rsplit_array_mut<const M: usize>(&mut self) -> (&mut [T], &mut [T; M])
🔬This is a nightly-only experimental API. (split_array)
Divides one mutable array reference into two at an index from the end.
\nThe first will contain all indices from [0, N - M) (excluding\nthe index N - M itself) and the second will contain all\nindices from [N - M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet mut v = [1, 0, 3, 0, 5, 6];\nlet (left, right) = v.rsplit_array_mut::<4>();\nassert_eq!(left, &mut [1, 0]);\nassert_eq!(right, &mut [3, 0, 5, 6][..]);\nleft[1] = 2;\nright[1] = 4;\nassert_eq!(v, [1, 2, 3, 4, 5, 6]);
\n",0,"iroh_docs::sync::PeerIdBytes"],["source§impl<const N: usize> [u8; N]
sourcepub const fn as_ascii(&self) -> Option<&[AsciiChar; N]>
🔬This is a nightly-only experimental API. (ascii_char)
Converts this array of bytes into a array of ASCII characters,\nor returns None if any of the characters is non-ASCII.
\n§Examples
\n#![feature(ascii_char)]\n#![feature(const_option)]\n\nconst HEX_DIGITS: [std::ascii::Char; 16] =\n *b\"0123456789abcdef\".as_ascii().unwrap();\n\nassert_eq!(HEX_DIGITS[1].as_str(), \"1\");\nassert_eq!(HEX_DIGITS[10].as_str(), \"a\");
\nsourcepub const unsafe fn as_ascii_unchecked(&self) -> &[AsciiChar; N]
🔬This is a nightly-only experimental API. (ascii_char)
Converts this array of bytes into a array of ASCII characters,\nwithout checking whether they’re valid.
\n§Safety
\nEvery byte in the array must be in 0..=127, or else this is UB.
\n",0,"iroh_docs::sync::PeerIdBytes"],["§impl<T> Array for [T; 32]where\n T: Default,
§fn as_slice_mut(&mut self) -> &mut [T]
Gives a unique slice over the whole thing. Read more","Array","iroh_docs::sync::PeerIdBytes"],["","Array","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> AsBytes for [T; N]where\n T: AsBytes,
§fn write_to_prefix(&self, bytes: &mut [u8]) -> Option<()>
","AsBytes","iroh_docs::sync::PeerIdBytes"],["","AsBytes","iroh_docs::sync::PeerIdBytes"],["","AsMut<[T]>","iroh_docs::sync::PeerIdBytes"],["","AsRef<[T]>","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> BitView for [T; N]where\n T: BitStore,
Note that overly-large arrays may cause the conversions to fail.
\n§fn view_bits<O>(&self) -> &BitSlice<T, O>where\n O: BitOrder,
Views a memory region as an immutable bit-slice.§fn try_view_bits<O>(&self) -> Result<&BitSlice<T, O>, BitSpanError<T>>where\n O: BitOrder,
Attempts to view a memory region as an immutable bit-slice. Read more§fn view_bits_mut<O>(&mut self) -> &mut BitSlice<T, O>where\n O: BitOrder,
Views a memory region as a mutable bit-slice.§fn try_view_bits_mut<O>(\n &mut self\n) -> Result<&mut BitSlice<T, O>, BitSpanError<T>>where\n O: BitOrder,
Attempts to view a memory region as a mutable bit-slice. Read more","BitView","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> BitViewSized for [T; N]where\n T: BitStore,
§fn as_raw_slice(&self) -> &[<[T; N] as BitView>::Store]
Views the type as a slice of its elements.§fn as_raw_mut_slice(&mut self) -> &mut [<[T; N] as BitView>::Store]
Views the type as a mutable slice of its elements.§fn into_bitarray<O>(self) -> BitArray<Self, O>where\n O: BitOrder,
Wraps self in a BitArray.","BitViewSized","iroh_docs::sync::PeerIdBytes"],["","Borrow<[T]>","iroh_docs::sync::PeerIdBytes"],["1.4.0 · source§impl<T, const N: usize> BorrowMut<[T]> for [T; N]
source§fn borrow_mut(&mut self) -> &mut [T]
Mutably borrows from an owned value. Read more","BorrowMut<[T]>","iroh_docs::sync::PeerIdBytes"],["","Chain","iroh_docs::sync::PeerIdBytes"],["","Clone","iroh_docs::sync::PeerIdBytes"],["","Debug","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize> Decode for [u8; N]
Decodes a byte array from byte[n] as described in RFC4251 § 5:
\n\nA byte represents an arbitrary 8-bit value (octet). Fixed length\ndata is sometimes represented as an array of bytes, written\nbyte[n], where n is the number of bytes in the array.
\n
\n","Decode","iroh_docs::sync::PeerIdBytes"],["§impl<'a, T, const N: usize> DecodeValue<'a> for [T; N]where\n T: Decode<'a>,
§fn decode_value<R>(reader: &mut R, header: Header) -> Result<[T; N], Error>where\n R: Reader<'a>,
Attempt to decode this message using the provided [Reader].","DecodeValue<'a>","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["source§impl<'de, T> Deserialize<'de> for [T; 32]where\n T: Deserialize<'de>,
source§fn deserialize<D>(\n deserializer: D\n) -> Result<[T; 32], <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more","Deserialize<'de>","iroh_docs::sync::PeerIdBytes"],["source§impl<'de, const N: usize> Deserialize<'de> for [u8; N]
source§fn deserialize<D>(\n deserializer: D\n) -> Result<[u8; N], <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
","Deserialize<'de>","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize> Encode for [u8; N]
Encodes [u8; N] into byte[n] as described in RFC4251 § 5:
\n\nA byte represents an arbitrary 8-bit value (octet). Fixed length\ndata is sometimes represented as an array of bytes, written\nbyte[n], where n is the number of bytes in the array.
\n
\n§fn encoded_len(&self) -> Result<usize, Error>
Get the length of this type encoded in bytes, prior to Base64 encoding.§fn encode(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value using the provided [Writer].§fn encoded_len_prefixed(&self) -> Result<usize, Error>
Return the length of this type after encoding when prepended with a\nuint32 length prefix.§fn encode_prefixed(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value, first prepending a uint32 length prefix\nset to [Encode::encoded_len].","Encode","iroh_docs::sync::PeerIdBytes"],["","EncodeLabelSet","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> EncodeValue for [T; N]where\n T: Encode,
","EncodeValue","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["§impl<'a> FindToken<&'a u8> for [u8; 32]
§fn find_token(&self, token: &u8) -> bool
Returns true if self contains the token","FindToken<&'a u8>","iroh_docs::sync::PeerIdBytes"],["§impl FindToken<u8> for [u8; 32]
§fn find_token(&self, token: u8) -> bool
Returns true if self contains the token","FindToken","iroh_docs::sync::PeerIdBytes"],["","FixedTag","iroh_docs::sync::PeerIdBytes"],["","From<&Signature>","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["§impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>>> for [T; 32]
","From, B0>, B0>, B0>, B0>, B0>>>","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["","From>","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["source§impl From<NamespaceId> for [u8; 32]
source§fn from(value: NamespaceId) -> Self
Converts to this type from the input type.","From","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["","From>","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> FromBytes for [T; N]where\n T: FromBytes,
§fn slice_from_prefix(bytes: &[u8], count: usize) -> Option<(&[Self], &[u8])>where\n Self: Sized,
Interprets the prefix of the given bytes as a &[Self] with length\nequal to count without copying. Read more§fn slice_from_suffix(bytes: &[u8], count: usize) -> Option<(&[u8], &[Self])>where\n Self: Sized,
Interprets the suffix of the given bytes as a &[Self] with length\nequal to count without copying. Read more§fn read_from_prefix(bytes: &[u8]) -> Option<Self>where\n Self: Sized,
","FromBytes","iroh_docs::sync::PeerIdBytes"],["","FromHex","iroh_docs::sync::PeerIdBytes"],["","FromZeroes","iroh_docs::sync::PeerIdBytes"],["","Hash","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Hash for [T; N]where\n T: Hash,
The hash of an array is the same as that of the corresponding slice,\nas required by the Borrow implementation.
\n\nuse std::hash::BuildHasher;\n\nlet b = std::hash::RandomState::new();\nlet a: [u8; 3] = [0xa8, 0x3c, 0x09];\nlet s: &[u8] = &[0xa8, 0x3c, 0x09];\nassert_eq!(b.hash_one(a), b.hash_one(s));
\n","Hash","iroh_docs::sync::PeerIdBytes"],["","Index","iroh_docs::sync::PeerIdBytes"],["","IndexMut","iroh_docs::sync::PeerIdBytes"],["","InputLength","iroh_docs::sync::PeerIdBytes"],["1.53.0 · source§impl<T, const N: usize> IntoIterator for [T; N]
source§fn into_iter(self) -> <[T; N] as IntoIterator>::IntoIter
Creates a consuming iterator, that is, one that moves each value out of\nthe array (from start to end). The array cannot be used after calling\nthis unless T implements Copy, so the whole array is copied.
\nArrays have special behavior when calling .into_iter() prior to the\n2021 edition – see the array Editions section for more information.
\n","IntoIterator","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize> IntoResponse for [u8; N]
§fn into_response(self) -> Response<Body>
Create a response.","IntoResponse","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, const N: usize> Join for [Fut; N]where\n Fut: IntoFuture,
§type Output = [<Fut as IntoFuture>::Output; N]
The resulting output type.§type Future = Join<<Fut as IntoFuture>::IntoFuture, N>
The Future implementation returned by this method.","Join","iroh_docs::sync::PeerIdBytes"],["","Key","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> MaxSize for [T; N]where\n T: MaxSize,
§const POSTCARD_MAX_SIZE: usize = _
The maximum possible size that the serialization of this\ntype can have, in bytes.","MaxSize","iroh_docs::sync::PeerIdBytes"],["","Merge","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Ord for [T; N]where\n T: Ord,
Implements comparison of arrays lexicographically.
\n1.21.0 · source§fn max(self, other: Self) -> Selfwhere\n Self: Sized,
Compares and returns the maximum of two values. Read more","Ord","iroh_docs::sync::PeerIdBytes"],["","PartialEq<&[U]>","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, U, const N: usize> PartialEq<&mut [U]> for [T; N]where\n T: PartialEq<U>,
","PartialEq<&mut [U]>","iroh_docs::sync::PeerIdBytes"],["","PartialEq<[U]>","iroh_docs::sync::PeerIdBytes"],["","PartialEq<[U; N]>","iroh_docs::sync::PeerIdBytes"],["","PartialEq","iroh_docs::sync::PeerIdBytes"],["§impl<A, B, const N: usize, const M: usize> PartialEq<Vec<A, N>> for [B; M]where\n A: PartialEq<B>,
","PartialEq>","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> PartialOrd for [T; N]where\n T: PartialOrd,
Implements comparison of arrays lexicographically.
\nsource§fn le(&self, other: &[T; N]) -> bool
This method tests less than or equal to (for self and other) and is used by the <=\noperator. Read more","PartialOrd","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, const N: usize> Race for [Fut; N]where\n Fut: IntoFuture,
§type Output = <Fut as IntoFuture>::Output
The resulting output type.§type Future = Race<<Fut as IntoFuture>::IntoFuture, N>
Which kind of future are we turning this into?","Race","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, T, E, const N: usize> RaceOk for [Fut; N]where\n Fut: IntoFuture<Output = Result<T, E>>,
§type Future = RaceOk<<Fut as IntoFuture>::IntoFuture, T, E, N>
Which kind of future are we turning this into?","RaceOk","iroh_docs::sync::PeerIdBytes"],["","Schema","iroh_docs::sync::PeerIdBytes"],["source§impl<T> Serialize for [T; 32]where\n T: 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","iroh_docs::sync::PeerIdBytes"],["source§impl<const N: usize> Serialize for [u8; N]
source§fn serialize<S>(\n &self,\n serializer: S\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where\n S: Serializer,
","Serialize","iroh_docs::sync::PeerIdBytes"],["1.51.0 · source§impl<T, const N: usize> SlicePattern for [T; N]
","SlicePattern","iroh_docs::sync::PeerIdBytes"],["1.34.0 · source§impl<T, const N: usize> TryFrom<&[T]> for [T; N]where\n T: Copy,
Tries to create an array [T; N] by copying from a slice &[T]. Succeeds if\nslice.len() == N.
\n\nlet bytes: [u8; 3] = [1, 0, 2];\n\nlet bytes_head: [u8; 2] = <[u8; 2]>::try_from(&bytes[0..2]).unwrap();\nassert_eq!(1, u16::from_le_bytes(bytes_head));\n\nlet bytes_tail: [u8; 2] = bytes[1..3].try_into().unwrap();\nassert_eq!(512, u16::from_le_bytes(bytes_tail));
\n§type Error = TryFromSliceError
The type returned in the event of a conversion error.","TryFrom<&[T]>","iroh_docs::sync::PeerIdBytes"],["1.59.0 · source§impl<T, const N: usize> TryFrom<&mut [T]> for [T; N]where\n T: Copy,
Tries to create an array [T; N] by copying from a mutable slice &mut [T].\nSucceeds if slice.len() == N.
\n\nlet mut bytes: [u8; 3] = [1, 0, 2];\n\nlet bytes_head: [u8; 2] = <[u8; 2]>::try_from(&mut bytes[0..2]).unwrap();\nassert_eq!(1, u16::from_le_bytes(bytes_head));\n\nlet bytes_tail: [u8; 2] = (&mut bytes[1..3]).try_into().unwrap();\nassert_eq!(512, u16::from_le_bytes(bytes_tail));
\n§type Error = TryFromSliceError
The type returned in the event of a conversion error.","TryFrom<&mut [T]>","iroh_docs::sync::PeerIdBytes"],["§impl<T, A, const N: usize> TryFrom<Vec<T, A>> for [T; N]where\n A: Allocator,
§fn try_from(vec: Vec<T, A>) -> Result<[T; N], Vec<T, A>>
Gets the entire contents of the Vec<T> as an array,\nif its size exactly matches that of the requested array.
\n§Examples
\nassert_eq!(vec![1, 2, 3].try_into(), Ok([1, 2, 3]));\nassert_eq!(<Vec<i32>>::new().try_into(), Ok([]));
\nIf the length doesn’t match, the input comes back in Err:
\n\nlet r: Result<[i32; 4], _> = (0..10).collect::<Vec<_>>().try_into();\nassert_eq!(r, Err(vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9]));
\nIf you’re fine with just getting a prefix of the Vec<T>,\nyou can call .truncate(N) first.
\n\nlet mut v = String::from(\"hello world\").into_bytes();\nv.sort();\nv.truncate(2);\nlet [a, b]: [_; 2] = v.try_into().unwrap();\nassert_eq!(a, b' ');\nassert_eq!(b, b'd');
\n","TryFrom>","iroh_docs::sync::PeerIdBytes"],["1.48.0 · source§impl<T, A, const N: usize> TryFrom<Vec<T, A>> for [T; N]where\n A: Allocator,
source§fn try_from(vec: Vec<T, A>) -> Result<[T; N], Vec<T, A>>
Gets the entire contents of the Vec<T> as an array,\nif its size exactly matches that of the requested array.
\n§Examples
\nassert_eq!(vec![1, 2, 3].try_into(), Ok([1, 2, 3]));\nassert_eq!(<Vec<i32>>::new().try_into(), Ok([]));
\nIf the length doesn’t match, the input comes back in Err:
\n\nlet r: Result<[i32; 4], _> = (0..10).collect::<Vec<_>>().try_into();\nassert_eq!(r, Err(vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9]));
\nIf you’re fine with just getting a prefix of the Vec<T>,\nyou can call .truncate(N) first.
\n\nlet mut v = String::from(\"hello world\").into_bytes();\nv.sort();\nv.truncate(2);\nlet [a, b]: [_; 2] = v.try_into().unwrap();\nassert_eq!(a, b' ');\nassert_eq!(b, b'd');
\n","TryFrom>","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, T, E, const N: usize> TryJoin for [Fut; N]where\n Fut: IntoFuture<Output = Result<T, E>>,
§type Future = TryJoin<<Fut as IntoFuture>::IntoFuture, T, E, N>
Which kind of future are we turning this into?","TryJoin","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> Value for [T; N]where\n T: Value,
§type SelfType<'a> = [<T as Value>::SelfType<'a>; N]\nwhere\n [T; N]: 'a
SelfType<’a> must be the same type as Self with all lifetimes replaced with ’a§type AsBytes<'a> = Vec<u8>\nwhere\n [T; N]: 'a
§fn fixed_width() -> Option<usize>
Width of a fixed type, or None for variable width§fn from_bytes<'a>(data: &'a [u8]) -> [<T as Value>::SelfType<'a>; N]where\n [T; N]: 'a,
Deserializes data\nImplementations may return a view over data, or an owned type","Value","iroh_docs::sync::PeerIdBytes"],["","ValueOrd","iroh_docs::sync::PeerIdBytes"],["§impl<Z, const N: usize> Zeroize for [Z; N]where\n Z: Zeroize,
Impl [Zeroize] on arrays of types that impl [Zeroize].
\n","Zeroize","iroh_docs::sync::PeerIdBytes"],["","Zip","iroh_docs::sync::PeerIdBytes"],["source§impl<T, const N: usize> ConstParamTy for [T; N]where\n T: ConstParamTy,
","ConstParamTy","iroh_docs::sync::PeerIdBytes"],["1.58.0 · source§impl<T, const N: usize> Copy for [T; N]where\n T: Copy,
","Copy","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Eq for [T; N]where\n T: Eq,
","Eq","iroh_docs::sync::PeerIdBytes"],["source§impl<T, const N: usize> StructuralPartialEq for [T; N]
","StructuralPartialEq","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> Unaligned for [T; N]where\n T: Unaligned,
","Unaligned","iroh_docs::sync::PeerIdBytes"],["§impl<Z, const N: usize> ZeroizeOnDrop for [Z; N]where\n Z: ZeroizeOnDrop,
Impl [ZeroizeOnDrop] on arrays of types that impl [ZeroizeOnDrop].
\n","ZeroizeOnDrop","iroh_docs::sync::PeerIdBytes"]]
};if (window.register_type_impls) {window.register_type_impls(type_impls);} else {window.pending_type_impls = type_impls;}})()
\ No newline at end of file
Expand description
Progress updates for the get operation.
Variants§
InitialState(TransferState)
Initial state if subscribing to a running or queued transfer.
FoundLocal
Data was found locally.
@@ -51,7 +51,7 @@ allows to identify the children by their offset in the hashseq.AllDone(Stats)
All operations finished.
This will be the last message in the stream.
-Abort(RpcError)
We got an error and need to abort.
+Abort(RpcError)
We got an error and need to abort.
This will be the last message in the stream.
Trait Implementations§
source§impl Clone for DownloadProgress
impl Clone for DownloadProgress
source§fn clone(&self) -> DownloadProgress
fn clone(&self) -> DownloadProgress
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Debug for DownloadProgress
impl Debug for DownloadProgress
source§impl<'de> Deserialize<'de> for DownloadProgress
impl<'de> Deserialize<'de> for DownloadProgress
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
source§impl Serialize for DownloadProgress
impl Serialize for DownloadProgress
source§fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where
diff --git a/pr/2595/docs/iroh_blobs/provider/enum.AddProgress.html b/pr/2595/docs/iroh_blobs/provider/enum.AddProgress.html
index f66b9300f3..c70929bdee 100644
--- a/pr/2595/docs/iroh_blobs/provider/enum.AddProgress.html
+++ b/pr/2595/docs/iroh_blobs/provider/enum.AddProgress.html
@@ -17,7 +17,7 @@
format: BlobFormat,
tag: Tag,
},
- Abort(RpcError),
+ Abort(RpcError),
}Expand description
Progress updates for the add operation.
Variants§
§Found
An item was found with name name, from now on referred to via id
Fields
§Abort(RpcError)
We got an error and need to abort.
This will be the last message in the stream.
Trait Implementations§
source§impl Debug for AddProgress
source§impl<'de> Deserialize<'de> for AddProgress
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl Serialize for AddProgress
source§fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where
diff --git a/pr/2595/docs/iroh_blobs/store/enum.ConsistencyCheckProgress.html b/pr/2595/docs/iroh_blobs/store/enum.ConsistencyCheckProgress.html
index ad14d9476a..46469fe5e2 100644
--- a/pr/2595/docs/iroh_blobs/store/enum.ConsistencyCheckProgress.html
+++ b/pr/2595/docs/iroh_blobs/store/enum.ConsistencyCheckProgress.html
@@ -6,7 +6,7 @@
level: ReportLevel,
},
Done,
- Abort(RpcError),
+ Abort(RpcError),
}Expand description
Progress updates for the validate operation
Variants§
§level: ReportLevelThe level of the message
§Done
Consistency check ended
-§Abort(RpcError)
We got an error and need to abort.
+§Abort(RpcError)
We got an error and need to abort.
Trait Implementations§
source§impl Debug for ConsistencyCheckProgress
source§impl<'de> Deserialize<'de> for ConsistencyCheckProgress
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreAuto Trait Implementations§
§impl Freeze for ConsistencyCheckProgress
§impl RefUnwindSafe for ConsistencyCheckProgress
§impl Send for ConsistencyCheckProgress
§impl Sync for ConsistencyCheckProgress
§impl Unpin for ConsistencyCheckProgress
§impl UnwindSafe for ConsistencyCheckProgress
Blanket Implementations§
source§impl<T> Any for Twhere
diff --git a/pr/2595/docs/iroh_blobs/store/enum.ValidateProgress.html b/pr/2595/docs/iroh_blobs/store/enum.ValidateProgress.html
index 76a8f01e97..f4494f3a46 100644
--- a/pr/2595/docs/iroh_blobs/store/enum.ValidateProgress.html
+++ b/pr/2595/docs/iroh_blobs/store/enum.ValidateProgress.html
@@ -31,7 +31,7 @@
ranges: RangeSpec,
},
AllDone,
- Abort(RpcError),
+ Abort(RpcError),
}Expand description
Progress updates for the validate operation
Variants§
§Starting
started validating
Fields
§total: u64The total number of entries to validate
@@ -62,7 +62,7 @@ Otherwise it might be an url or something else to uniquely identify the entry.
§AllDone
We are done with the whole operation.
-§Abort(RpcError)
We got an error and need to abort.
+§Abort(RpcError)
We got an error and need to abort.
Trait Implementations§
source§impl Debug for ValidateProgress
source§impl<'de> Deserialize<'de> for ValidateProgress
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreAuto Trait Implementations§
§impl Freeze for ValidateProgress
§impl RefUnwindSafe for ValidateProgress
§impl Send for ValidateProgress
§impl Sync for ValidateProgress
§impl Unpin for ValidateProgress
§impl UnwindSafe for ValidateProgress
Blanket Implementations§
source§impl<T> Any for Twhere
diff --git a/pr/2595/docs/iroh_blobs/struct.Hash.html b/pr/2595/docs/iroh_blobs/struct.Hash.html
index 260e50d4b9..ba12d52876 100644
--- a/pr/2595/docs/iroh_blobs/struct.Hash.html
+++ b/pr/2595/docs/iroh_blobs/struct.Hash.html
@@ -1,36 +1,36 @@
-Hash in iroh_blobs - Rust Struct iroh_blobs::Hash
pub struct Hash(/* private fields */);
Expand description
Hash type used throughout.
-Implementations§
§impl Hash
pub const fn from_bytes(bytes: [u8; 32]) -> Hash
Create a Hash from its raw bytes representation.
-pub fn fmt_short(&self) -> String
Convert to a base32 string limited to the first 10 bytes for a friendly string
+
Hash in iroh_blobs - Rust Struct iroh_blobs::Hash
source · pub struct Hash(/* private fields */);
Expand description
Hash type used throughout.
+Implementations§
Trait Implementations§
Trait Implementations§
source§impl<'de> Deserialize<'de> for Hash
source§fn deserialize<D>(
deserializer: D
) -> Result<Hash, <D as Deserializer<'de>>::Error>where
- D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl FromIterator<Hash> for HashSeq
§impl Hash for Hash
§fn hash<__H>(&self, state: &mut __H)where
+ D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl FromIterator<Hash> for HashSeq
§impl MaxSize for Hash
§const POSTCARD_MAX_SIZE: usize = 32usize
The maximum possible size that the serialization of this
-type can have, in bytes.source§impl MaxSize for Hash
source§const POSTCARD_MAX_SIZE: usize = 32usize
The maximum possible size that the serialization of this
+type can have, in bytes.source§impl Ord for Hash
source§impl PartialEq for Hash
§impl PartialOrd for Hash
source§impl PartialOrd for Hash
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 <=
operator. Read moresource§impl Serialize for Hash
source§fn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
- S: Serializer,
Serialize this value into the given Serde serializer. Read more§impl Value for Hash
§type SelfType<'a> = Hash
SelfType<’a> must be the same type as Self with all lifetimes replaced with ’a§type AsBytes<'a> = &'a [u8; 32]
§fn fixed_width() -> Option<usize>
Width of a fixed type, or None for variable width§fn from_bytes<'a>(data: &'a [u8]) -> <Hash as Value>::SelfType<'a>where
+ S: Serializer,
Serialize this value into the given Serde serializer. Read moresource§impl Value for Hash
§type SelfType<'a> = Hash
SelfType<’a> must be the same type as Self with all lifetimes replaced with ’a§type AsBytes<'a> = &'a [u8; 32]
source§fn fixed_width() -> Option<usize>
Width of a fixed type, or None for variable width§impl Copy for Hash
§impl Eq for Hash
§impl StructuralPartialEq for Hash
Auto Trait Implementations§
§impl Freeze for Hash
§impl RefUnwindSafe for Hash
§impl Send for Hash
§impl Sync for Hash
§impl Unpin for Hash
§impl UnwindSafe for Hash
Blanket Implementations§
source§impl Copy for Hash
source§impl Eq for Hash
source§impl StructuralPartialEq for Hash
Auto Trait Implementations§
§impl Freeze for Hash
§impl RefUnwindSafe for Hash
§impl Send for Hash
§impl Sync for Hash
§impl Unpin for Hash
§impl UnwindSafe for Hash
Blanket Implementations§
§impl<A, T> AsBits<T> for A
§fn as_bits<O>(&self) -> &BitSlice<T, O>where
diff --git a/pr/2595/docs/iroh_blobs/struct.HashAndFormat.html b/pr/2595/docs/iroh_blobs/struct.HashAndFormat.html
index 8eb7ba64d5..421c7e1439 100644
--- a/pr/2595/docs/iroh_blobs/struct.HashAndFormat.html
+++ b/pr/2595/docs/iroh_blobs/struct.HashAndFormat.html
@@ -1,37 +1,37 @@
-HashAndFormat in iroh_blobs - Rust Struct iroh_blobs::HashAndFormat
pub struct HashAndFormat {
+HashAndFormat in iroh_blobs - Rust Struct iroh_blobs::HashAndFormat
source · pub struct HashAndFormat {
pub hash: Hash,
pub format: BlobFormat,
}
Expand description
A hash and format pair
Fields§
§hash: HashThe hash
§format: BlobFormatThe format
-Implementations§
§impl HashAndFormat
pub fn new(hash: Hash, format: BlobFormat) -> HashAndFormat
Create a new hash and format pair.
-pub fn raw(hash: Hash) -> HashAndFormat
Create a new hash and format pair, using the default (raw) format.
-pub fn hash_seq(hash: Hash) -> HashAndFormat
Create a new hash and format pair, using the collection format.
-Trait Implementations§
§impl Clone for HashAndFormat
§fn clone(&self) -> HashAndFormat
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more§impl Debug for HashAndFormat
§impl<'de> Deserialize<'de> for HashAndFormat
§fn deserialize<D>(
+
Implementations§
source§impl HashAndFormat
sourcepub fn new(hash: Hash, format: BlobFormat) -> HashAndFormat
Create a new hash and format pair.
+sourcepub fn raw(hash: Hash) -> HashAndFormat
Create a new hash and format pair, using the default (raw) format.
+sourcepub fn hash_seq(hash: Hash) -> HashAndFormat
Create a new hash and format pair, using the collection format.
+Trait Implementations§
source§impl Clone for HashAndFormat
source§fn clone(&self) -> HashAndFormat
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moresource§impl Debug for HashAndFormat
source§impl<'de> Deserialize<'de> for HashAndFormat
source§fn deserialize<D>(
deserializer: D
) -> Result<HashAndFormat, <D as Deserializer<'de>>::Error>where
- D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more§impl Display for HashAndFormat
source§impl From<DownloadKind> for HashAndFormat
source§fn from(value: DownloadKind) -> Self
Converts to this type from the input type.source§impl From<HashAndFormat> for DownloadKind
source§fn from(value: HashAndFormat) -> Self
Converts to this type from the input type.§impl FromStr for HashAndFormat
§impl Hash for HashAndFormat
§fn hash<__H>(&self, state: &mut __H)where
+ D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl Display for HashAndFormat
source§impl From<DownloadKind> for HashAndFormat
source§fn from(value: DownloadKind) -> Self
Converts to this type from the input type.source§impl From<HashAndFormat> for DownloadKind
source§fn from(value: HashAndFormat) -> Self
Converts to this type from the input type.source§impl FromStr for HashAndFormat
source§impl Hash for HashAndFormat
§impl MaxSize for HashAndFormat
§const POSTCARD_MAX_SIZE: usize = 33usize
The maximum possible size that the serialization of this
-type can have, in bytes.§impl Ord for HashAndFormat
source§impl MaxSize for HashAndFormat
source§const POSTCARD_MAX_SIZE: usize = 33usize
The maximum possible size that the serialization of this
+type can have, in bytes.source§impl Ord for HashAndFormat
source§fn cmp(&self, other: &HashAndFormat) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more§impl PartialEq for HashAndFormat
§fn eq(&self, other: &HashAndFormat) -> bool
Restrict a value to a certain interval. Read moresource§impl PartialEq for HashAndFormat
source§fn eq(&self, other: &HashAndFormat) -> bool
This method tests for self and other values to be equal, and is used
by ==.§impl PartialOrd for HashAndFormat
§fn partial_cmp(&self, other: &HashAndFormat) -> Option<Ordering>
source§impl PartialOrd for HashAndFormat
source§fn partial_cmp(&self, other: &HashAndFormat) -> Option<Ordering>
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 <=
operator. Read moresource§impl Serialize for HashAndFormat
source§fn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
- S: Serializer,
Serialize this value into the given Serde serializer. Read more§impl Value for HashAndFormat
§type SelfType<'a> = HashAndFormat
SelfType<’a> must be the same type as Self with all lifetimes replaced with ’a§type AsBytes<'a> = [u8; 33]
§fn fixed_width() -> Option<usize>
Width of a fixed type, or None for variable width§fn from_bytes<'a>(data: &'a [u8]) -> <HashAndFormat as Value>::SelfType<'a>where
+ S: Serializer,
Serialize this value into the given Serde serializer. Read moresource§impl Value for HashAndFormat
§type SelfType<'a> = HashAndFormat
SelfType<’a> must be the same type as Self with all lifetimes replaced with ’a§type AsBytes<'a> = [u8; 33]
source§fn fixed_width() -> Option<usize>
Width of a fixed type, or None for variable widthsource§fn from_bytes<'a>(data: &'a [u8]) -> <HashAndFormat as Value>::SelfType<'a>where
HashAndFormat: 'a,
Deserializes data
-Implementations may return a view over data, or an owned typesource§fn as_bytes<'a, 'b>(
value: &'a <HashAndFormat as Value>::SelfType<'b>
) -> <HashAndFormat as Value>::AsBytes<'a>where
'b: 'a,
- HashAndFormat: 'a + 'b,
Serialize the value to a slice§impl Copy for HashAndFormat
§impl Eq for HashAndFormat
§impl StructuralPartialEq for HashAndFormat
Auto Trait Implementations§
§impl Freeze for HashAndFormat
§impl RefUnwindSafe for HashAndFormat
§impl Send for HashAndFormat
§impl Sync for HashAndFormat
§impl Unpin for HashAndFormat
§impl UnwindSafe for HashAndFormat
Blanket Implementations§
source§impl<T> Any for Twhere
+ HashAndFormat: 'a + 'b,
Serialize the value to a slicesource§impl Copy for HashAndFormat
source§impl Eq for HashAndFormat
source§impl StructuralPartialEq for HashAndFormat
Auto Trait Implementations§
§impl Freeze for HashAndFormat
§impl RefUnwindSafe for HashAndFormat
§impl Send for HashAndFormat
§impl Sync for HashAndFormat
§impl Unpin for HashAndFormat
§impl UnwindSafe for HashAndFormat
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
diff --git a/pr/2595/docs/iroh_docs/actor/struct.SyncHandle.html b/pr/2595/docs/iroh_docs/actor/struct.SyncHandle.html
index cfd29c2ce8..6c70a0ff39 100644
--- a/pr/2595/docs/iroh_docs/actor/struct.SyncHandle.html
+++ b/pr/2595/docs/iroh_docs/actor/struct.SyncHandle.html
@@ -26,7 +26,7 @@ waiting for the actor to finish happens in an async context, and therefore that
namespace: NamespaceId,
author: AuthorId,
key: Bytes,
- hash: Hash,
+ hash: Hash,
len: u64
) -> Result<()>sourcepub async fn delete_prefix(
&self,
diff --git a/pr/2595/docs/iroh_docs/engine/enum.LiveEvent.html b/pr/2595/docs/iroh_docs/engine/enum.LiveEvent.html
index ceb8545b50..f0d33bcb21 100644
--- a/pr/2595/docs/iroh_docs/engine/enum.LiveEvent.html
+++ b/pr/2595/docs/iroh_docs/engine/enum.LiveEvent.html
@@ -3,34 +3,34 @@
entry: Entry,
},
InsertRemote {
- from: PublicKey,
+ from: PublicKey,
entry: Entry,
content_status: ContentStatus,
},
ContentReady {
- hash: Hash,
+ hash: Hash,
},
PendingContentReady,
- NeighborUp(PublicKey),
- NeighborDown(PublicKey),
+ NeighborUp(PublicKey),
+ NeighborDown(PublicKey),
SyncFinished(SyncEvent),
}Expand description
Events informing about actions of the live sync progress.
Variants§
§InsertLocal
A local insertion.
§InsertRemote
Received a remote insert.
-Fields
§from: PublicKeyThe peer that sent us the entry.
+Fields
§content_status: ContentStatusIf the content is available at the local node
§ContentReady
The content of an entry was downloaded and is now available at the local node
-Fields
§hash: HashThe content hash of the newly available entry content
+§PendingContentReady
All pending content is now ready.
This event signals that all queued content downloads from the last sync run have either
completed or failed.
It will only be emitted after a Self::SyncFinished event, never before.
Receiving this event does not guarantee that all content in the document is available. If
blobs failed to download, this event will still be emitted after all operations completed.
-§NeighborUp(PublicKey)
We have a new neighbor in the swarm.
-§NeighborDown(PublicKey)
We lost a neighbor in the swarm.
+§NeighborUp(PublicKey)
We have a new neighbor in the swarm.
+§NeighborDown(PublicKey)
We lost a neighbor in the swarm.
§SyncFinished(SyncEvent)
A set-reconciliation sync finished.
Trait Implementations§
source§impl<'de> Deserialize<'de> for LiveEvent
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl PartialEq for LiveEvent
source§fn eq(&self, other: &LiveEvent) -> bool
This method tests for self and other values to be equal, and is used
diff --git a/pr/2595/docs/iroh_docs/engine/fn.entry_to_content_status.html b/pr/2595/docs/iroh_docs/engine/fn.entry_to_content_status.html
index 459a6719d2..3b39df6428 100644
--- a/pr/2595/docs/iroh_docs/engine/fn.entry_to_content_status.html
+++ b/pr/2595/docs/iroh_docs/engine/fn.entry_to_content_status.html
@@ -1,2 +1,2 @@
-entry_to_content_status in iroh_docs::engine - Rust Function iroh_docs::engine::entry_to_content_status
source · pub fn entry_to_content_status(entry: Result<EntryStatus>) -> ContentStatus
Expand description
Converts an [EntryStatus] into a [‘ContentStatus’].
+entry_to_content_status in iroh_docs::engine - Rust Function iroh_docs::engine::entry_to_content_status
source · pub fn entry_to_content_status(entry: Result<EntryStatus>) -> ContentStatus
Expand description
Converts an EntryStatus into a [‘ContentStatus’].
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_docs/engine/index.html b/pr/2595/docs/iroh_docs/engine/index.html
index 5f78e23386..622ab4b871 100644
--- a/pr/2595/docs/iroh_docs/engine/index.html
+++ b/pr/2595/docs/iroh_docs/engine/index.html
@@ -1,4 +1,4 @@
iroh_docs::engine - Rust Expand description
Handlers and actors to for live syncing replicas.
crate::Replica is also called documents here.
Structs§
- Persistent default author for a docs engine.
- The sync engine coordinates actors that manage open documents, set-reconciliation syncs with
-peers and a gossip swarm for each syncing document.
- Event emitted when a sync operation completes
Enums§
- Where to persist the default author.
- Events informing about actions of the live sync progress.
- Why we performed a sync exchange
- Why we started a sync request
Functions§
- Converts an [
EntryStatus] into a [‘ContentStatus’].
\ No newline at end of file
+peers and a gossip swarm for each syncing document.Event emitted when a sync operation completes Enums§
- Where to persist the default author.
- Events informing about actions of the live sync progress.
- Why we performed a sync exchange
- Why we started a sync request
Functions§
- Converts an
EntryStatus into a [‘ContentStatus’].
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_docs/engine/struct.Engine.html b/pr/2595/docs/iroh_docs/engine/struct.Engine.html
index 1b88a96726..46cd25179e 100644
--- a/pr/2595/docs/iroh_docs/engine/struct.Engine.html
+++ b/pr/2595/docs/iroh_docs/engine/struct.Engine.html
@@ -8,12 +8,12 @@ peers and a gossip swarm for each syncing document.
Fields§
§endpoint: EndpointEndpoint used by the engine.
§sync: SyncHandleHandle to the actor thread.
The persistent default author for this engine.
-Implementations§
source§impl Engine
Implementations§
source§impl Engine
sourcepub async fn spawn<B: Store>(
endpoint: Endpoint,
- gossip: Gossip,
+ gossip: Gossip,
replica_store: Store,
bao_store: B,
- downloader: Downloader,
+ downloader: Downloader,
default_author_storage: DefaultAuthorStorage
) -> Result<Self>
Start the sync engine.
This will spawn two tokio tasks for the live sync coordination and gossip actors, and a
@@ -21,7 +21,7 @@ thread for the sourcepub async fn start_sync(
&self,
namespace: NamespaceId,
- peers: Vec<NodeAddr>
+ peers: Vec<NodeAddr>
) -> Result<()>
Start to sync a document.
If peers is non-empty, it will both do an initial set-reconciliation sync with each peer,
and join an iroh-gossip swarm with these peers to receive and broadcast document updates.
diff --git a/pr/2595/docs/iroh_docs/engine/struct.SyncEvent.html b/pr/2595/docs/iroh_docs/engine/struct.SyncEvent.html
index 49ba954022..d7eb730d81 100644
--- a/pr/2595/docs/iroh_docs/engine/struct.SyncEvent.html
+++ b/pr/2595/docs/iroh_docs/engine/struct.SyncEvent.html
@@ -1,11 +1,11 @@
SyncEvent in iroh_docs::engine - Rust pub struct SyncEvent {
- pub peer: PublicKey,
+ pub peer: PublicKey,
pub origin: Origin,
pub finished: SystemTime,
pub started: SystemTime,
pub result: Result<SyncDetails, String>,
}
Expand description
Event emitted when a sync operation completes
-Fields§
§peer: PublicKeyPeer we synced with
+Fields§
§peer: PublicKeyPeer we synced with
§origin: OriginOrigin of the sync exchange
§finished: SystemTimeTimestamp when the sync started
§started: SystemTimeTimestamp when the sync finished
diff --git a/pr/2595/docs/iroh_docs/index.html b/pr/2595/docs/iroh_docs/index.html
index a37d30e2a6..41c792c5e5 100644
--- a/pr/2595/docs/iroh_docs/index.html
+++ b/pr/2595/docs/iroh_docs/index.html
@@ -1,7 +1,7 @@
iroh_docs - Rust Expand description
Multi-dimensional key-value documents with an efficient synchronization protocol
The crate operates on Replicas. A replica contains an unlimited number of
Entries. Each entry is identified by a key, its author, and the replica’s
-namespace. Its value is the 32-byte BLAKE3 hash
+namespace. Its value is the 32-byte BLAKE3 hash
of the entry’s content data, the size of this content data, and a timestamp.
The content data itself is not stored or transferred through a replica.
All entries in a replica are signed with two keypairs:
diff --git a/pr/2595/docs/iroh_docs/net/enum.AcceptError.html b/pr/2595/docs/iroh_docs/net/enum.AcceptError.html
index 87e9a07ad3..cf11b5b695 100644
--- a/pr/2595/docs/iroh_docs/net/enum.AcceptError.html
+++ b/pr/2595/docs/iroh_docs/net/enum.AcceptError.html
@@ -3,31 +3,31 @@
error: Error,
},
Open {
- peer: PublicKey,
+ peer: PublicKey,
error: Error,
},
Abort {
- peer: PublicKey,
+ peer: PublicKey,
namespace: NamespaceId,
reason: AbortReason,
},
Sync {
- peer: PublicKey,
+ peer: PublicKey,
namespace: Option<NamespaceId>,
error: Error,
},
Close {
- peer: PublicKey,
+ peer: PublicKey,
namespace: Option<NamespaceId>,
error: Error,
},
}Expand description
Errors that may occur on handling incoming sync connections.
Variants§
§Connect
Failed to establish connection
§Open
Failed to open replica
-§Abort
We aborted the sync request.
-§Sync
Failed to run sync
-§Close
Failed to close
-Implementations§
source§impl AcceptError
Implementations§
Trait Implementations§
source§impl Debug for AcceptError
source§impl Display for AcceptError
source§impl Error for AcceptError
source§fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more1.0.0 · source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()Auto Trait Implementations§
§impl Freeze for AcceptError
§impl RefUnwindSafe for AcceptError
§impl Send for AcceptError
§impl Sync for AcceptError
§impl Unpin for AcceptError
§impl UnwindSafe for AcceptError
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
diff --git a/pr/2595/docs/iroh_docs/net/fn.connect_and_sync.html b/pr/2595/docs/iroh_docs/net/fn.connect_and_sync.html
index 1ee6909d53..7bec313309 100644
--- a/pr/2595/docs/iroh_docs/net/fn.connect_and_sync.html
+++ b/pr/2595/docs/iroh_docs/net/fn.connect_and_sync.html
@@ -2,6 +2,6 @@
endpoint: &Endpoint,
sync: &SyncHandle,
namespace: NamespaceId,
- peer: NodeAddr
+ peer: NodeAddr
) -> Result<SyncFinished, ConnectError>Expand description
Connect to a peer and sync a replica
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_docs/net/fn.handle_connection.html b/pr/2595/docs/iroh_docs/net/fn.handle_connection.html
index 347a0c22bf..e96816b362 100644
--- a/pr/2595/docs/iroh_docs/net/fn.handle_connection.html
+++ b/pr/2595/docs/iroh_docs/net/fn.handle_connection.html
@@ -3,6 +3,6 @@
connecting: Connecting,
accept_cb: F
) -> Result<SyncFinished, AcceptError>where
- F: Fn(NamespaceId, PublicKey) -> Fut,
+ F: Fn(NamespaceId, PublicKey) -> Fut,
Fut: Future<Output = AcceptOutcome>,Expand description
Handle an iroh-docs connection and sync all shared documents in the replica store.
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_docs/net/struct.SyncFinished.html b/pr/2595/docs/iroh_docs/net/struct.SyncFinished.html
index 74ab2f6632..dcd549e6fc 100644
--- a/pr/2595/docs/iroh_docs/net/struct.SyncFinished.html
+++ b/pr/2595/docs/iroh_docs/net/struct.SyncFinished.html
@@ -1,11 +1,11 @@
SyncFinished in iroh_docs::net - Rust Struct iroh_docs::net::SyncFinished
source · pub struct SyncFinished {
pub namespace: NamespaceId,
- pub peer: PublicKey,
+ pub peer: PublicKey,
pub outcome: SyncOutcome,
pub timings: Timings,
}
Expand description
Details of a finished sync operation.
Fields§
§namespace: NamespaceIdThe namespace that was synced.
-§peer: PublicKeyThe peer we syned with.
+§peer: PublicKeyThe peer we syned with.
§outcome: SyncOutcomeThe outcome of the sync operation
§timings: TimingsThe time this operation took
Trait Implementations§
source§impl Clone for SyncFinished
source§fn clone(&self) -> SyncFinished
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moreAuto Trait Implementations§
§impl Freeze for SyncFinished
§impl RefUnwindSafe for SyncFinished
§impl Send for SyncFinished
§impl Sync for SyncFinished
§impl Unpin for SyncFinished
§impl UnwindSafe for SyncFinished
Blanket Implementations§
source§impl<T> Any for Twhere
diff --git a/pr/2595/docs/iroh_docs/store/fs/struct.ContentHashesIterator.html b/pr/2595/docs/iroh_docs/store/fs/struct.ContentHashesIterator.html
index 8bebf68ec6..df1fc8865f 100644
--- a/pr/2595/docs/iroh_docs/store/fs/struct.ContentHashesIterator.html
+++ b/pr/2595/docs/iroh_docs/store/fs/struct.ContentHashesIterator.html
@@ -6,7 +6,7 @@ It needs a copy of a redb::ReadOnlyTable to be self-contained.
Implementations§
Trait Implementations§
source§impl Debug for ContentHashesIterator
Trait Implementations§
source§impl Debug for ContentHashesIterator
source§impl Iterator for ContentHashesIterator
source§fn next(&mut self) -> Option<Self::Item>
Advances the iterator and returns the next value. Read moresource§fn next_chunk<const N: usize>(
&mut self
) -> Result<[Self::Item; N], IntoIter<Self::Item, N>>where
Self: Sized,
🔬This is a nightly-only experimental API. (iter_next_chunk)Advances the iterator and returns an array containing the next N values. Read more1.0.0 · source§fn size_hint(&self) -> (usize, Option<usize>)
Returns the bounds on the remaining length of the iterator. Read more1.0.0 · source§fn count(self) -> usizewhere
diff --git a/pr/2595/docs/iroh_docs/struct.AuthorId.html b/pr/2595/docs/iroh_docs/struct.AuthorId.html
index 7dfa3dea5b..02221b0eb6 100644
--- a/pr/2595/docs/iroh_docs/struct.AuthorId.html
+++ b/pr/2595/docs/iroh_docs/struct.AuthorId.html
@@ -156,6 +156,6 @@ letters are used (e.g. F9B4CA)
Into<Dispatch>, source§fn with_current_subscriber(self) -> WithDispatch<Self>
source§impl<T> DeserializeOwned for Twhere
- T: for<'de> Deserialize<'de>,
§impl<T> PeerIdentity for Twhere
+ T: for<'de> Deserialize<'de>,
source§impl<T> PeerIdentity for T
source§impl<T> RuleType for T
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_docs/struct.AuthorPublicKey.html b/pr/2595/docs/iroh_docs/struct.AuthorPublicKey.html
index 8e72b11c8a..7a83ce68e4 100644
--- a/pr/2595/docs/iroh_docs/struct.AuthorPublicKey.html
+++ b/pr/2595/docs/iroh_docs/struct.AuthorPublicKey.html
@@ -148,6 +148,6 @@ builds. Into<Dispatch>,source§fn with_current_subscriber(self) -> WithDispatch<Self>
source§impl<T> DeserializeOwned for Twhere
- T: for<'de> Deserialize<'de>,
§impl<T> PeerIdentity for Twhere
+ T: for<'de> Deserialize<'de>,
source§impl<T> PeerIdentity for T
source§impl<T> RuleType for T
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_docs/struct.DocTicket.html b/pr/2595/docs/iroh_docs/struct.DocTicket.html
index d53a93c4c4..fd1bb5eb02 100644
--- a/pr/2595/docs/iroh_docs/struct.DocTicket.html
+++ b/pr/2595/docs/iroh_docs/struct.DocTicket.html
@@ -1,13 +1,13 @@
DocTicket in iroh_docs - Rust pub struct DocTicket {
pub capability: Capability,
- pub nodes: Vec<NodeAddr>,
+ pub nodes: Vec<NodeAddr>,
}
Expand description
Contains both a key (either secret or public) to a document, and a list of peers to join.
Fields§
§capability: Capabilityeither a public or private key
-§nodes: Vec<NodeAddr>A list of nodes to contact.
-Implementations§
source§impl DocTicket
sourcepub fn new(capability: Capability, peers: Vec<NodeAddr>) -> Self
Create a new doc ticket
+§nodes: Vec<NodeAddr>A list of nodes to contact.
+Implementations§
Trait Implementations§
source§impl<'de> Deserialize<'de> for DocTicket
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
- __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreAuto Trait Implementations§
§impl Freeze for DocTicket
§impl RefUnwindSafe for DocTicket
§impl Send for DocTicket
§impl Sync for DocTicket
§impl Unpin for DocTicket
§impl UnwindSafe for DocTicket
Blanket Implementations§
source§impl<T> Any for Twhere
+ __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreAuto Trait Implementations§
§impl Freeze for DocTicket
§impl RefUnwindSafe for DocTicket
§impl Send for DocTicket
§impl Sync for DocTicket
§impl Unpin for DocTicket
§impl UnwindSafe for DocTicket
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
diff --git a/pr/2595/docs/iroh_docs/struct.NamespaceId.html b/pr/2595/docs/iroh_docs/struct.NamespaceId.html
index 433d51afc6..f9acda8e94 100644
--- a/pr/2595/docs/iroh_docs/struct.NamespaceId.html
+++ b/pr/2595/docs/iroh_docs/struct.NamespaceId.html
@@ -156,6 +156,6 @@ letters are used (e.g. F9B4CA)
Into<Dispatch>, source§fn with_current_subscriber(self) -> WithDispatch<Self>
source§impl<T> DeserializeOwned for Twhere
- T: for<'de> Deserialize<'de>,
§impl<T> PeerIdentity for Twhere
+ T: for<'de> Deserialize<'de>,
source§impl<T> PeerIdentity for T
source§impl<T> RuleType for T
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_docs/struct.NamespacePublicKey.html b/pr/2595/docs/iroh_docs/struct.NamespacePublicKey.html
index 350dea9049..72b75ed510 100644
--- a/pr/2595/docs/iroh_docs/struct.NamespacePublicKey.html
+++ b/pr/2595/docs/iroh_docs/struct.NamespacePublicKey.html
@@ -147,6 +147,6 @@ builds.Into<Dispatch>,source§fn with_current_subscriber(self) -> WithDispatch<Self>
source§impl<T> DeserializeOwned for Twhere
- T: for<'de> Deserialize<'de>,
§impl<T> PeerIdentity for Twhere
+ T: for<'de> Deserialize<'de>,
source§impl<T> PeerIdentity for T
source§impl<T> RuleType for T
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_docs/sync/struct.Entry.html b/pr/2595/docs/iroh_docs/sync/struct.Entry.html
index 55bf06044f..055a4b6f54 100644
--- a/pr/2595/docs/iroh_docs/sync/struct.Entry.html
+++ b/pr/2595/docs/iroh_docs/sync/struct.Entry.html
@@ -1,6 +1,6 @@
Entry in iroh_docs::sync - Rust pub struct Entry { /* private fields */ }
Expand description
A single entry in a Replica
An entry is identified by a key, its Author, and the Replica’s
-NamespaceSecret. Its value is the 32-byte BLAKE3 hash
+NamespaceSecret. Its value is the 32-byte BLAKE3 hash
of the entry’s content data, the size of this content data, and a timestamp.
Implementations§
source§impl Entry
sourcepub fn new(id: RecordIdentifier, record: Record) -> Self
Create a new entry
sourcepub fn new_empty(id: RecordIdentifier) -> Self
Create a new empty entry with the current timestamp.
@@ -15,7 +15,7 @@ of the entry’s content data, the size of this content data, and a timestamp.
sourcepub fn sign(self, namespace: &NamespaceSecret, author: &Author) -> SignedEntry
Sign this entry with a NamespaceSecret and Author.
Methods from Deref<Target = Record>§
sourcepub fn content_len(&self) -> u64
Get the length of the data addressed by this record’s content hash.
-sourcepub fn content_hash(&self) -> Hash
Get the [struct@Hash] of the content data of this record.
+sourcepub fn content_hash(&self) -> Hash
Get the Hash of the content data of this record.
Trait Implementations§
source§impl<'de> Deserialize<'de> for Entry
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl From<SignedEntry> for Entry
source§fn from(value: SignedEntry) -> Self
Converts to this type from the input type.source§impl Ord for Entry
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
diff --git a/pr/2595/docs/iroh_docs/sync/struct.Record.html b/pr/2595/docs/iroh_docs/sync/struct.Record.html
index 94479a973e..f06cccab52 100644
--- a/pr/2595/docs/iroh_docs/sync/struct.Record.html
+++ b/pr/2595/docs/iroh_docs/sync/struct.Record.html
@@ -1,11 +1,11 @@
Record in iroh_docs::sync - Rust pub struct Record { /* private fields */ }
Expand description
The data part of an entry in a Replica.
-Implementations§
source§impl Record
Implementations§
source§impl Record
sourcepub fn empty_current() -> Self
Create a tombstone record with the timestamp set to now.
sourcepub fn new_current(hash: Hash, len: u64) -> Self
Create a new Record with the timestamp set to now.
+sourcepub fn new_current(hash: Hash, len: u64) -> Self
Create a new Record with the timestamp set to now.
sourcepub fn content_len(&self) -> u64
Get the length of the data addressed by this record’s content hash.
-sourcepub fn content_hash(&self) -> Hash
Get the [struct@Hash] of the content data of this record.
+sourcepub fn content_hash(&self) -> Hash
Get the Hash of the content data of this record.
Trait Implementations§
source§impl<'de> Deserialize<'de> for Record
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl Ord for Record
Ordering for entry values.
diff --git a/pr/2595/docs/iroh_docs/sync/struct.Replica.html b/pr/2595/docs/iroh_docs/sync/struct.Replica.html
index 23a9798651..c4e161f3c3 100644
--- a/pr/2595/docs/iroh_docs/sync/struct.Replica.html
+++ b/pr/2595/docs/iroh_docs/sync/struct.Replica.html
@@ -5,7 +5,7 @@
&mut self,
key: impl AsRef<[u8]>,
author: &Author,
- hash: Hash,
+ hash: Hash,
len: u64
) -> Result<usize, InsertError>Insert a new record at the given key.
The entry will by signed by the provided author.
@@ -35,7 +35,7 @@ or an error if the entry failed to validate or if a store operation failed.
key: impl AsRef<[u8]>,
author: &Author,
data: impl AsRef<[u8]>
-) -> Result<Hash, InsertError>Hashes the given data and inserts it.
+) -> Result<Hash, InsertError>Hashes the given data and inserts it.
This does not store the content, just the record of it.
Returns the calculated hash.
sourcepub fn record_id(
diff --git a/pr/2595/docs/iroh_docs/sync/struct.SignedEntry.html b/pr/2595/docs/iroh_docs/sync/struct.SignedEntry.html
index 21644eacb1..9ef5e98134 100644
--- a/pr/2595/docs/iroh_docs/sync/struct.SignedEntry.html
+++ b/pr/2595/docs/iroh_docs/sync/struct.SignedEntry.html
@@ -14,7 +14,7 @@
sourcepub fn signature(&self) -> &EntrySignature
Get the signature.
sourcepub fn validate_empty(&self) -> Result<(), ValidationFailure>
Validate that the entry has the empty hash if the length is 0, or a non-zero length.
sourcepub fn content_hash(&self) -> Hash
Get the content [struct@Hash] of the entry.
+sourcepub fn content_hash(&self) -> Hash
Get the content Hash of the entry.
sourcepub fn content_len(&self) -> u64
Get the content length of the entry.
Get the author bytes of this entry.
Methods from Deref<Target = Record>§
sourcepub fn content_len(&self) -> u64
Get the length of the data addressed by this record’s content hash.
-sourcepub fn content_hash(&self) -> Hash
Get the [struct@Hash] of the content data of this record.
+sourcepub fn content_hash(&self) -> Hash
Get the Hash of the content data of this record.
Trait Implementations§
source§impl Clone for SignedEntry
source§fn clone(&self) -> SignedEntry
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moresource§impl Debug for SignedEntry
source§impl Deref for SignedEntry
source§impl<'de> Deserialize<'de> for SignedEntry
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl From<SignedEntry> for Entry
source§fn from(value: SignedEntry) -> Self
Converts to this type from the input type.source§impl Ord for SignedEntry
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
diff --git a/pr/2595/docs/iroh_docs/sync/type.ContentStatusCallback.html b/pr/2595/docs/iroh_docs/sync/type.ContentStatusCallback.html
index 46d5a5a49c..84ffdbe8ee 100644
--- a/pr/2595/docs/iroh_docs/sync/type.ContentStatusCallback.html
+++ b/pr/2595/docs/iroh_docs/sync/type.ContentStatusCallback.html
@@ -1,2 +1,2 @@
-ContentStatusCallback in iroh_docs::sync - Rust Type Alias iroh_docs::sync::ContentStatusCallback
source · pub type ContentStatusCallback = Arc<dyn Fn(Hash) -> ContentStatus + Send + Sync + 'static>;
Expand description
Callback that may be set on a replica to determine the availability status for a content hash.
+ContentStatusCallback in iroh_docs::sync - Rust Type Alias iroh_docs::sync::ContentStatusCallback
source · pub type ContentStatusCallback = Arc<dyn Fn(Hash) -> ContentStatus + Send + Sync + 'static>;
Expand description
Callback that may be set on a replica to determine the availability status for a content hash.
Aliased Type§
struct ContentStatusCallback { /* private fields */ }
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_net/discovery/dns/index.html b/pr/2595/docs/iroh_net/discovery/dns/index.html
index 5a80538422..a752b49d78 100644
--- a/pr/2595/docs/iroh_net/discovery/dns/index.html
+++ b/pr/2595/docs/iroh_net/discovery/dns/index.html
@@ -1,2 +1,2 @@
-iroh_net::discovery::dns - Rust Expand description
DNS node discovery for iroh-net
+iroh_net::discovery::dns - Rust Expand description
DNS node discovery for iroh-net
Structs§
- DNS node discovery
Constants§
- The n0 testing DNS node origin, for production.
- The n0 testing DNS node origin, for testing.
- Testing DNS node origin, must run server from
crate::test_utils::DnsPkarrServer.
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_net/discovery/dns/struct.DnsDiscovery.html b/pr/2595/docs/iroh_net/discovery/dns/struct.DnsDiscovery.html
index 3e7d5d71cc..7628fb45a9 100644
--- a/pr/2595/docs/iroh_net/discovery/dns/struct.DnsDiscovery.html
+++ b/pr/2595/docs/iroh_net/discovery/dns/struct.DnsDiscovery.html
@@ -28,7 +28,7 @@ custom discovery mechanism.
For testing it is also possible to use the N0_DNS_NODE_ORIGIN_STAGING domain
with DnsDiscovery::new. This would then use a hosted discovery service again,
but for testing purposes.
-Trait Implementations§
Trait Implementations§
source§impl Debug for DnsDiscovery
source§impl Discovery for DnsDiscovery
source§fn resolve(
&self,
ep: Endpoint,
node_id: NodeId
diff --git a/pr/2595/docs/iroh_net/discovery/trait.Discovery.html b/pr/2595/docs/iroh_net/discovery/trait.Discovery.html
index a53a618708..d3832a56b5 100644
--- a/pr/2595/docs/iroh_net/discovery/trait.Discovery.html
+++ b/pr/2595/docs/iroh_net/discovery/trait.Discovery.html
@@ -29,4 +29,4 @@ These tasks will be run on the runtime of the Option<BoxStream<Result<DiscoveryItem>>>
Implementors§
source§impl Discovery for DnsDiscovery
source§impl Discovery for LocalSwarmDiscovery
source§impl Discovery for PkarrPublisher
source§impl Discovery for PkarrResolver
source§impl Discovery for ConcurrentDiscovery
\ No newline at end of file
+
Implementors§
source§impl Discovery for DnsDiscovery
source§impl Discovery for LocalSwarmDiscovery
source§impl Discovery for PkarrPublisher
source§impl Discovery for PkarrResolver
source§impl Discovery for ConcurrentDiscovery
\ No newline at end of file
diff --git a/pr/2595/docs/src/iroh_net/discovery/dns.rs.html b/pr/2595/docs/src/iroh_net/discovery/dns.rs.html
index dd1a279fb3..1d32545ed3 100644
--- a/pr/2595/docs/src/iroh_net/discovery/dns.rs.html
+++ b/pr/2595/docs/src/iroh_net/discovery/dns.rs.html
@@ -97,6 +97,10 @@
97
98
99
+100
+101
+102
+103
//! DNS node discovery for iroh-net
use anyhow::Result;
@@ -182,6 +186,10 @@
fn resolve(&self, ep: Endpoint, node_id: NodeId) -> Option<BoxStream<Result<DiscoveryItem>>> {
let resolver = ep.dns_resolver().clone();
let origin_domain = self.origin_domain.clone();
+ #[cfg(any(test, feature = "test-utils"))]
+ if origin_domain.contains(&TEST_DNS_NODE_ORIGIN.to_string()) {
+ panic!("wait. THIS IS ILLEGAL!");
+ }
let fut = async move {
let node_addr = resolver
.lookup_by_id_staggered(&node_id, &origin_domain, DNS_STAGGERING_MS)
diff --git a/pr/2595/docs/trait.impl/iroh_base/ticket/trait.Ticket.js b/pr/2595/docs/trait.impl/iroh_base/ticket/trait.Ticket.js
index 12fa1e3ee5..5d209fabd2 100644
--- a/pr/2595/docs/trait.impl/iroh_base/ticket/trait.Ticket.js
+++ b/pr/2595/docs/trait.impl/iroh_base/ticket/trait.Ticket.js
@@ -1,5 +1,5 @@
(function() {var implementors = {
"iroh":[],
"iroh_base":[],
-"iroh_docs":[["impl Ticket for DocTicket"]]
+"iroh_docs":[["impl Ticket for DocTicket"]]
};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
diff --git a/pr/2595/docs/type.impl/std/primitive.array.js b/pr/2595/docs/type.impl/std/primitive.array.js
index 588a8b53a3..3006964922 100644
--- a/pr/2595/docs/type.impl/std/primitive.array.js
+++ b/pr/2595/docs/type.impl/std/primitive.array.js
@@ -1,4 +1,4 @@
(function() {var type_impls = {
"iroh":[["source§impl<T, const N: usize> [T; N]
1.55.0 · sourcepub fn map<F, U>(self, f: F) -> [U; N]where\n F: FnMut(T) -> U,
Returns an array of the same size as self, with function f applied to each element\nin order.
\nIf you don’t necessarily need a new fixed-size array, consider using\nIterator::map instead.
\n§Note on performance and stack usage
\nUnfortunately, usages of this method are currently not always optimized\nas well as they could be. This mainly concerns large arrays, as mapping\nover small arrays seem to be optimized just fine. Also note that in\ndebug mode (i.e. without any optimizations), this method can use a lot\nof stack space (a few times the size of the array or more).
\nTherefore, in performance-critical code, try to avoid using this method\non large arrays or check the emitted code. Also try to avoid chained\nmaps (e.g. arr.map(...).map(...)).
\nIn many cases, you can instead use Iterator::map by calling .iter()\nor .into_iter() on your array. [T; N]::map is only necessary if you\nreally need a new array of the same size as the result. Rust’s lazy\niterators tend to get optimized very well.
\n§Examples
\nlet x = [1, 2, 3];\nlet y = x.map(|v| v + 1);\nassert_eq!(y, [2, 3, 4]);\n\nlet x = [1, 2, 3];\nlet mut temp = 0;\nlet y = x.map(|v| { temp += 1; v * temp });\nassert_eq!(y, [1, 4, 9]);\n\nlet x = [\"Ferris\", \"Bueller's\", \"Day\", \"Off\"];\nlet y = x.map(|v| v.len());\nassert_eq!(y, [6, 9, 3, 3]);
\nsourcepub fn try_map<F, R>(\n self,\n f: F\n) -> <<R as Try>::Residual as Residual<[<R as Try>::Output; N]>>::TryType
🔬This is a nightly-only experimental API. (array_try_map)
A fallible function f applied to each element on array self in order to\nreturn an array the same size as self or the first error encountered.
\nThe return type of this function depends on the return type of the closure.\nIf you return Result<T, E> from the closure, you’ll get a Result<[T; N], E>.\nIf you return Option<T> from the closure, you’ll get an Option<[T; N]>.
\n§Examples
\n#![feature(array_try_map)]\n\nlet a = [\"1\", \"2\", \"3\"];\nlet b = a.try_map(|v| v.parse::<u32>()).unwrap().map(|v| v + 1);\nassert_eq!(b, [2, 3, 4]);\n\nlet a = [\"1\", \"2a\", \"3\"];\nlet b = a.try_map(|v| v.parse::<u32>());\nassert!(b.is_err());\n\nuse std::num::NonZero;\n\nlet z = [1, 2, 0, 3, 4];\nassert_eq!(z.try_map(NonZero::new), None);\n\nlet a = [1, 2, 3];\nlet b = a.try_map(NonZero::new);\nlet c = b.map(|x| x.map(NonZero::get));\nassert_eq!(c, Some(a));
\n1.57.0 (const: 1.57.0) · sourcepub const fn as_slice(&self) -> &[T]
Returns a slice containing the entire array. Equivalent to &s[..].
\n1.57.0 · sourcepub fn as_mut_slice(&mut self) -> &mut [T]
Returns a mutable slice containing the entire array. Equivalent to\n&mut s[..].
\n1.77.0 · sourcepub fn each_ref(&self) -> [&T; N]
Borrows each element and returns an array of references with the same\nsize as self.
\n§Example
\nlet floats = [3.1, 2.7, -1.0];\nlet float_refs: [&f64; 3] = floats.each_ref();\nassert_eq!(float_refs, [&3.1, &2.7, &-1.0]);
\nThis method is particularly useful if combined with other methods, like\nmap. This way, you can avoid moving the original\narray if its elements are not Copy.
\n\nlet strings = [\"Ferris\".to_string(), \"♥\".to_string(), \"Rust\".to_string()];\nlet is_ascii = strings.each_ref().map(|s| s.is_ascii());\nassert_eq!(is_ascii, [true, false, true]);\n\n// We can still access the original array: it has not been moved.\nassert_eq!(strings.len(), 3);
\n1.77.0 · sourcepub fn each_mut(&mut self) -> [&mut T; N]
Borrows each element mutably and returns an array of mutable references\nwith the same size as self.
\n§Example
\n\nlet mut floats = [3.1, 2.7, -1.0];\nlet float_refs: [&mut f64; 3] = floats.each_mut();\n*float_refs[0] = 0.0;\nassert_eq!(float_refs, [&mut 0.0, &mut 2.7, &mut -1.0]);\nassert_eq!(floats, [0.0, 2.7, -1.0]);
\nsourcepub fn split_array_ref<const M: usize>(&self) -> (&[T; M], &[T])
🔬This is a nightly-only experimental API. (split_array)
Divides one array reference into two at an index.
\nThe first will contain all indices from [0, M) (excluding\nthe index M itself) and the second will contain all\nindices from [M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet v = [1, 2, 3, 4, 5, 6];\n\n{\n let (left, right) = v.split_array_ref::<0>();\n assert_eq!(left, &[]);\n assert_eq!(right, &[1, 2, 3, 4, 5, 6]);\n}\n\n{\n let (left, right) = v.split_array_ref::<2>();\n assert_eq!(left, &[1, 2]);\n assert_eq!(right, &[3, 4, 5, 6]);\n}\n\n{\n let (left, right) = v.split_array_ref::<6>();\n assert_eq!(left, &[1, 2, 3, 4, 5, 6]);\n assert_eq!(right, &[]);\n}
\nsourcepub fn split_array_mut<const M: usize>(&mut self) -> (&mut [T; M], &mut [T])
🔬This is a nightly-only experimental API. (split_array)
Divides one mutable array reference into two at an index.
\nThe first will contain all indices from [0, M) (excluding\nthe index M itself) and the second will contain all\nindices from [M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet mut v = [1, 0, 3, 0, 5, 6];\nlet (left, right) = v.split_array_mut::<2>();\nassert_eq!(left, &mut [1, 0][..]);\nassert_eq!(right, &mut [3, 0, 5, 6]);\nleft[1] = 2;\nright[1] = 4;\nassert_eq!(v, [1, 2, 3, 4, 5, 6]);
\nsourcepub fn rsplit_array_ref<const M: usize>(&self) -> (&[T], &[T; M])
🔬This is a nightly-only experimental API. (split_array)
Divides one array reference into two at an index from the end.
\nThe first will contain all indices from [0, N - M) (excluding\nthe index N - M itself) and the second will contain all\nindices from [N - M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet v = [1, 2, 3, 4, 5, 6];\n\n{\n let (left, right) = v.rsplit_array_ref::<0>();\n assert_eq!(left, &[1, 2, 3, 4, 5, 6]);\n assert_eq!(right, &[]);\n}\n\n{\n let (left, right) = v.rsplit_array_ref::<2>();\n assert_eq!(left, &[1, 2, 3, 4]);\n assert_eq!(right, &[5, 6]);\n}\n\n{\n let (left, right) = v.rsplit_array_ref::<6>();\n assert_eq!(left, &[]);\n assert_eq!(right, &[1, 2, 3, 4, 5, 6]);\n}
\nsourcepub fn rsplit_array_mut<const M: usize>(&mut self) -> (&mut [T], &mut [T; M])
🔬This is a nightly-only experimental API. (split_array)
Divides one mutable array reference into two at an index from the end.
\nThe first will contain all indices from [0, N - M) (excluding\nthe index N - M itself) and the second will contain all\nindices from [N - M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet mut v = [1, 0, 3, 0, 5, 6];\nlet (left, right) = v.rsplit_array_mut::<4>();\nassert_eq!(left, &mut [1, 0]);\nassert_eq!(right, &mut [3, 0, 5, 6][..]);\nleft[1] = 2;\nright[1] = 4;\nassert_eq!(v, [1, 2, 3, 4, 5, 6]);
\n",0,"iroh::docs::PeerIdBytes"],["source§impl<const N: usize> [u8; N]
sourcepub const fn as_ascii(&self) -> Option<&[AsciiChar; N]>
🔬This is a nightly-only experimental API. (ascii_char)
Converts this array of bytes into a array of ASCII characters,\nor returns None if any of the characters is non-ASCII.
\n§Examples
\n#![feature(ascii_char)]\n#![feature(const_option)]\n\nconst HEX_DIGITS: [std::ascii::Char; 16] =\n *b\"0123456789abcdef\".as_ascii().unwrap();\n\nassert_eq!(HEX_DIGITS[1].as_str(), \"1\");\nassert_eq!(HEX_DIGITS[10].as_str(), \"a\");
\nsourcepub const unsafe fn as_ascii_unchecked(&self) -> &[AsciiChar; N]
🔬This is a nightly-only experimental API. (ascii_char)
Converts this array of bytes into a array of ASCII characters,\nwithout checking whether they’re valid.
\n§Safety
\nEvery byte in the array must be in 0..=127, or else this is UB.
\n",0,"iroh::docs::PeerIdBytes"],["§impl<T> Array for [T; 32]where\n T: Default,
§fn as_slice_mut(&mut self) -> &mut [T]
Gives a unique slice over the whole thing. Read more","Array","iroh::docs::PeerIdBytes"],["","Array","iroh::docs::PeerIdBytes"],["§impl<const N: usize, T> AsBytes for [T; N]where\n T: AsBytes,
§fn write_to_prefix(&self, bytes: &mut [u8]) -> Option<()>
","AsBytes","iroh::docs::PeerIdBytes"],["","AsBytes","iroh::docs::PeerIdBytes"],["","AsMut<[T]>","iroh::docs::PeerIdBytes"],["","AsRef<[T]>","iroh::docs::PeerIdBytes"],["§impl<T, const N: usize> BitView for [T; N]where\n T: BitStore,
Note that overly-large arrays may cause the conversions to fail.
\n§fn view_bits<O>(&self) -> &BitSlice<T, O>where\n O: BitOrder,
Views a memory region as an immutable bit-slice.§fn try_view_bits<O>(&self) -> Result<&BitSlice<T, O>, BitSpanError<T>>where\n O: BitOrder,
Attempts to view a memory region as an immutable bit-slice. Read more§fn view_bits_mut<O>(&mut self) -> &mut BitSlice<T, O>where\n O: BitOrder,
Views a memory region as a mutable bit-slice.§fn try_view_bits_mut<O>(\n &mut self\n) -> Result<&mut BitSlice<T, O>, BitSpanError<T>>where\n O: BitOrder,
Attempts to view a memory region as a mutable bit-slice. Read more","BitView","iroh::docs::PeerIdBytes"],["§impl<T, const N: usize> BitViewSized for [T; N]where\n T: BitStore,
§fn as_raw_slice(&self) -> &[<[T; N] as BitView>::Store]
Views the type as a slice of its elements.§fn as_raw_mut_slice(&mut self) -> &mut [<[T; N] as BitView>::Store]
Views the type as a mutable slice of its elements.§fn into_bitarray<O>(self) -> BitArray<Self, O>where\n O: BitOrder,
Wraps self in a BitArray.","BitViewSized","iroh::docs::PeerIdBytes"],["","Borrow<[T]>","iroh::docs::PeerIdBytes"],["1.4.0 · source§impl<T, const N: usize> BorrowMut<[T]> for [T; N]
source§fn borrow_mut(&mut self) -> &mut [T]
Mutably borrows from an owned value. Read more","BorrowMut<[T]>","iroh::docs::PeerIdBytes"],["","Chain","iroh::docs::PeerIdBytes"],["","Clone","iroh::docs::PeerIdBytes"],["","Debug","iroh::docs::PeerIdBytes"],["§impl<const N: usize> Decode for [u8; N]
Decodes a byte array from byte[n] as described in RFC4251 § 5:
\n\nA byte represents an arbitrary 8-bit value (octet). Fixed length\ndata is sometimes represented as an array of bytes, written\nbyte[n], where n is the number of bytes in the array.
\n
\n","Decode","iroh::docs::PeerIdBytes"],["§impl<'a, T, const N: usize> DecodeValue<'a> for [T; N]where\n T: Decode<'a>,
§fn decode_value<R>(reader: &mut R, header: Header) -> Result<[T; N], Error>where\n R: Reader<'a>,
Attempt to decode this message using the provided [Reader].","DecodeValue<'a>","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["source§impl<'de, T> Deserialize<'de> for [T; 32]where\n T: Deserialize<'de>,
source§fn deserialize<D>(\n deserializer: D\n) -> Result<[T; 32], <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more","Deserialize<'de>","iroh::docs::PeerIdBytes"],["source§impl<'de, const N: usize> Deserialize<'de> for [u8; N]
source§fn deserialize<D>(\n deserializer: D\n) -> Result<[u8; N], <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
","Deserialize<'de>","iroh::docs::PeerIdBytes"],["§impl<const N: usize> Encode for [u8; N]
Encodes [u8; N] into byte[n] as described in RFC4251 § 5:
\n\nA byte represents an arbitrary 8-bit value (octet). Fixed length\ndata is sometimes represented as an array of bytes, written\nbyte[n], where n is the number of bytes in the array.
\n
\n§fn encoded_len(&self) -> Result<usize, Error>
Get the length of this type encoded in bytes, prior to Base64 encoding.§fn encode(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value using the provided [Writer].§fn encoded_len_prefixed(&self) -> Result<usize, Error>
Return the length of this type after encoding when prepended with a\nuint32 length prefix.§fn encode_prefixed(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value, first prepending a uint32 length prefix\nset to [Encode::encoded_len].","Encode","iroh::docs::PeerIdBytes"],["","EncodeLabelSet","iroh::docs::PeerIdBytes"],["§impl<T, const N: usize> EncodeValue for [T; N]where\n T: Encode,
","EncodeValue","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["§impl<'a> FindToken<&'a u8> for [u8; 32]
§fn find_token(&self, token: &u8) -> bool
Returns true if self contains the token","FindToken<&'a u8>","iroh::docs::PeerIdBytes"],["§impl FindToken<u8> for [u8; 32]
§fn find_token(&self, token: u8) -> bool
Returns true if self contains the token","FindToken","iroh::docs::PeerIdBytes"],["","FixedTag","iroh::docs::PeerIdBytes"],["","From<&Signature>","iroh::docs::PeerIdBytes"],["","From","iroh::docs::PeerIdBytes"],["§impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>>> for [T; 32]
","From, B0>, B0>, B0>, B0>, B0>>>","iroh::docs::PeerIdBytes"],["","From","iroh::docs::PeerIdBytes"],["","From","iroh::docs::PeerIdBytes"],["","From>","iroh::docs::PeerIdBytes"],["","From","iroh::docs::PeerIdBytes"],["","From","iroh::docs::PeerIdBytes"],["","From","iroh::docs::PeerIdBytes"],["","From>","iroh::docs::PeerIdBytes"],["§impl<const N: usize, T> FromBytes for [T; N]where\n T: FromBytes,
§fn slice_from_prefix(bytes: &[u8], count: usize) -> Option<(&[Self], &[u8])>where\n Self: Sized,
Interprets the prefix of the given bytes as a &[Self] with length\nequal to count without copying. Read more§fn slice_from_suffix(bytes: &[u8], count: usize) -> Option<(&[u8], &[Self])>where\n Self: Sized,
Interprets the suffix of the given bytes as a &[Self] with length\nequal to count without copying. Read more§fn read_from_prefix(bytes: &[u8]) -> Option<Self>where\n Self: Sized,
","FromBytes","iroh::docs::PeerIdBytes"],["","FromHex","iroh::docs::PeerIdBytes"],["","FromZeroes","iroh::docs::PeerIdBytes"],["","Hash","iroh::docs::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Hash for [T; N]where\n T: Hash,
The hash of an array is the same as that of the corresponding slice,\nas required by the Borrow implementation.
\n\nuse std::hash::BuildHasher;\n\nlet b = std::hash::RandomState::new();\nlet a: [u8; 3] = [0xa8, 0x3c, 0x09];\nlet s: &[u8] = &[0xa8, 0x3c, 0x09];\nassert_eq!(b.hash_one(a), b.hash_one(s));
\n","Hash","iroh::docs::PeerIdBytes"],["","Index","iroh::docs::PeerIdBytes"],["","IndexMut","iroh::docs::PeerIdBytes"],["","InputLength","iroh::docs::PeerIdBytes"],["1.53.0 · source§impl<T, const N: usize> IntoIterator for [T; N]
source§fn into_iter(self) -> <[T; N] as IntoIterator>::IntoIter
Creates a consuming iterator, that is, one that moves each value out of\nthe array (from start to end). The array cannot be used after calling\nthis unless T implements Copy, so the whole array is copied.
\nArrays have special behavior when calling .into_iter() prior to the\n2021 edition – see the array Editions section for more information.
\n","IntoIterator","iroh::docs::PeerIdBytes"],["§impl<const N: usize> IntoResponse for [u8; N]
§fn into_response(self) -> Response<Body>
Create a response.","IntoResponse","iroh::docs::PeerIdBytes"],["§impl<Fut, const N: usize> Join for [Fut; N]where\n Fut: IntoFuture,
§type Output = [<Fut as IntoFuture>::Output; N]
The resulting output type.§type Future = Join<<Fut as IntoFuture>::IntoFuture, N>
The Future implementation returned by this method.","Join","iroh::docs::PeerIdBytes"],["","Key","iroh::docs::PeerIdBytes"],["§impl<T, const N: usize> MaxSize for [T; N]where\n T: MaxSize,
§const POSTCARD_MAX_SIZE: usize = _
The maximum possible size that the serialization of this\ntype can have, in bytes.","MaxSize","iroh::docs::PeerIdBytes"],["","Merge","iroh::docs::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Ord for [T; N]where\n T: Ord,
Implements comparison of arrays lexicographically.
\n1.21.0 · source§fn max(self, other: Self) -> Selfwhere\n Self: Sized,
Compares and returns the maximum of two values. Read more","Ord","iroh::docs::PeerIdBytes"],["","PartialEq<&[U]>","iroh::docs::PeerIdBytes"],["1.0.0 · source§impl<T, U, const N: usize> PartialEq<&mut [U]> for [T; N]where\n T: PartialEq<U>,
","PartialEq<&mut [U]>","iroh::docs::PeerIdBytes"],["","PartialEq<[U]>","iroh::docs::PeerIdBytes"],["","PartialEq<[U; N]>","iroh::docs::PeerIdBytes"],["","PartialEq","iroh::docs::PeerIdBytes"],["§impl<A, B, const N: usize, const M: usize> PartialEq<Vec<A, N>> for [B; M]where\n A: PartialEq<B>,
","PartialEq>","iroh::docs::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> PartialOrd for [T; N]where\n T: PartialOrd,
Implements comparison of arrays lexicographically.
\nsource§fn le(&self, other: &[T; N]) -> bool
This method tests less than or equal to (for self and other) and is used by the <=\noperator. Read more","PartialOrd","iroh::docs::PeerIdBytes"],["§impl<Fut, const N: usize> Race for [Fut; N]where\n Fut: IntoFuture,
§type Output = <Fut as IntoFuture>::Output
The resulting output type.§type Future = Race<<Fut as IntoFuture>::IntoFuture, N>
Which kind of future are we turning this into?","Race","iroh::docs::PeerIdBytes"],["§impl<Fut, T, E, const N: usize> RaceOk for [Fut; N]where\n Fut: IntoFuture<Output = Result<T, E>>,
§type Future = RaceOk<<Fut as IntoFuture>::IntoFuture, T, E, N>
Which kind of future are we turning this into?","RaceOk","iroh::docs::PeerIdBytes"],["","Schema","iroh::docs::PeerIdBytes"],["source§impl<T> Serialize for [T; 32]where\n T: 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","iroh::docs::PeerIdBytes"],["source§impl<const N: usize> Serialize for [u8; N]
source§fn serialize<S>(\n &self,\n serializer: S\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where\n S: Serializer,
","Serialize","iroh::docs::PeerIdBytes"],["1.51.0 · source§impl<T, const N: usize> SlicePattern for [T; N]
","SlicePattern","iroh::docs::PeerIdBytes"],["1.34.0 · source§impl<T, const N: usize> TryFrom<&[T]> for [T; N]where\n T: Copy,
Tries to create an array [T; N] by copying from a slice &[T]. Succeeds if\nslice.len() == N.
\n\nlet bytes: [u8; 3] = [1, 0, 2];\n\nlet bytes_head: [u8; 2] = <[u8; 2]>::try_from(&bytes[0..2]).unwrap();\nassert_eq!(1, u16::from_le_bytes(bytes_head));\n\nlet bytes_tail: [u8; 2] = bytes[1..3].try_into().unwrap();\nassert_eq!(512, u16::from_le_bytes(bytes_tail));
\n§type Error = TryFromSliceError
The type returned in the event of a conversion error.","TryFrom<&[T]>","iroh::docs::PeerIdBytes"],["1.59.0 · source§impl<T, const N: usize> TryFrom<&mut [T]> for [T; N]where\n T: Copy,
Tries to create an array [T; N] by copying from a mutable slice &mut [T].\nSucceeds if slice.len() == N.
\n\nlet mut bytes: [u8; 3] = [1, 0, 2];\n\nlet bytes_head: [u8; 2] = <[u8; 2]>::try_from(&mut bytes[0..2]).unwrap();\nassert_eq!(1, u16::from_le_bytes(bytes_head));\n\nlet bytes_tail: [u8; 2] = (&mut bytes[1..3]).try_into().unwrap();\nassert_eq!(512, u16::from_le_bytes(bytes_tail));
\n§type Error = TryFromSliceError
The type returned in the event of a conversion error.","TryFrom<&mut [T]>","iroh::docs::PeerIdBytes"],["§impl<T, A, const N: usize> TryFrom<Vec<T, A>> for [T; N]where\n A: Allocator,
§fn try_from(vec: Vec<T, A>) -> Result<[T; N], Vec<T, A>>
Gets the entire contents of the Vec<T> as an array,\nif its size exactly matches that of the requested array.
\n§Examples
\nassert_eq!(vec![1, 2, 3].try_into(), Ok([1, 2, 3]));\nassert_eq!(<Vec<i32>>::new().try_into(), Ok([]));
\nIf the length doesn’t match, the input comes back in Err:
\n\nlet r: Result<[i32; 4], _> = (0..10).collect::<Vec<_>>().try_into();\nassert_eq!(r, Err(vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9]));
\nIf you’re fine with just getting a prefix of the Vec<T>,\nyou can call .truncate(N) first.
\n\nlet mut v = String::from(\"hello world\").into_bytes();\nv.sort();\nv.truncate(2);\nlet [a, b]: [_; 2] = v.try_into().unwrap();\nassert_eq!(a, b' ');\nassert_eq!(b, b'd');
\n","TryFrom>","iroh::docs::PeerIdBytes"],["1.48.0 · source§impl<T, A, const N: usize> TryFrom<Vec<T, A>> for [T; N]where\n A: Allocator,
source§fn try_from(vec: Vec<T, A>) -> Result<[T; N], Vec<T, A>>
Gets the entire contents of the Vec<T> as an array,\nif its size exactly matches that of the requested array.
\n§Examples
\nassert_eq!(vec![1, 2, 3].try_into(), Ok([1, 2, 3]));\nassert_eq!(<Vec<i32>>::new().try_into(), Ok([]));
\nIf the length doesn’t match, the input comes back in Err:
\n\nlet r: Result<[i32; 4], _> = (0..10).collect::<Vec<_>>().try_into();\nassert_eq!(r, Err(vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9]));
\nIf you’re fine with just getting a prefix of the Vec<T>,\nyou can call .truncate(N) first.
\n\nlet mut v = String::from(\"hello world\").into_bytes();\nv.sort();\nv.truncate(2);\nlet [a, b]: [_; 2] = v.try_into().unwrap();\nassert_eq!(a, b' ');\nassert_eq!(b, b'd');
\n","TryFrom>","iroh::docs::PeerIdBytes"],["§impl<Fut, T, E, const N: usize> TryJoin for [Fut; N]where\n Fut: IntoFuture<Output = Result<T, E>>,
§type Future = TryJoin<<Fut as IntoFuture>::IntoFuture, T, E, N>
Which kind of future are we turning this into?","TryJoin","iroh::docs::PeerIdBytes"],["§impl<const N: usize, T> Value for [T; N]where\n T: Value,
§type SelfType<'a> = [<T as Value>::SelfType<'a>; N]\nwhere\n [T; N]: 'a
SelfType<’a> must be the same type as Self with all lifetimes replaced with ’a§type AsBytes<'a> = Vec<u8>\nwhere\n [T; N]: 'a
§fn fixed_width() -> Option<usize>
Width of a fixed type, or None for variable width§fn from_bytes<'a>(data: &'a [u8]) -> [<T as Value>::SelfType<'a>; N]where\n [T; N]: 'a,
Deserializes data\nImplementations may return a view over data, or an owned type","Value","iroh::docs::PeerIdBytes"],["","ValueOrd","iroh::docs::PeerIdBytes"],["§impl<Z, const N: usize> Zeroize for [Z; N]where\n Z: Zeroize,
Impl [Zeroize] on arrays of types that impl [Zeroize].
\n","Zeroize","iroh::docs::PeerIdBytes"],["","Zip","iroh::docs::PeerIdBytes"],["source§impl<T, const N: usize> ConstParamTy for [T; N]where\n T: ConstParamTy,
","ConstParamTy","iroh::docs::PeerIdBytes"],["1.58.0 · source§impl<T, const N: usize> Copy for [T; N]where\n T: Copy,
","Copy","iroh::docs::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Eq for [T; N]where\n T: Eq,
","Eq","iroh::docs::PeerIdBytes"],["source§impl<T, const N: usize> StructuralPartialEq for [T; N]
","StructuralPartialEq","iroh::docs::PeerIdBytes"],["§impl<const N: usize, T> Unaligned for [T; N]where\n T: Unaligned,
","Unaligned","iroh::docs::PeerIdBytes"],["§impl<Z, const N: usize> ZeroizeOnDrop for [Z; N]where\n Z: ZeroizeOnDrop,
Impl [ZeroizeOnDrop] on arrays of types that impl [ZeroizeOnDrop].
\n","ZeroizeOnDrop","iroh::docs::PeerIdBytes"]],
-"iroh_docs":[["source§impl<T, const N: usize> [T; N]
1.55.0 · sourcepub fn map<F, U>(self, f: F) -> [U; N]where\n F: FnMut(T) -> U,
Returns an array of the same size as self, with function f applied to each element\nin order.
\nIf you don’t necessarily need a new fixed-size array, consider using\nIterator::map instead.
\n§Note on performance and stack usage
\nUnfortunately, usages of this method are currently not always optimized\nas well as they could be. This mainly concerns large arrays, as mapping\nover small arrays seem to be optimized just fine. Also note that in\ndebug mode (i.e. without any optimizations), this method can use a lot\nof stack space (a few times the size of the array or more).
\nTherefore, in performance-critical code, try to avoid using this method\non large arrays or check the emitted code. Also try to avoid chained\nmaps (e.g. arr.map(...).map(...)).
\nIn many cases, you can instead use Iterator::map by calling .iter()\nor .into_iter() on your array. [T; N]::map is only necessary if you\nreally need a new array of the same size as the result. Rust’s lazy\niterators tend to get optimized very well.
\n§Examples
\nlet x = [1, 2, 3];\nlet y = x.map(|v| v + 1);\nassert_eq!(y, [2, 3, 4]);\n\nlet x = [1, 2, 3];\nlet mut temp = 0;\nlet y = x.map(|v| { temp += 1; v * temp });\nassert_eq!(y, [1, 4, 9]);\n\nlet x = [\"Ferris\", \"Bueller's\", \"Day\", \"Off\"];\nlet y = x.map(|v| v.len());\nassert_eq!(y, [6, 9, 3, 3]);
\nsourcepub fn try_map<F, R>(\n self,\n f: F\n) -> <<R as Try>::Residual as Residual<[<R as Try>::Output; N]>>::TryType
🔬This is a nightly-only experimental API. (array_try_map)
A fallible function f applied to each element on array self in order to\nreturn an array the same size as self or the first error encountered.
\nThe return type of this function depends on the return type of the closure.\nIf you return Result<T, E> from the closure, you’ll get a Result<[T; N], E>.\nIf you return Option<T> from the closure, you’ll get an Option<[T; N]>.
\n§Examples
\n#![feature(array_try_map)]\n\nlet a = [\"1\", \"2\", \"3\"];\nlet b = a.try_map(|v| v.parse::<u32>()).unwrap().map(|v| v + 1);\nassert_eq!(b, [2, 3, 4]);\n\nlet a = [\"1\", \"2a\", \"3\"];\nlet b = a.try_map(|v| v.parse::<u32>());\nassert!(b.is_err());\n\nuse std::num::NonZero;\n\nlet z = [1, 2, 0, 3, 4];\nassert_eq!(z.try_map(NonZero::new), None);\n\nlet a = [1, 2, 3];\nlet b = a.try_map(NonZero::new);\nlet c = b.map(|x| x.map(NonZero::get));\nassert_eq!(c, Some(a));
\n1.57.0 (const: 1.57.0) · sourcepub const fn as_slice(&self) -> &[T]
Returns a slice containing the entire array. Equivalent to &s[..].
\n1.57.0 · sourcepub fn as_mut_slice(&mut self) -> &mut [T]
Returns a mutable slice containing the entire array. Equivalent to\n&mut s[..].
\n1.77.0 · sourcepub fn each_ref(&self) -> [&T; N]
Borrows each element and returns an array of references with the same\nsize as self.
\n§Example
\nlet floats = [3.1, 2.7, -1.0];\nlet float_refs: [&f64; 3] = floats.each_ref();\nassert_eq!(float_refs, [&3.1, &2.7, &-1.0]);
\nThis method is particularly useful if combined with other methods, like\nmap. This way, you can avoid moving the original\narray if its elements are not Copy.
\n\nlet strings = [\"Ferris\".to_string(), \"♥\".to_string(), \"Rust\".to_string()];\nlet is_ascii = strings.each_ref().map(|s| s.is_ascii());\nassert_eq!(is_ascii, [true, false, true]);\n\n// We can still access the original array: it has not been moved.\nassert_eq!(strings.len(), 3);
\n1.77.0 · sourcepub fn each_mut(&mut self) -> [&mut T; N]
Borrows each element mutably and returns an array of mutable references\nwith the same size as self.
\n§Example
\n\nlet mut floats = [3.1, 2.7, -1.0];\nlet float_refs: [&mut f64; 3] = floats.each_mut();\n*float_refs[0] = 0.0;\nassert_eq!(float_refs, [&mut 0.0, &mut 2.7, &mut -1.0]);\nassert_eq!(floats, [0.0, 2.7, -1.0]);
\nsourcepub fn split_array_ref<const M: usize>(&self) -> (&[T; M], &[T])
🔬This is a nightly-only experimental API. (split_array)
Divides one array reference into two at an index.
\nThe first will contain all indices from [0, M) (excluding\nthe index M itself) and the second will contain all\nindices from [M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet v = [1, 2, 3, 4, 5, 6];\n\n{\n let (left, right) = v.split_array_ref::<0>();\n assert_eq!(left, &[]);\n assert_eq!(right, &[1, 2, 3, 4, 5, 6]);\n}\n\n{\n let (left, right) = v.split_array_ref::<2>();\n assert_eq!(left, &[1, 2]);\n assert_eq!(right, &[3, 4, 5, 6]);\n}\n\n{\n let (left, right) = v.split_array_ref::<6>();\n assert_eq!(left, &[1, 2, 3, 4, 5, 6]);\n assert_eq!(right, &[]);\n}
\nsourcepub fn split_array_mut<const M: usize>(&mut self) -> (&mut [T; M], &mut [T])
🔬This is a nightly-only experimental API. (split_array)
Divides one mutable array reference into two at an index.
\nThe first will contain all indices from [0, M) (excluding\nthe index M itself) and the second will contain all\nindices from [M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet mut v = [1, 0, 3, 0, 5, 6];\nlet (left, right) = v.split_array_mut::<2>();\nassert_eq!(left, &mut [1, 0][..]);\nassert_eq!(right, &mut [3, 0, 5, 6]);\nleft[1] = 2;\nright[1] = 4;\nassert_eq!(v, [1, 2, 3, 4, 5, 6]);
\nsourcepub fn rsplit_array_ref<const M: usize>(&self) -> (&[T], &[T; M])
🔬This is a nightly-only experimental API. (split_array)
Divides one array reference into two at an index from the end.
\nThe first will contain all indices from [0, N - M) (excluding\nthe index N - M itself) and the second will contain all\nindices from [N - M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet v = [1, 2, 3, 4, 5, 6];\n\n{\n let (left, right) = v.rsplit_array_ref::<0>();\n assert_eq!(left, &[1, 2, 3, 4, 5, 6]);\n assert_eq!(right, &[]);\n}\n\n{\n let (left, right) = v.rsplit_array_ref::<2>();\n assert_eq!(left, &[1, 2, 3, 4]);\n assert_eq!(right, &[5, 6]);\n}\n\n{\n let (left, right) = v.rsplit_array_ref::<6>();\n assert_eq!(left, &[]);\n assert_eq!(right, &[1, 2, 3, 4, 5, 6]);\n}
\nsourcepub fn rsplit_array_mut<const M: usize>(&mut self) -> (&mut [T], &mut [T; M])
🔬This is a nightly-only experimental API. (split_array)
Divides one mutable array reference into two at an index from the end.
\nThe first will contain all indices from [0, N - M) (excluding\nthe index N - M itself) and the second will contain all\nindices from [N - M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet mut v = [1, 0, 3, 0, 5, 6];\nlet (left, right) = v.rsplit_array_mut::<4>();\nassert_eq!(left, &mut [1, 0]);\nassert_eq!(right, &mut [3, 0, 5, 6][..]);\nleft[1] = 2;\nright[1] = 4;\nassert_eq!(v, [1, 2, 3, 4, 5, 6]);
\n",0,"iroh_docs::sync::PeerIdBytes"],["source§impl<const N: usize> [u8; N]
sourcepub const fn as_ascii(&self) -> Option<&[AsciiChar; N]>
🔬This is a nightly-only experimental API. (ascii_char)
Converts this array of bytes into a array of ASCII characters,\nor returns None if any of the characters is non-ASCII.
\n§Examples
\n#![feature(ascii_char)]\n#![feature(const_option)]\n\nconst HEX_DIGITS: [std::ascii::Char; 16] =\n *b\"0123456789abcdef\".as_ascii().unwrap();\n\nassert_eq!(HEX_DIGITS[1].as_str(), \"1\");\nassert_eq!(HEX_DIGITS[10].as_str(), \"a\");
\nsourcepub const unsafe fn as_ascii_unchecked(&self) -> &[AsciiChar; N]
🔬This is a nightly-only experimental API. (ascii_char)
Converts this array of bytes into a array of ASCII characters,\nwithout checking whether they’re valid.
\n§Safety
\nEvery byte in the array must be in 0..=127, or else this is UB.
\n",0,"iroh_docs::sync::PeerIdBytes"],["§impl<T> Array for [T; 32]where\n T: Default,
§fn as_slice_mut(&mut self) -> &mut [T]
Gives a unique slice over the whole thing. Read more","Array","iroh_docs::sync::PeerIdBytes"],["","Array","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> AsBytes for [T; N]where\n T: AsBytes,
§fn write_to_prefix(&self, bytes: &mut [u8]) -> Option<()>
","AsBytes","iroh_docs::sync::PeerIdBytes"],["","AsBytes","iroh_docs::sync::PeerIdBytes"],["","AsMut<[T]>","iroh_docs::sync::PeerIdBytes"],["","AsRef<[T]>","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> BitView for [T; N]where\n T: BitStore,
Note that overly-large arrays may cause the conversions to fail.
\n§fn view_bits<O>(&self) -> &BitSlice<T, O>where\n O: BitOrder,
Views a memory region as an immutable bit-slice.§fn try_view_bits<O>(&self) -> Result<&BitSlice<T, O>, BitSpanError<T>>where\n O: BitOrder,
Attempts to view a memory region as an immutable bit-slice. Read more§fn view_bits_mut<O>(&mut self) -> &mut BitSlice<T, O>where\n O: BitOrder,
Views a memory region as a mutable bit-slice.§fn try_view_bits_mut<O>(\n &mut self\n) -> Result<&mut BitSlice<T, O>, BitSpanError<T>>where\n O: BitOrder,
Attempts to view a memory region as a mutable bit-slice. Read more","BitView","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> BitViewSized for [T; N]where\n T: BitStore,
§fn as_raw_slice(&self) -> &[<[T; N] as BitView>::Store]
Views the type as a slice of its elements.§fn as_raw_mut_slice(&mut self) -> &mut [<[T; N] as BitView>::Store]
Views the type as a mutable slice of its elements.§fn into_bitarray<O>(self) -> BitArray<Self, O>where\n O: BitOrder,
Wraps self in a BitArray.","BitViewSized","iroh_docs::sync::PeerIdBytes"],["","Borrow<[T]>","iroh_docs::sync::PeerIdBytes"],["1.4.0 · source§impl<T, const N: usize> BorrowMut<[T]> for [T; N]
source§fn borrow_mut(&mut self) -> &mut [T]
Mutably borrows from an owned value. Read more","BorrowMut<[T]>","iroh_docs::sync::PeerIdBytes"],["","Chain","iroh_docs::sync::PeerIdBytes"],["","Clone","iroh_docs::sync::PeerIdBytes"],["","Debug","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize> Decode for [u8; N]
Decodes a byte array from byte[n] as described in RFC4251 § 5:
\n\nA byte represents an arbitrary 8-bit value (octet). Fixed length\ndata is sometimes represented as an array of bytes, written\nbyte[n], where n is the number of bytes in the array.
\n
\n","Decode","iroh_docs::sync::PeerIdBytes"],["§impl<'a, T, const N: usize> DecodeValue<'a> for [T; N]where\n T: Decode<'a>,
§fn decode_value<R>(reader: &mut R, header: Header) -> Result<[T; N], Error>where\n R: Reader<'a>,
Attempt to decode this message using the provided [Reader].","DecodeValue<'a>","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["source§impl<'de, T> Deserialize<'de> for [T; 32]where\n T: Deserialize<'de>,
source§fn deserialize<D>(\n deserializer: D\n) -> Result<[T; 32], <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more","Deserialize<'de>","iroh_docs::sync::PeerIdBytes"],["source§impl<'de, const N: usize> Deserialize<'de> for [u8; N]
source§fn deserialize<D>(\n deserializer: D\n) -> Result<[u8; N], <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
","Deserialize<'de>","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize> Encode for [u8; N]
Encodes [u8; N] into byte[n] as described in RFC4251 § 5:
\n\nA byte represents an arbitrary 8-bit value (octet). Fixed length\ndata is sometimes represented as an array of bytes, written\nbyte[n], where n is the number of bytes in the array.
\n
\n§fn encoded_len(&self) -> Result<usize, Error>
Get the length of this type encoded in bytes, prior to Base64 encoding.§fn encode(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value using the provided [Writer].§fn encoded_len_prefixed(&self) -> Result<usize, Error>
Return the length of this type after encoding when prepended with a\nuint32 length prefix.§fn encode_prefixed(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value, first prepending a uint32 length prefix\nset to [Encode::encoded_len].","Encode","iroh_docs::sync::PeerIdBytes"],["","EncodeLabelSet","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> EncodeValue for [T; N]where\n T: Encode,
","EncodeValue","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["§impl<'a> FindToken<&'a u8> for [u8; 32]
§fn find_token(&self, token: &u8) -> bool
Returns true if self contains the token","FindToken<&'a u8>","iroh_docs::sync::PeerIdBytes"],["§impl FindToken<u8> for [u8; 32]
§fn find_token(&self, token: u8) -> bool
Returns true if self contains the token","FindToken","iroh_docs::sync::PeerIdBytes"],["","FixedTag","iroh_docs::sync::PeerIdBytes"],["","From<&Signature>","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["§impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>>> for [T; 32]
","From, B0>, B0>, B0>, B0>, B0>>>","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["","From>","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["source§impl From<NamespaceId> for [u8; 32]
source§fn from(value: NamespaceId) -> Self
Converts to this type from the input type.","From","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["","From>","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> FromBytes for [T; N]where\n T: FromBytes,
§fn slice_from_prefix(bytes: &[u8], count: usize) -> Option<(&[Self], &[u8])>where\n Self: Sized,
Interprets the prefix of the given bytes as a &[Self] with length\nequal to count without copying. Read more§fn slice_from_suffix(bytes: &[u8], count: usize) -> Option<(&[u8], &[Self])>where\n Self: Sized,
Interprets the suffix of the given bytes as a &[Self] with length\nequal to count without copying. Read more§fn read_from_prefix(bytes: &[u8]) -> Option<Self>where\n Self: Sized,
","FromBytes","iroh_docs::sync::PeerIdBytes"],["","FromHex","iroh_docs::sync::PeerIdBytes"],["","FromZeroes","iroh_docs::sync::PeerIdBytes"],["","Hash","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Hash for [T; N]where\n T: Hash,
The hash of an array is the same as that of the corresponding slice,\nas required by the Borrow implementation.
\n\nuse std::hash::BuildHasher;\n\nlet b = std::hash::RandomState::new();\nlet a: [u8; 3] = [0xa8, 0x3c, 0x09];\nlet s: &[u8] = &[0xa8, 0x3c, 0x09];\nassert_eq!(b.hash_one(a), b.hash_one(s));
\n","Hash","iroh_docs::sync::PeerIdBytes"],["","Index","iroh_docs::sync::PeerIdBytes"],["","IndexMut","iroh_docs::sync::PeerIdBytes"],["","InputLength","iroh_docs::sync::PeerIdBytes"],["1.53.0 · source§impl<T, const N: usize> IntoIterator for [T; N]
source§fn into_iter(self) -> <[T; N] as IntoIterator>::IntoIter
Creates a consuming iterator, that is, one that moves each value out of\nthe array (from start to end). The array cannot be used after calling\nthis unless T implements Copy, so the whole array is copied.
\nArrays have special behavior when calling .into_iter() prior to the\n2021 edition – see the array Editions section for more information.
\n","IntoIterator","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize> IntoResponse for [u8; N]
§fn into_response(self) -> Response<Body>
Create a response.","IntoResponse","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, const N: usize> Join for [Fut; N]where\n Fut: IntoFuture,
§type Output = [<Fut as IntoFuture>::Output; N]
The resulting output type.§type Future = Join<<Fut as IntoFuture>::IntoFuture, N>
The Future implementation returned by this method.","Join","iroh_docs::sync::PeerIdBytes"],["","Key","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> MaxSize for [T; N]where\n T: MaxSize,
§const POSTCARD_MAX_SIZE: usize = _
The maximum possible size that the serialization of this\ntype can have, in bytes.","MaxSize","iroh_docs::sync::PeerIdBytes"],["","Merge","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Ord for [T; N]where\n T: Ord,
Implements comparison of arrays lexicographically.
\n1.21.0 · source§fn max(self, other: Self) -> Selfwhere\n Self: Sized,
Compares and returns the maximum of two values. Read more","Ord","iroh_docs::sync::PeerIdBytes"],["","PartialEq<&[U]>","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, U, const N: usize> PartialEq<&mut [U]> for [T; N]where\n T: PartialEq<U>,
","PartialEq<&mut [U]>","iroh_docs::sync::PeerIdBytes"],["","PartialEq<[U]>","iroh_docs::sync::PeerIdBytes"],["","PartialEq<[U; N]>","iroh_docs::sync::PeerIdBytes"],["","PartialEq","iroh_docs::sync::PeerIdBytes"],["§impl<A, B, const N: usize, const M: usize> PartialEq<Vec<A, N>> for [B; M]where\n A: PartialEq<B>,
","PartialEq>","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> PartialOrd for [T; N]where\n T: PartialOrd,
Implements comparison of arrays lexicographically.
\nsource§fn le(&self, other: &[T; N]) -> bool
This method tests less than or equal to (for self and other) and is used by the <=\noperator. Read more","PartialOrd","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, const N: usize> Race for [Fut; N]where\n Fut: IntoFuture,
§type Output = <Fut as IntoFuture>::Output
The resulting output type.§type Future = Race<<Fut as IntoFuture>::IntoFuture, N>
Which kind of future are we turning this into?","Race","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, T, E, const N: usize> RaceOk for [Fut; N]where\n Fut: IntoFuture<Output = Result<T, E>>,
§type Future = RaceOk<<Fut as IntoFuture>::IntoFuture, T, E, N>
Which kind of future are we turning this into?","RaceOk","iroh_docs::sync::PeerIdBytes"],["","Schema","iroh_docs::sync::PeerIdBytes"],["source§impl<T> Serialize for [T; 32]where\n T: 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","iroh_docs::sync::PeerIdBytes"],["source§impl<const N: usize> Serialize for [u8; N]
source§fn serialize<S>(\n &self,\n serializer: S\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where\n S: Serializer,
","Serialize","iroh_docs::sync::PeerIdBytes"],["1.51.0 · source§impl<T, const N: usize> SlicePattern for [T; N]
","SlicePattern","iroh_docs::sync::PeerIdBytes"],["1.34.0 · source§impl<T, const N: usize> TryFrom<&[T]> for [T; N]where\n T: Copy,
Tries to create an array [T; N] by copying from a slice &[T]. Succeeds if\nslice.len() == N.
\n\nlet bytes: [u8; 3] = [1, 0, 2];\n\nlet bytes_head: [u8; 2] = <[u8; 2]>::try_from(&bytes[0..2]).unwrap();\nassert_eq!(1, u16::from_le_bytes(bytes_head));\n\nlet bytes_tail: [u8; 2] = bytes[1..3].try_into().unwrap();\nassert_eq!(512, u16::from_le_bytes(bytes_tail));
\n§type Error = TryFromSliceError
The type returned in the event of a conversion error.","TryFrom<&[T]>","iroh_docs::sync::PeerIdBytes"],["1.59.0 · source§impl<T, const N: usize> TryFrom<&mut [T]> for [T; N]where\n T: Copy,
Tries to create an array [T; N] by copying from a mutable slice &mut [T].\nSucceeds if slice.len() == N.
\n\nlet mut bytes: [u8; 3] = [1, 0, 2];\n\nlet bytes_head: [u8; 2] = <[u8; 2]>::try_from(&mut bytes[0..2]).unwrap();\nassert_eq!(1, u16::from_le_bytes(bytes_head));\n\nlet bytes_tail: [u8; 2] = (&mut bytes[1..3]).try_into().unwrap();\nassert_eq!(512, u16::from_le_bytes(bytes_tail));
\n§type Error = TryFromSliceError
The type returned in the event of a conversion error.","TryFrom<&mut [T]>","iroh_docs::sync::PeerIdBytes"],["§impl<T, A, const N: usize> TryFrom<Vec<T, A>> for [T; N]where\n A: Allocator,
§fn try_from(vec: Vec<T, A>) -> Result<[T; N], Vec<T, A>>
Gets the entire contents of the Vec<T> as an array,\nif its size exactly matches that of the requested array.
\n§Examples
\nassert_eq!(vec![1, 2, 3].try_into(), Ok([1, 2, 3]));\nassert_eq!(<Vec<i32>>::new().try_into(), Ok([]));
\nIf the length doesn’t match, the input comes back in Err:
\n\nlet r: Result<[i32; 4], _> = (0..10).collect::<Vec<_>>().try_into();\nassert_eq!(r, Err(vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9]));
\nIf you’re fine with just getting a prefix of the Vec<T>,\nyou can call .truncate(N) first.
\n\nlet mut v = String::from(\"hello world\").into_bytes();\nv.sort();\nv.truncate(2);\nlet [a, b]: [_; 2] = v.try_into().unwrap();\nassert_eq!(a, b' ');\nassert_eq!(b, b'd');
\n","TryFrom>","iroh_docs::sync::PeerIdBytes"],["1.48.0 · source§impl<T, A, const N: usize> TryFrom<Vec<T, A>> for [T; N]where\n A: Allocator,
source§fn try_from(vec: Vec<T, A>) -> Result<[T; N], Vec<T, A>>
Gets the entire contents of the Vec<T> as an array,\nif its size exactly matches that of the requested array.
\n§Examples
\nassert_eq!(vec![1, 2, 3].try_into(), Ok([1, 2, 3]));\nassert_eq!(<Vec<i32>>::new().try_into(), Ok([]));
\nIf the length doesn’t match, the input comes back in Err:
\n\nlet r: Result<[i32; 4], _> = (0..10).collect::<Vec<_>>().try_into();\nassert_eq!(r, Err(vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9]));
\nIf you’re fine with just getting a prefix of the Vec<T>,\nyou can call .truncate(N) first.
\n\nlet mut v = String::from(\"hello world\").into_bytes();\nv.sort();\nv.truncate(2);\nlet [a, b]: [_; 2] = v.try_into().unwrap();\nassert_eq!(a, b' ');\nassert_eq!(b, b'd');
\n","TryFrom>","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, T, E, const N: usize> TryJoin for [Fut; N]where\n Fut: IntoFuture<Output = Result<T, E>>,
§type Future = TryJoin<<Fut as IntoFuture>::IntoFuture, T, E, N>
Which kind of future are we turning this into?","TryJoin","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> Value for [T; N]where\n T: Value,
§type SelfType<'a> = [<T as Value>::SelfType<'a>; N]\nwhere\n [T; N]: 'a
SelfType<’a> must be the same type as Self with all lifetimes replaced with ’a§type AsBytes<'a> = Vec<u8>\nwhere\n [T; N]: 'a
§fn fixed_width() -> Option<usize>
Width of a fixed type, or None for variable width§fn from_bytes<'a>(data: &'a [u8]) -> [<T as Value>::SelfType<'a>; N]where\n [T; N]: 'a,
Deserializes data\nImplementations may return a view over data, or an owned type","Value","iroh_docs::sync::PeerIdBytes"],["","ValueOrd","iroh_docs::sync::PeerIdBytes"],["§impl<Z, const N: usize> Zeroize for [Z; N]where\n Z: Zeroize,
Impl [Zeroize] on arrays of types that impl [Zeroize].
\n","Zeroize","iroh_docs::sync::PeerIdBytes"],["","Zip","iroh_docs::sync::PeerIdBytes"],["source§impl<T, const N: usize> ConstParamTy for [T; N]where\n T: ConstParamTy,
","ConstParamTy","iroh_docs::sync::PeerIdBytes"],["1.58.0 · source§impl<T, const N: usize> Copy for [T; N]where\n T: Copy,
","Copy","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Eq for [T; N]where\n T: Eq,
","Eq","iroh_docs::sync::PeerIdBytes"],["source§impl<T, const N: usize> StructuralPartialEq for [T; N]
","StructuralPartialEq","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> Unaligned for [T; N]where\n T: Unaligned,
","Unaligned","iroh_docs::sync::PeerIdBytes"],["§impl<Z, const N: usize> ZeroizeOnDrop for [Z; N]where\n Z: ZeroizeOnDrop,
Impl [ZeroizeOnDrop] on arrays of types that impl [ZeroizeOnDrop].
\n","ZeroizeOnDrop","iroh_docs::sync::PeerIdBytes"]]
+"iroh_docs":[["source§impl<T, const N: usize> [T; N]
1.55.0 · sourcepub fn map<F, U>(self, f: F) -> [U; N]where\n F: FnMut(T) -> U,
Returns an array of the same size as self, with function f applied to each element\nin order.
\nIf you don’t necessarily need a new fixed-size array, consider using\nIterator::map instead.
\n§Note on performance and stack usage
\nUnfortunately, usages of this method are currently not always optimized\nas well as they could be. This mainly concerns large arrays, as mapping\nover small arrays seem to be optimized just fine. Also note that in\ndebug mode (i.e. without any optimizations), this method can use a lot\nof stack space (a few times the size of the array or more).
\nTherefore, in performance-critical code, try to avoid using this method\non large arrays or check the emitted code. Also try to avoid chained\nmaps (e.g. arr.map(...).map(...)).
\nIn many cases, you can instead use Iterator::map by calling .iter()\nor .into_iter() on your array. [T; N]::map is only necessary if you\nreally need a new array of the same size as the result. Rust’s lazy\niterators tend to get optimized very well.
\n§Examples
\nlet x = [1, 2, 3];\nlet y = x.map(|v| v + 1);\nassert_eq!(y, [2, 3, 4]);\n\nlet x = [1, 2, 3];\nlet mut temp = 0;\nlet y = x.map(|v| { temp += 1; v * temp });\nassert_eq!(y, [1, 4, 9]);\n\nlet x = [\"Ferris\", \"Bueller's\", \"Day\", \"Off\"];\nlet y = x.map(|v| v.len());\nassert_eq!(y, [6, 9, 3, 3]);
\nsourcepub fn try_map<F, R>(\n self,\n f: F\n) -> <<R as Try>::Residual as Residual<[<R as Try>::Output; N]>>::TryType
🔬This is a nightly-only experimental API. (array_try_map)
A fallible function f applied to each element on array self in order to\nreturn an array the same size as self or the first error encountered.
\nThe return type of this function depends on the return type of the closure.\nIf you return Result<T, E> from the closure, you’ll get a Result<[T; N], E>.\nIf you return Option<T> from the closure, you’ll get an Option<[T; N]>.
\n§Examples
\n#![feature(array_try_map)]\n\nlet a = [\"1\", \"2\", \"3\"];\nlet b = a.try_map(|v| v.parse::<u32>()).unwrap().map(|v| v + 1);\nassert_eq!(b, [2, 3, 4]);\n\nlet a = [\"1\", \"2a\", \"3\"];\nlet b = a.try_map(|v| v.parse::<u32>());\nassert!(b.is_err());\n\nuse std::num::NonZero;\n\nlet z = [1, 2, 0, 3, 4];\nassert_eq!(z.try_map(NonZero::new), None);\n\nlet a = [1, 2, 3];\nlet b = a.try_map(NonZero::new);\nlet c = b.map(|x| x.map(NonZero::get));\nassert_eq!(c, Some(a));
\n1.57.0 (const: 1.57.0) · sourcepub const fn as_slice(&self) -> &[T]
Returns a slice containing the entire array. Equivalent to &s[..].
\n1.57.0 · sourcepub fn as_mut_slice(&mut self) -> &mut [T]
Returns a mutable slice containing the entire array. Equivalent to\n&mut s[..].
\n1.77.0 · sourcepub fn each_ref(&self) -> [&T; N]
Borrows each element and returns an array of references with the same\nsize as self.
\n§Example
\nlet floats = [3.1, 2.7, -1.0];\nlet float_refs: [&f64; 3] = floats.each_ref();\nassert_eq!(float_refs, [&3.1, &2.7, &-1.0]);
\nThis method is particularly useful if combined with other methods, like\nmap. This way, you can avoid moving the original\narray if its elements are not Copy.
\n\nlet strings = [\"Ferris\".to_string(), \"♥\".to_string(), \"Rust\".to_string()];\nlet is_ascii = strings.each_ref().map(|s| s.is_ascii());\nassert_eq!(is_ascii, [true, false, true]);\n\n// We can still access the original array: it has not been moved.\nassert_eq!(strings.len(), 3);
\n1.77.0 · sourcepub fn each_mut(&mut self) -> [&mut T; N]
Borrows each element mutably and returns an array of mutable references\nwith the same size as self.
\n§Example
\n\nlet mut floats = [3.1, 2.7, -1.0];\nlet float_refs: [&mut f64; 3] = floats.each_mut();\n*float_refs[0] = 0.0;\nassert_eq!(float_refs, [&mut 0.0, &mut 2.7, &mut -1.0]);\nassert_eq!(floats, [0.0, 2.7, -1.0]);
\nsourcepub fn split_array_ref<const M: usize>(&self) -> (&[T; M], &[T])
🔬This is a nightly-only experimental API. (split_array)
Divides one array reference into two at an index.
\nThe first will contain all indices from [0, M) (excluding\nthe index M itself) and the second will contain all\nindices from [M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet v = [1, 2, 3, 4, 5, 6];\n\n{\n let (left, right) = v.split_array_ref::<0>();\n assert_eq!(left, &[]);\n assert_eq!(right, &[1, 2, 3, 4, 5, 6]);\n}\n\n{\n let (left, right) = v.split_array_ref::<2>();\n assert_eq!(left, &[1, 2]);\n assert_eq!(right, &[3, 4, 5, 6]);\n}\n\n{\n let (left, right) = v.split_array_ref::<6>();\n assert_eq!(left, &[1, 2, 3, 4, 5, 6]);\n assert_eq!(right, &[]);\n}
\nsourcepub fn split_array_mut<const M: usize>(&mut self) -> (&mut [T; M], &mut [T])
🔬This is a nightly-only experimental API. (split_array)
Divides one mutable array reference into two at an index.
\nThe first will contain all indices from [0, M) (excluding\nthe index M itself) and the second will contain all\nindices from [M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet mut v = [1, 0, 3, 0, 5, 6];\nlet (left, right) = v.split_array_mut::<2>();\nassert_eq!(left, &mut [1, 0][..]);\nassert_eq!(right, &mut [3, 0, 5, 6]);\nleft[1] = 2;\nright[1] = 4;\nassert_eq!(v, [1, 2, 3, 4, 5, 6]);
\nsourcepub fn rsplit_array_ref<const M: usize>(&self) -> (&[T], &[T; M])
🔬This is a nightly-only experimental API. (split_array)
Divides one array reference into two at an index from the end.
\nThe first will contain all indices from [0, N - M) (excluding\nthe index N - M itself) and the second will contain all\nindices from [N - M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet v = [1, 2, 3, 4, 5, 6];\n\n{\n let (left, right) = v.rsplit_array_ref::<0>();\n assert_eq!(left, &[1, 2, 3, 4, 5, 6]);\n assert_eq!(right, &[]);\n}\n\n{\n let (left, right) = v.rsplit_array_ref::<2>();\n assert_eq!(left, &[1, 2, 3, 4]);\n assert_eq!(right, &[5, 6]);\n}\n\n{\n let (left, right) = v.rsplit_array_ref::<6>();\n assert_eq!(left, &[]);\n assert_eq!(right, &[1, 2, 3, 4, 5, 6]);\n}
\nsourcepub fn rsplit_array_mut<const M: usize>(&mut self) -> (&mut [T], &mut [T; M])
🔬This is a nightly-only experimental API. (split_array)
Divides one mutable array reference into two at an index from the end.
\nThe first will contain all indices from [0, N - M) (excluding\nthe index N - M itself) and the second will contain all\nindices from [N - M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet mut v = [1, 0, 3, 0, 5, 6];\nlet (left, right) = v.rsplit_array_mut::<4>();\nassert_eq!(left, &mut [1, 0]);\nassert_eq!(right, &mut [3, 0, 5, 6][..]);\nleft[1] = 2;\nright[1] = 4;\nassert_eq!(v, [1, 2, 3, 4, 5, 6]);
\n",0,"iroh_docs::sync::PeerIdBytes"],["source§impl<const N: usize> [u8; N]
sourcepub const fn as_ascii(&self) -> Option<&[AsciiChar; N]>
🔬This is a nightly-only experimental API. (ascii_char)
Converts this array of bytes into a array of ASCII characters,\nor returns None if any of the characters is non-ASCII.
\n§Examples
\n#![feature(ascii_char)]\n#![feature(const_option)]\n\nconst HEX_DIGITS: [std::ascii::Char; 16] =\n *b\"0123456789abcdef\".as_ascii().unwrap();\n\nassert_eq!(HEX_DIGITS[1].as_str(), \"1\");\nassert_eq!(HEX_DIGITS[10].as_str(), \"a\");
\nsourcepub const unsafe fn as_ascii_unchecked(&self) -> &[AsciiChar; N]
🔬This is a nightly-only experimental API. (ascii_char)
Converts this array of bytes into a array of ASCII characters,\nwithout checking whether they’re valid.
\n§Safety
\nEvery byte in the array must be in 0..=127, or else this is UB.
\n",0,"iroh_docs::sync::PeerIdBytes"],["§impl<T> Array for [T; 32]where\n T: Default,
§fn as_slice_mut(&mut self) -> &mut [T]
Gives a unique slice over the whole thing. Read more","Array","iroh_docs::sync::PeerIdBytes"],["","Array","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> AsBytes for [T; N]where\n T: AsBytes,
§fn write_to_prefix(&self, bytes: &mut [u8]) -> Option<()>
","AsBytes","iroh_docs::sync::PeerIdBytes"],["","AsBytes","iroh_docs::sync::PeerIdBytes"],["","AsMut<[T]>","iroh_docs::sync::PeerIdBytes"],["","AsRef<[T]>","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> BitView for [T; N]where\n T: BitStore,
Note that overly-large arrays may cause the conversions to fail.
\n§fn view_bits<O>(&self) -> &BitSlice<T, O>where\n O: BitOrder,
Views a memory region as an immutable bit-slice.§fn try_view_bits<O>(&self) -> Result<&BitSlice<T, O>, BitSpanError<T>>where\n O: BitOrder,
Attempts to view a memory region as an immutable bit-slice. Read more§fn view_bits_mut<O>(&mut self) -> &mut BitSlice<T, O>where\n O: BitOrder,
Views a memory region as a mutable bit-slice.§fn try_view_bits_mut<O>(\n &mut self\n) -> Result<&mut BitSlice<T, O>, BitSpanError<T>>where\n O: BitOrder,
Attempts to view a memory region as a mutable bit-slice. Read more","BitView","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> BitViewSized for [T; N]where\n T: BitStore,
§fn as_raw_slice(&self) -> &[<[T; N] as BitView>::Store]
Views the type as a slice of its elements.§fn as_raw_mut_slice(&mut self) -> &mut [<[T; N] as BitView>::Store]
Views the type as a mutable slice of its elements.§fn into_bitarray<O>(self) -> BitArray<Self, O>where\n O: BitOrder,
Wraps self in a BitArray.","BitViewSized","iroh_docs::sync::PeerIdBytes"],["","Borrow<[T]>","iroh_docs::sync::PeerIdBytes"],["1.4.0 · source§impl<T, const N: usize> BorrowMut<[T]> for [T; N]
source§fn borrow_mut(&mut self) -> &mut [T]
Mutably borrows from an owned value. Read more","BorrowMut<[T]>","iroh_docs::sync::PeerIdBytes"],["","Chain","iroh_docs::sync::PeerIdBytes"],["","Clone","iroh_docs::sync::PeerIdBytes"],["","Debug","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize> Decode for [u8; N]
Decodes a byte array from byte[n] as described in RFC4251 § 5:
\n\nA byte represents an arbitrary 8-bit value (octet). Fixed length\ndata is sometimes represented as an array of bytes, written\nbyte[n], where n is the number of bytes in the array.
\n
\n","Decode","iroh_docs::sync::PeerIdBytes"],["§impl<'a, T, const N: usize> DecodeValue<'a> for [T; N]where\n T: Decode<'a>,
§fn decode_value<R>(reader: &mut R, header: Header) -> Result<[T; N], Error>where\n R: Reader<'a>,
Attempt to decode this message using the provided [Reader].","DecodeValue<'a>","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["source§impl<'de, T> Deserialize<'de> for [T; 32]where\n T: Deserialize<'de>,
source§fn deserialize<D>(\n deserializer: D\n) -> Result<[T; 32], <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more","Deserialize<'de>","iroh_docs::sync::PeerIdBytes"],["source§impl<'de, const N: usize> Deserialize<'de> for [u8; N]
source§fn deserialize<D>(\n deserializer: D\n) -> Result<[u8; N], <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
","Deserialize<'de>","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize> Encode for [u8; N]
Encodes [u8; N] into byte[n] as described in RFC4251 § 5:
\n\nA byte represents an arbitrary 8-bit value (octet). Fixed length\ndata is sometimes represented as an array of bytes, written\nbyte[n], where n is the number of bytes in the array.
\n
\n§fn encoded_len(&self) -> Result<usize, Error>
Get the length of this type encoded in bytes, prior to Base64 encoding.§fn encode(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value using the provided [Writer].§fn encoded_len_prefixed(&self) -> Result<usize, Error>
Return the length of this type after encoding when prepended with a\nuint32 length prefix.§fn encode_prefixed(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value, first prepending a uint32 length prefix\nset to [Encode::encoded_len].","Encode","iroh_docs::sync::PeerIdBytes"],["","EncodeLabelSet","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> EncodeValue for [T; N]where\n T: Encode,
","EncodeValue","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["§impl<'a> FindToken<&'a u8> for [u8; 32]
§fn find_token(&self, token: &u8) -> bool
Returns true if self contains the token","FindToken<&'a u8>","iroh_docs::sync::PeerIdBytes"],["§impl FindToken<u8> for [u8; 32]
§fn find_token(&self, token: u8) -> bool
Returns true if self contains the token","FindToken","iroh_docs::sync::PeerIdBytes"],["","FixedTag","iroh_docs::sync::PeerIdBytes"],["","From<&Signature>","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["§impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>>> for [T; 32]
","From, B0>, B0>, B0>, B0>, B0>>>","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["","From>","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["source§impl From<NamespaceId> for [u8; 32]
source§fn from(value: NamespaceId) -> Self
Converts to this type from the input type.","From","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["","From>","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> FromBytes for [T; N]where\n T: FromBytes,
§fn slice_from_prefix(bytes: &[u8], count: usize) -> Option<(&[Self], &[u8])>where\n Self: Sized,
Interprets the prefix of the given bytes as a &[Self] with length\nequal to count without copying. Read more§fn slice_from_suffix(bytes: &[u8], count: usize) -> Option<(&[u8], &[Self])>where\n Self: Sized,
Interprets the suffix of the given bytes as a &[Self] with length\nequal to count without copying. Read more§fn read_from_prefix(bytes: &[u8]) -> Option<Self>where\n Self: Sized,
","FromBytes","iroh_docs::sync::PeerIdBytes"],["","FromHex","iroh_docs::sync::PeerIdBytes"],["","FromZeroes","iroh_docs::sync::PeerIdBytes"],["","Hash","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Hash for [T; N]where\n T: Hash,
The hash of an array is the same as that of the corresponding slice,\nas required by the Borrow implementation.
\n\nuse std::hash::BuildHasher;\n\nlet b = std::hash::RandomState::new();\nlet a: [u8; 3] = [0xa8, 0x3c, 0x09];\nlet s: &[u8] = &[0xa8, 0x3c, 0x09];\nassert_eq!(b.hash_one(a), b.hash_one(s));
\n","Hash","iroh_docs::sync::PeerIdBytes"],["","Index","iroh_docs::sync::PeerIdBytes"],["","IndexMut","iroh_docs::sync::PeerIdBytes"],["","InputLength","iroh_docs::sync::PeerIdBytes"],["1.53.0 · source§impl<T, const N: usize> IntoIterator for [T; N]
source§fn into_iter(self) -> <[T; N] as IntoIterator>::IntoIter
Creates a consuming iterator, that is, one that moves each value out of\nthe array (from start to end). The array cannot be used after calling\nthis unless T implements Copy, so the whole array is copied.
\nArrays have special behavior when calling .into_iter() prior to the\n2021 edition – see the array Editions section for more information.
\n","IntoIterator","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize> IntoResponse for [u8; N]
§fn into_response(self) -> Response<Body>
Create a response.","IntoResponse","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, const N: usize> Join for [Fut; N]where\n Fut: IntoFuture,
§type Output = [<Fut as IntoFuture>::Output; N]
The resulting output type.§type Future = Join<<Fut as IntoFuture>::IntoFuture, N>
The Future implementation returned by this method.","Join","iroh_docs::sync::PeerIdBytes"],["","Key","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> MaxSize for [T; N]where\n T: MaxSize,
§const POSTCARD_MAX_SIZE: usize = _
The maximum possible size that the serialization of this\ntype can have, in bytes.","MaxSize","iroh_docs::sync::PeerIdBytes"],["","Merge","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Ord for [T; N]where\n T: Ord,
Implements comparison of arrays lexicographically.
\n1.21.0 · source§fn max(self, other: Self) -> Selfwhere\n Self: Sized,
Compares and returns the maximum of two values. Read more","Ord","iroh_docs::sync::PeerIdBytes"],["","PartialEq<&[U]>","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, U, const N: usize> PartialEq<&mut [U]> for [T; N]where\n T: PartialEq<U>,
","PartialEq<&mut [U]>","iroh_docs::sync::PeerIdBytes"],["","PartialEq<[U]>","iroh_docs::sync::PeerIdBytes"],["","PartialEq<[U; N]>","iroh_docs::sync::PeerIdBytes"],["","PartialEq","iroh_docs::sync::PeerIdBytes"],["§impl<A, B, const N: usize, const M: usize> PartialEq<Vec<A, N>> for [B; M]where\n A: PartialEq<B>,
","PartialEq>","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> PartialOrd for [T; N]where\n T: PartialOrd,
Implements comparison of arrays lexicographically.
\nsource§fn le(&self, other: &[T; N]) -> bool
This method tests less than or equal to (for self and other) and is used by the <=\noperator. Read more","PartialOrd","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, const N: usize> Race for [Fut; N]where\n Fut: IntoFuture,
§type Output = <Fut as IntoFuture>::Output
The resulting output type.§type Future = Race<<Fut as IntoFuture>::IntoFuture, N>
Which kind of future are we turning this into?","Race","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, T, E, const N: usize> RaceOk for [Fut; N]where\n Fut: IntoFuture<Output = Result<T, E>>,
§type Future = RaceOk<<Fut as IntoFuture>::IntoFuture, T, E, N>
Which kind of future are we turning this into?","RaceOk","iroh_docs::sync::PeerIdBytes"],["","Schema","iroh_docs::sync::PeerIdBytes"],["source§impl<T> Serialize for [T; 32]where\n T: 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","iroh_docs::sync::PeerIdBytes"],["source§impl<const N: usize> Serialize for [u8; N]
source§fn serialize<S>(\n &self,\n serializer: S\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where\n S: Serializer,
","Serialize","iroh_docs::sync::PeerIdBytes"],["1.51.0 · source§impl<T, const N: usize> SlicePattern for [T; N]
","SlicePattern","iroh_docs::sync::PeerIdBytes"],["1.34.0 · source§impl<T, const N: usize> TryFrom<&[T]> for [T; N]where\n T: Copy,
Tries to create an array [T; N] by copying from a slice &[T]. Succeeds if\nslice.len() == N.
\n\nlet bytes: [u8; 3] = [1, 0, 2];\n\nlet bytes_head: [u8; 2] = <[u8; 2]>::try_from(&bytes[0..2]).unwrap();\nassert_eq!(1, u16::from_le_bytes(bytes_head));\n\nlet bytes_tail: [u8; 2] = bytes[1..3].try_into().unwrap();\nassert_eq!(512, u16::from_le_bytes(bytes_tail));
\n§type Error = TryFromSliceError
The type returned in the event of a conversion error.","TryFrom<&[T]>","iroh_docs::sync::PeerIdBytes"],["1.59.0 · source§impl<T, const N: usize> TryFrom<&mut [T]> for [T; N]where\n T: Copy,
Tries to create an array [T; N] by copying from a mutable slice &mut [T].\nSucceeds if slice.len() == N.
\n\nlet mut bytes: [u8; 3] = [1, 0, 2];\n\nlet bytes_head: [u8; 2] = <[u8; 2]>::try_from(&mut bytes[0..2]).unwrap();\nassert_eq!(1, u16::from_le_bytes(bytes_head));\n\nlet bytes_tail: [u8; 2] = (&mut bytes[1..3]).try_into().unwrap();\nassert_eq!(512, u16::from_le_bytes(bytes_tail));
\n§type Error = TryFromSliceError
The type returned in the event of a conversion error.","TryFrom<&mut [T]>","iroh_docs::sync::PeerIdBytes"],["§impl<T, A, const N: usize> TryFrom<Vec<T, A>> for [T; N]where\n A: Allocator,
§fn try_from(vec: Vec<T, A>) -> Result<[T; N], Vec<T, A>>
Gets the entire contents of the Vec<T> as an array,\nif its size exactly matches that of the requested array.
\n§Examples
\nassert_eq!(vec![1, 2, 3].try_into(), Ok([1, 2, 3]));\nassert_eq!(<Vec<i32>>::new().try_into(), Ok([]));
\nIf the length doesn’t match, the input comes back in Err:
\n\nlet r: Result<[i32; 4], _> = (0..10).collect::<Vec<_>>().try_into();\nassert_eq!(r, Err(vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9]));
\nIf you’re fine with just getting a prefix of the Vec<T>,\nyou can call .truncate(N) first.
\n\nlet mut v = String::from(\"hello world\").into_bytes();\nv.sort();\nv.truncate(2);\nlet [a, b]: [_; 2] = v.try_into().unwrap();\nassert_eq!(a, b' ');\nassert_eq!(b, b'd');
\n","TryFrom>","iroh_docs::sync::PeerIdBytes"],["1.48.0 · source§impl<T, A, const N: usize> TryFrom<Vec<T, A>> for [T; N]where\n A: Allocator,
source§fn try_from(vec: Vec<T, A>) -> Result<[T; N], Vec<T, A>>
Gets the entire contents of the Vec<T> as an array,\nif its size exactly matches that of the requested array.
\n§Examples
\nassert_eq!(vec![1, 2, 3].try_into(), Ok([1, 2, 3]));\nassert_eq!(<Vec<i32>>::new().try_into(), Ok([]));
\nIf the length doesn’t match, the input comes back in Err:
\n\nlet r: Result<[i32; 4], _> = (0..10).collect::<Vec<_>>().try_into();\nassert_eq!(r, Err(vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9]));
\nIf you’re fine with just getting a prefix of the Vec<T>,\nyou can call .truncate(N) first.
\n\nlet mut v = String::from(\"hello world\").into_bytes();\nv.sort();\nv.truncate(2);\nlet [a, b]: [_; 2] = v.try_into().unwrap();\nassert_eq!(a, b' ');\nassert_eq!(b, b'd');
\n","TryFrom>","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, T, E, const N: usize> TryJoin for [Fut; N]where\n Fut: IntoFuture<Output = Result<T, E>>,
§type Future = TryJoin<<Fut as IntoFuture>::IntoFuture, T, E, N>
Which kind of future are we turning this into?","TryJoin","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> Value for [T; N]where\n T: Value,
§type SelfType<'a> = [<T as Value>::SelfType<'a>; N]\nwhere\n [T; N]: 'a
SelfType<’a> must be the same type as Self with all lifetimes replaced with ’a§type AsBytes<'a> = Vec<u8>\nwhere\n [T; N]: 'a
§fn fixed_width() -> Option<usize>
Width of a fixed type, or None for variable width§fn from_bytes<'a>(data: &'a [u8]) -> [<T as Value>::SelfType<'a>; N]where\n [T; N]: 'a,
Deserializes data\nImplementations may return a view over data, or an owned type","Value","iroh_docs::sync::PeerIdBytes"],["","ValueOrd","iroh_docs::sync::PeerIdBytes"],["§impl<Z, const N: usize> Zeroize for [Z; N]where\n Z: Zeroize,
Impl [Zeroize] on arrays of types that impl [Zeroize].
\n","Zeroize","iroh_docs::sync::PeerIdBytes"],["","Zip","iroh_docs::sync::PeerIdBytes"],["source§impl<T, const N: usize> ConstParamTy for [T; N]where\n T: ConstParamTy,
","ConstParamTy","iroh_docs::sync::PeerIdBytes"],["1.58.0 · source§impl<T, const N: usize> Copy for [T; N]where\n T: Copy,
","Copy","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Eq for [T; N]where\n T: Eq,
","Eq","iroh_docs::sync::PeerIdBytes"],["source§impl<T, const N: usize> StructuralPartialEq for [T; N]
","StructuralPartialEq","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> Unaligned for [T; N]where\n T: Unaligned,
","Unaligned","iroh_docs::sync::PeerIdBytes"],["§impl<Z, const N: usize> ZeroizeOnDrop for [Z; N]where\n Z: ZeroizeOnDrop,
Impl [ZeroizeOnDrop] on arrays of types that impl [ZeroizeOnDrop].
\n","ZeroizeOnDrop","iroh_docs::sync::PeerIdBytes"]]
};if (window.register_type_impls) {window.register_type_impls(type_impls);} else {window.pending_type_impls = type_impls;}})()
\ No newline at end of file
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where
diff --git a/pr/2595/docs/iroh_blobs/provider/enum.AddProgress.html b/pr/2595/docs/iroh_blobs/provider/enum.AddProgress.html
index f66b9300f3..c70929bdee 100644
--- a/pr/2595/docs/iroh_blobs/provider/enum.AddProgress.html
+++ b/pr/2595/docs/iroh_blobs/provider/enum.AddProgress.html
@@ -17,7 +17,7 @@
format: BlobFormat,
tag: Tag,
},
- Abort(RpcError),
+ Abort(RpcError),
}Expand description
Progress updates for the add operation.
Variants§
§Found
An item was found with name name, from now on referred to via id
Fields
§Abort(RpcError)
We got an error and need to abort.
This will be the last message in the stream.
Trait Implementations§
source§impl Debug for AddProgress
source§impl<'de> Deserialize<'de> for AddProgress
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl Serialize for AddProgress
source§fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where
diff --git a/pr/2595/docs/iroh_blobs/store/enum.ConsistencyCheckProgress.html b/pr/2595/docs/iroh_blobs/store/enum.ConsistencyCheckProgress.html
index ad14d9476a..46469fe5e2 100644
--- a/pr/2595/docs/iroh_blobs/store/enum.ConsistencyCheckProgress.html
+++ b/pr/2595/docs/iroh_blobs/store/enum.ConsistencyCheckProgress.html
@@ -6,7 +6,7 @@
level: ReportLevel,
},
Done,
- Abort(RpcError),
+ Abort(RpcError),
}Expand description
Progress updates for the validate operation
Variants§
§level: ReportLevelThe level of the message
§Done
Consistency check ended
-§Abort(RpcError)
We got an error and need to abort.
+§Abort(RpcError)
We got an error and need to abort.
Trait Implementations§
source§impl Debug for ConsistencyCheckProgress
source§impl<'de> Deserialize<'de> for ConsistencyCheckProgress
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreAuto Trait Implementations§
§impl Freeze for ConsistencyCheckProgress
§impl RefUnwindSafe for ConsistencyCheckProgress
§impl Send for ConsistencyCheckProgress
§impl Sync for ConsistencyCheckProgress
§impl Unpin for ConsistencyCheckProgress
§impl UnwindSafe for ConsistencyCheckProgress
Blanket Implementations§
source§impl<T> Any for Twhere
diff --git a/pr/2595/docs/iroh_blobs/store/enum.ValidateProgress.html b/pr/2595/docs/iroh_blobs/store/enum.ValidateProgress.html
index 76a8f01e97..f4494f3a46 100644
--- a/pr/2595/docs/iroh_blobs/store/enum.ValidateProgress.html
+++ b/pr/2595/docs/iroh_blobs/store/enum.ValidateProgress.html
@@ -31,7 +31,7 @@
ranges: RangeSpec,
},
AllDone,
- Abort(RpcError),
+ Abort(RpcError),
}Expand description
Progress updates for the validate operation
Variants§
§Starting
started validating
Fields
§total: u64The total number of entries to validate
@@ -62,7 +62,7 @@ Otherwise it might be an url or something else to uniquely identify the entry.
§AllDone
We are done with the whole operation.
-§Abort(RpcError)
We got an error and need to abort.
+§Abort(RpcError)
We got an error and need to abort.
Trait Implementations§
source§impl Debug for ValidateProgress
source§impl<'de> Deserialize<'de> for ValidateProgress
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreAuto Trait Implementations§
§impl Freeze for ValidateProgress
§impl RefUnwindSafe for ValidateProgress
§impl Send for ValidateProgress
§impl Sync for ValidateProgress
§impl Unpin for ValidateProgress
§impl UnwindSafe for ValidateProgress
Blanket Implementations§
source§impl<T> Any for Twhere
diff --git a/pr/2595/docs/iroh_blobs/struct.Hash.html b/pr/2595/docs/iroh_blobs/struct.Hash.html
index 260e50d4b9..ba12d52876 100644
--- a/pr/2595/docs/iroh_blobs/struct.Hash.html
+++ b/pr/2595/docs/iroh_blobs/struct.Hash.html
@@ -1,36 +1,36 @@
-Hash in iroh_blobs - Rust Struct iroh_blobs::Hash
pub struct Hash(/* private fields */);
Expand description
Hash type used throughout.
-Implementations§
§impl Hash
pub const fn from_bytes(bytes: [u8; 32]) -> Hash
Create a Hash from its raw bytes representation.
-pub fn fmt_short(&self) -> String
Convert to a base32 string limited to the first 10 bytes for a friendly string
+
Hash in iroh_blobs - Rust Struct iroh_blobs::Hash
source · pub struct Hash(/* private fields */);
Expand description
Hash type used throughout.
+Implementations§
Trait Implementations§
Trait Implementations§
source§impl<'de> Deserialize<'de> for Hash
source§fn deserialize<D>(
deserializer: D
) -> Result<Hash, <D as Deserializer<'de>>::Error>where
- D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl FromIterator<Hash> for HashSeq
§impl Hash for Hash
§fn hash<__H>(&self, state: &mut __H)where
+ D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl FromIterator<Hash> for HashSeq
§impl MaxSize for Hash
§const POSTCARD_MAX_SIZE: usize = 32usize
The maximum possible size that the serialization of this
-type can have, in bytes.source§impl MaxSize for Hash
source§const POSTCARD_MAX_SIZE: usize = 32usize
The maximum possible size that the serialization of this
+type can have, in bytes.source§impl Ord for Hash
source§impl PartialEq for Hash
§impl PartialOrd for Hash
source§impl PartialOrd for Hash
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 <=
operator. Read moresource§impl Serialize for Hash
source§fn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
- S: Serializer,
Serialize this value into the given Serde serializer. Read more§impl Value for Hash
§type SelfType<'a> = Hash
SelfType<’a> must be the same type as Self with all lifetimes replaced with ’a§type AsBytes<'a> = &'a [u8; 32]
§fn fixed_width() -> Option<usize>
Width of a fixed type, or None for variable width§fn from_bytes<'a>(data: &'a [u8]) -> <Hash as Value>::SelfType<'a>where
+ S: Serializer,
Serialize this value into the given Serde serializer. Read moresource§impl Value for Hash
§type SelfType<'a> = Hash
SelfType<’a> must be the same type as Self with all lifetimes replaced with ’a§type AsBytes<'a> = &'a [u8; 32]
source§fn fixed_width() -> Option<usize>
Width of a fixed type, or None for variable width§impl Copy for Hash
§impl Eq for Hash
§impl StructuralPartialEq for Hash
Auto Trait Implementations§
§impl Freeze for Hash
§impl RefUnwindSafe for Hash
§impl Send for Hash
§impl Sync for Hash
§impl Unpin for Hash
§impl UnwindSafe for Hash
Blanket Implementations§
source§impl Copy for Hash
source§impl Eq for Hash
source§impl StructuralPartialEq for Hash
Auto Trait Implementations§
§impl Freeze for Hash
§impl RefUnwindSafe for Hash
§impl Send for Hash
§impl Sync for Hash
§impl Unpin for Hash
§impl UnwindSafe for Hash
Blanket Implementations§
§impl<A, T> AsBits<T> for A
§fn as_bits<O>(&self) -> &BitSlice<T, O>where
diff --git a/pr/2595/docs/iroh_blobs/struct.HashAndFormat.html b/pr/2595/docs/iroh_blobs/struct.HashAndFormat.html
index 8eb7ba64d5..421c7e1439 100644
--- a/pr/2595/docs/iroh_blobs/struct.HashAndFormat.html
+++ b/pr/2595/docs/iroh_blobs/struct.HashAndFormat.html
@@ -1,37 +1,37 @@
-HashAndFormat in iroh_blobs - Rust Struct iroh_blobs::HashAndFormat
pub struct HashAndFormat {
+HashAndFormat in iroh_blobs - Rust Struct iroh_blobs::HashAndFormat
source · pub struct HashAndFormat {
pub hash: Hash,
pub format: BlobFormat,
}
Expand description
A hash and format pair
Fields§
§hash: HashThe hash
§format: BlobFormatThe format
-Implementations§
§impl HashAndFormat
pub fn new(hash: Hash, format: BlobFormat) -> HashAndFormat
Create a new hash and format pair.
-pub fn raw(hash: Hash) -> HashAndFormat
Create a new hash and format pair, using the default (raw) format.
-pub fn hash_seq(hash: Hash) -> HashAndFormat
Create a new hash and format pair, using the collection format.
-Trait Implementations§
§impl Clone for HashAndFormat
§fn clone(&self) -> HashAndFormat
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more§impl Debug for HashAndFormat
§impl<'de> Deserialize<'de> for HashAndFormat
§fn deserialize<D>(
+
Implementations§
source§impl HashAndFormat
sourcepub fn new(hash: Hash, format: BlobFormat) -> HashAndFormat
Create a new hash and format pair.
+sourcepub fn raw(hash: Hash) -> HashAndFormat
Create a new hash and format pair, using the default (raw) format.
+sourcepub fn hash_seq(hash: Hash) -> HashAndFormat
Create a new hash and format pair, using the collection format.
+Trait Implementations§
source§impl Clone for HashAndFormat
source§fn clone(&self) -> HashAndFormat
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moresource§impl Debug for HashAndFormat
source§impl<'de> Deserialize<'de> for HashAndFormat
source§fn deserialize<D>(
deserializer: D
) -> Result<HashAndFormat, <D as Deserializer<'de>>::Error>where
- D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more§impl Display for HashAndFormat
source§impl From<DownloadKind> for HashAndFormat
source§fn from(value: DownloadKind) -> Self
Converts to this type from the input type.source§impl From<HashAndFormat> for DownloadKind
source§fn from(value: HashAndFormat) -> Self
Converts to this type from the input type.§impl FromStr for HashAndFormat
§impl Hash for HashAndFormat
§fn hash<__H>(&self, state: &mut __H)where
+ D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl Display for HashAndFormat
source§impl From<DownloadKind> for HashAndFormat
source§fn from(value: DownloadKind) -> Self
Converts to this type from the input type.source§impl From<HashAndFormat> for DownloadKind
source§fn from(value: HashAndFormat) -> Self
Converts to this type from the input type.source§impl FromStr for HashAndFormat
source§impl Hash for HashAndFormat
§impl MaxSize for HashAndFormat
§const POSTCARD_MAX_SIZE: usize = 33usize
The maximum possible size that the serialization of this
-type can have, in bytes.§impl Ord for HashAndFormat
source§impl MaxSize for HashAndFormat
source§const POSTCARD_MAX_SIZE: usize = 33usize
The maximum possible size that the serialization of this
+type can have, in bytes.source§impl Ord for HashAndFormat
source§fn cmp(&self, other: &HashAndFormat) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more§impl PartialEq for HashAndFormat
§fn eq(&self, other: &HashAndFormat) -> bool
Restrict a value to a certain interval. Read moresource§impl PartialEq for HashAndFormat
source§fn eq(&self, other: &HashAndFormat) -> bool
This method tests for self and other values to be equal, and is used
by ==.§impl PartialOrd for HashAndFormat
§fn partial_cmp(&self, other: &HashAndFormat) -> Option<Ordering>
source§impl PartialOrd for HashAndFormat
source§fn partial_cmp(&self, other: &HashAndFormat) -> Option<Ordering>
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 <=
operator. Read moresource§impl Serialize for HashAndFormat
source§fn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
- S: Serializer,
Serialize this value into the given Serde serializer. Read more§impl Value for HashAndFormat
§type SelfType<'a> = HashAndFormat
SelfType<’a> must be the same type as Self with all lifetimes replaced with ’a§type AsBytes<'a> = [u8; 33]
§fn fixed_width() -> Option<usize>
Width of a fixed type, or None for variable width§fn from_bytes<'a>(data: &'a [u8]) -> <HashAndFormat as Value>::SelfType<'a>where
+ S: Serializer,
Serialize this value into the given Serde serializer. Read moresource§impl Value for HashAndFormat
§type SelfType<'a> = HashAndFormat
SelfType<’a> must be the same type as Self with all lifetimes replaced with ’a§type AsBytes<'a> = [u8; 33]
source§fn fixed_width() -> Option<usize>
Width of a fixed type, or None for variable widthsource§fn from_bytes<'a>(data: &'a [u8]) -> <HashAndFormat as Value>::SelfType<'a>where
HashAndFormat: 'a,
Deserializes data
-Implementations may return a view over data, or an owned typesource§fn as_bytes<'a, 'b>(
value: &'a <HashAndFormat as Value>::SelfType<'b>
) -> <HashAndFormat as Value>::AsBytes<'a>where
'b: 'a,
- HashAndFormat: 'a + 'b,
Serialize the value to a slice§impl Copy for HashAndFormat
§impl Eq for HashAndFormat
§impl StructuralPartialEq for HashAndFormat
Auto Trait Implementations§
§impl Freeze for HashAndFormat
§impl RefUnwindSafe for HashAndFormat
§impl Send for HashAndFormat
§impl Sync for HashAndFormat
§impl Unpin for HashAndFormat
§impl UnwindSafe for HashAndFormat
Blanket Implementations§
source§impl<T> Any for Twhere
+ HashAndFormat: 'a + 'b,
Serialize the value to a slicesource§impl Copy for HashAndFormat
source§impl Eq for HashAndFormat
source§impl StructuralPartialEq for HashAndFormat
Auto Trait Implementations§
§impl Freeze for HashAndFormat
§impl RefUnwindSafe for HashAndFormat
§impl Send for HashAndFormat
§impl Sync for HashAndFormat
§impl Unpin for HashAndFormat
§impl UnwindSafe for HashAndFormat
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
diff --git a/pr/2595/docs/iroh_docs/actor/struct.SyncHandle.html b/pr/2595/docs/iroh_docs/actor/struct.SyncHandle.html
index cfd29c2ce8..6c70a0ff39 100644
--- a/pr/2595/docs/iroh_docs/actor/struct.SyncHandle.html
+++ b/pr/2595/docs/iroh_docs/actor/struct.SyncHandle.html
@@ -26,7 +26,7 @@ waiting for the actor to finish happens in an async context, and therefore that
namespace: NamespaceId,
author: AuthorId,
key: Bytes,
- hash: Hash,
+ hash: Hash,
len: u64
) -> Result<()>sourcepub async fn delete_prefix(
&self,
diff --git a/pr/2595/docs/iroh_docs/engine/enum.LiveEvent.html b/pr/2595/docs/iroh_docs/engine/enum.LiveEvent.html
index ceb8545b50..f0d33bcb21 100644
--- a/pr/2595/docs/iroh_docs/engine/enum.LiveEvent.html
+++ b/pr/2595/docs/iroh_docs/engine/enum.LiveEvent.html
@@ -3,34 +3,34 @@
entry: Entry,
},
InsertRemote {
- from: PublicKey,
+ from: PublicKey,
entry: Entry,
content_status: ContentStatus,
},
ContentReady {
- hash: Hash,
+ hash: Hash,
},
PendingContentReady,
- NeighborUp(PublicKey),
- NeighborDown(PublicKey),
+ NeighborUp(PublicKey),
+ NeighborDown(PublicKey),
SyncFinished(SyncEvent),
}Expand description
Events informing about actions of the live sync progress.
Variants§
§InsertLocal
A local insertion.
§InsertRemote
Received a remote insert.
-Fields
§from: PublicKeyThe peer that sent us the entry.
+Fields
§content_status: ContentStatusIf the content is available at the local node
§ContentReady
The content of an entry was downloaded and is now available at the local node
-Fields
§hash: HashThe content hash of the newly available entry content
+§PendingContentReady
All pending content is now ready.
This event signals that all queued content downloads from the last sync run have either
completed or failed.
It will only be emitted after a Self::SyncFinished event, never before.
Receiving this event does not guarantee that all content in the document is available. If
blobs failed to download, this event will still be emitted after all operations completed.
-§NeighborUp(PublicKey)
We have a new neighbor in the swarm.
-§NeighborDown(PublicKey)
We lost a neighbor in the swarm.
+§NeighborUp(PublicKey)
We have a new neighbor in the swarm.
+§NeighborDown(PublicKey)
We lost a neighbor in the swarm.
§SyncFinished(SyncEvent)
A set-reconciliation sync finished.
Trait Implementations§
source§impl<'de> Deserialize<'de> for LiveEvent
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl PartialEq for LiveEvent
source§fn eq(&self, other: &LiveEvent) -> bool
This method tests for self and other values to be equal, and is used
diff --git a/pr/2595/docs/iroh_docs/engine/fn.entry_to_content_status.html b/pr/2595/docs/iroh_docs/engine/fn.entry_to_content_status.html
index 459a6719d2..3b39df6428 100644
--- a/pr/2595/docs/iroh_docs/engine/fn.entry_to_content_status.html
+++ b/pr/2595/docs/iroh_docs/engine/fn.entry_to_content_status.html
@@ -1,2 +1,2 @@
-entry_to_content_status in iroh_docs::engine - Rust Function iroh_docs::engine::entry_to_content_status
source · pub fn entry_to_content_status(entry: Result<EntryStatus>) -> ContentStatus
Expand description
Converts an [EntryStatus] into a [‘ContentStatus’].
+entry_to_content_status in iroh_docs::engine - Rust Function iroh_docs::engine::entry_to_content_status
source · pub fn entry_to_content_status(entry: Result<EntryStatus>) -> ContentStatus
Expand description
Converts an EntryStatus into a [‘ContentStatus’].
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_docs/engine/index.html b/pr/2595/docs/iroh_docs/engine/index.html
index 5f78e23386..622ab4b871 100644
--- a/pr/2595/docs/iroh_docs/engine/index.html
+++ b/pr/2595/docs/iroh_docs/engine/index.html
@@ -1,4 +1,4 @@
iroh_docs::engine - Rust Expand description
Handlers and actors to for live syncing replicas.
crate::Replica is also called documents here.
Structs§
- Persistent default author for a docs engine.
- The sync engine coordinates actors that manage open documents, set-reconciliation syncs with
-peers and a gossip swarm for each syncing document.
- Event emitted when a sync operation completes
Enums§
- Where to persist the default author.
- Events informing about actions of the live sync progress.
- Why we performed a sync exchange
- Why we started a sync request
Functions§
- Converts an [
EntryStatus] into a [‘ContentStatus’].
\ No newline at end of file
+peers and a gossip swarm for each syncing document.Event emitted when a sync operation completes Enums§
- Where to persist the default author.
- Events informing about actions of the live sync progress.
- Why we performed a sync exchange
- Why we started a sync request
Functions§
- Converts an
EntryStatus into a [‘ContentStatus’].
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_docs/engine/struct.Engine.html b/pr/2595/docs/iroh_docs/engine/struct.Engine.html
index 1b88a96726..46cd25179e 100644
--- a/pr/2595/docs/iroh_docs/engine/struct.Engine.html
+++ b/pr/2595/docs/iroh_docs/engine/struct.Engine.html
@@ -8,12 +8,12 @@ peers and a gossip swarm for each syncing document.
Fields§
§endpoint: EndpointEndpoint used by the engine.
§sync: SyncHandleHandle to the actor thread.
The persistent default author for this engine.
-Implementations§
source§impl Engine
Implementations§
source§impl Engine
sourcepub async fn spawn<B: Store>(
endpoint: Endpoint,
- gossip: Gossip,
+ gossip: Gossip,
replica_store: Store,
bao_store: B,
- downloader: Downloader,
+ downloader: Downloader,
default_author_storage: DefaultAuthorStorage
) -> Result<Self>
Start the sync engine.
This will spawn two tokio tasks for the live sync coordination and gossip actors, and a
@@ -21,7 +21,7 @@ thread for the sourcepub async fn start_sync(
&self,
namespace: NamespaceId,
- peers: Vec<NodeAddr>
+ peers: Vec<NodeAddr>
) -> Result<()>
Start to sync a document.
If peers is non-empty, it will both do an initial set-reconciliation sync with each peer,
and join an iroh-gossip swarm with these peers to receive and broadcast document updates.
diff --git a/pr/2595/docs/iroh_docs/engine/struct.SyncEvent.html b/pr/2595/docs/iroh_docs/engine/struct.SyncEvent.html
index 49ba954022..d7eb730d81 100644
--- a/pr/2595/docs/iroh_docs/engine/struct.SyncEvent.html
+++ b/pr/2595/docs/iroh_docs/engine/struct.SyncEvent.html
@@ -1,11 +1,11 @@
SyncEvent in iroh_docs::engine - Rust pub struct SyncEvent {
- pub peer: PublicKey,
+ pub peer: PublicKey,
pub origin: Origin,
pub finished: SystemTime,
pub started: SystemTime,
pub result: Result<SyncDetails, String>,
}
Expand description
Event emitted when a sync operation completes
-Fields§
§peer: PublicKeyPeer we synced with
+Fields§
§peer: PublicKeyPeer we synced with
§origin: OriginOrigin of the sync exchange
§finished: SystemTimeTimestamp when the sync started
§started: SystemTimeTimestamp when the sync finished
diff --git a/pr/2595/docs/iroh_docs/index.html b/pr/2595/docs/iroh_docs/index.html
index a37d30e2a6..41c792c5e5 100644
--- a/pr/2595/docs/iroh_docs/index.html
+++ b/pr/2595/docs/iroh_docs/index.html
@@ -1,7 +1,7 @@
iroh_docs - Rust Expand description
Multi-dimensional key-value documents with an efficient synchronization protocol
The crate operates on Replicas. A replica contains an unlimited number of
Entries. Each entry is identified by a key, its author, and the replica’s
-namespace. Its value is the 32-byte BLAKE3 hash
+namespace. Its value is the 32-byte BLAKE3 hash
of the entry’s content data, the size of this content data, and a timestamp.
The content data itself is not stored or transferred through a replica.
All entries in a replica are signed with two keypairs:
diff --git a/pr/2595/docs/iroh_docs/net/enum.AcceptError.html b/pr/2595/docs/iroh_docs/net/enum.AcceptError.html
index 87e9a07ad3..cf11b5b695 100644
--- a/pr/2595/docs/iroh_docs/net/enum.AcceptError.html
+++ b/pr/2595/docs/iroh_docs/net/enum.AcceptError.html
@@ -3,31 +3,31 @@
error: Error,
},
Open {
- peer: PublicKey,
+ peer: PublicKey,
error: Error,
},
Abort {
- peer: PublicKey,
+ peer: PublicKey,
namespace: NamespaceId,
reason: AbortReason,
},
Sync {
- peer: PublicKey,
+ peer: PublicKey,
namespace: Option<NamespaceId>,
error: Error,
},
Close {
- peer: PublicKey,
+ peer: PublicKey,
namespace: Option<NamespaceId>,
error: Error,
},
}Expand description
Errors that may occur on handling incoming sync connections.
Variants§
§Connect
Failed to establish connection
§Open
Failed to open replica
-§Abort
We aborted the sync request.
-§Sync
Failed to run sync
-§Close
Failed to close
-Implementations§
source§impl AcceptError
Implementations§
Trait Implementations§
source§impl Debug for AcceptError
source§impl Display for AcceptError
source§impl Error for AcceptError
source§fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more1.0.0 · source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()Auto Trait Implementations§
§impl Freeze for AcceptError
§impl RefUnwindSafe for AcceptError
§impl Send for AcceptError
§impl Sync for AcceptError
§impl Unpin for AcceptError
§impl UnwindSafe for AcceptError
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
diff --git a/pr/2595/docs/iroh_docs/net/fn.connect_and_sync.html b/pr/2595/docs/iroh_docs/net/fn.connect_and_sync.html
index 1ee6909d53..7bec313309 100644
--- a/pr/2595/docs/iroh_docs/net/fn.connect_and_sync.html
+++ b/pr/2595/docs/iroh_docs/net/fn.connect_and_sync.html
@@ -2,6 +2,6 @@
endpoint: &Endpoint,
sync: &SyncHandle,
namespace: NamespaceId,
- peer: NodeAddr
+ peer: NodeAddr
) -> Result<SyncFinished, ConnectError>Expand description
Connect to a peer and sync a replica
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_docs/net/fn.handle_connection.html b/pr/2595/docs/iroh_docs/net/fn.handle_connection.html
index 347a0c22bf..e96816b362 100644
--- a/pr/2595/docs/iroh_docs/net/fn.handle_connection.html
+++ b/pr/2595/docs/iroh_docs/net/fn.handle_connection.html
@@ -3,6 +3,6 @@
connecting: Connecting,
accept_cb: F
) -> Result<SyncFinished, AcceptError>where
- F: Fn(NamespaceId, PublicKey) -> Fut,
+ F: Fn(NamespaceId, PublicKey) -> Fut,
Fut: Future<Output = AcceptOutcome>,Expand description
Handle an iroh-docs connection and sync all shared documents in the replica store.
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_docs/net/struct.SyncFinished.html b/pr/2595/docs/iroh_docs/net/struct.SyncFinished.html
index 74ab2f6632..dcd549e6fc 100644
--- a/pr/2595/docs/iroh_docs/net/struct.SyncFinished.html
+++ b/pr/2595/docs/iroh_docs/net/struct.SyncFinished.html
@@ -1,11 +1,11 @@
SyncFinished in iroh_docs::net - Rust Struct iroh_docs::net::SyncFinished
source · pub struct SyncFinished {
pub namespace: NamespaceId,
- pub peer: PublicKey,
+ pub peer: PublicKey,
pub outcome: SyncOutcome,
pub timings: Timings,
}
Expand description
Details of a finished sync operation.
Fields§
§namespace: NamespaceIdThe namespace that was synced.
-§peer: PublicKeyThe peer we syned with.
+§peer: PublicKeyThe peer we syned with.
§outcome: SyncOutcomeThe outcome of the sync operation
§timings: TimingsThe time this operation took
Trait Implementations§
source§impl Clone for SyncFinished
source§fn clone(&self) -> SyncFinished
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moreAuto Trait Implementations§
§impl Freeze for SyncFinished
§impl RefUnwindSafe for SyncFinished
§impl Send for SyncFinished
§impl Sync for SyncFinished
§impl Unpin for SyncFinished
§impl UnwindSafe for SyncFinished
Blanket Implementations§
source§impl<T> Any for Twhere
diff --git a/pr/2595/docs/iroh_docs/store/fs/struct.ContentHashesIterator.html b/pr/2595/docs/iroh_docs/store/fs/struct.ContentHashesIterator.html
index 8bebf68ec6..df1fc8865f 100644
--- a/pr/2595/docs/iroh_docs/store/fs/struct.ContentHashesIterator.html
+++ b/pr/2595/docs/iroh_docs/store/fs/struct.ContentHashesIterator.html
@@ -6,7 +6,7 @@ It needs a copy of a redb::ReadOnlyTable to be self-contained.
Implementations§
Trait Implementations§
source§impl Debug for ContentHashesIterator
Trait Implementations§
source§impl Debug for ContentHashesIterator
source§impl Iterator for ContentHashesIterator
source§fn next(&mut self) -> Option<Self::Item>
Advances the iterator and returns the next value. Read moresource§fn next_chunk<const N: usize>(
&mut self
) -> Result<[Self::Item; N], IntoIter<Self::Item, N>>where
Self: Sized,
🔬This is a nightly-only experimental API. (iter_next_chunk)Advances the iterator and returns an array containing the next N values. Read more1.0.0 · source§fn size_hint(&self) -> (usize, Option<usize>)
Returns the bounds on the remaining length of the iterator. Read more1.0.0 · source§fn count(self) -> usizewhere
diff --git a/pr/2595/docs/iroh_docs/struct.AuthorId.html b/pr/2595/docs/iroh_docs/struct.AuthorId.html
index 7dfa3dea5b..02221b0eb6 100644
--- a/pr/2595/docs/iroh_docs/struct.AuthorId.html
+++ b/pr/2595/docs/iroh_docs/struct.AuthorId.html
@@ -156,6 +156,6 @@ letters are used (e.g. F9B4CA)
Into<Dispatch>, source§fn with_current_subscriber(self) -> WithDispatch<Self>
source§impl<T> DeserializeOwned for Twhere
- T: for<'de> Deserialize<'de>,
§impl<T> PeerIdentity for Twhere
+ T: for<'de> Deserialize<'de>,
source§impl<T> PeerIdentity for T
source§impl<T> RuleType for T
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_docs/struct.AuthorPublicKey.html b/pr/2595/docs/iroh_docs/struct.AuthorPublicKey.html
index 8e72b11c8a..7a83ce68e4 100644
--- a/pr/2595/docs/iroh_docs/struct.AuthorPublicKey.html
+++ b/pr/2595/docs/iroh_docs/struct.AuthorPublicKey.html
@@ -148,6 +148,6 @@ builds. Into<Dispatch>,source§fn with_current_subscriber(self) -> WithDispatch<Self>
source§impl<T> DeserializeOwned for Twhere
- T: for<'de> Deserialize<'de>,
§impl<T> PeerIdentity for Twhere
+ T: for<'de> Deserialize<'de>,
source§impl<T> PeerIdentity for T
source§impl<T> RuleType for T
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_docs/struct.DocTicket.html b/pr/2595/docs/iroh_docs/struct.DocTicket.html
index d53a93c4c4..fd1bb5eb02 100644
--- a/pr/2595/docs/iroh_docs/struct.DocTicket.html
+++ b/pr/2595/docs/iroh_docs/struct.DocTicket.html
@@ -1,13 +1,13 @@
DocTicket in iroh_docs - Rust pub struct DocTicket {
pub capability: Capability,
- pub nodes: Vec<NodeAddr>,
+ pub nodes: Vec<NodeAddr>,
}
Expand description
Contains both a key (either secret or public) to a document, and a list of peers to join.
Fields§
§capability: Capabilityeither a public or private key
-§nodes: Vec<NodeAddr>A list of nodes to contact.
-Implementations§
source§impl DocTicket
sourcepub fn new(capability: Capability, peers: Vec<NodeAddr>) -> Self
Create a new doc ticket
+§nodes: Vec<NodeAddr>A list of nodes to contact.
+Implementations§
Trait Implementations§
source§impl<'de> Deserialize<'de> for DocTicket
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
- __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreAuto Trait Implementations§
§impl Freeze for DocTicket
§impl RefUnwindSafe for DocTicket
§impl Send for DocTicket
§impl Sync for DocTicket
§impl Unpin for DocTicket
§impl UnwindSafe for DocTicket
Blanket Implementations§
source§impl<T> Any for Twhere
+ __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreAuto Trait Implementations§
§impl Freeze for DocTicket
§impl RefUnwindSafe for DocTicket
§impl Send for DocTicket
§impl Sync for DocTicket
§impl Unpin for DocTicket
§impl UnwindSafe for DocTicket
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
diff --git a/pr/2595/docs/iroh_docs/struct.NamespaceId.html b/pr/2595/docs/iroh_docs/struct.NamespaceId.html
index 433d51afc6..f9acda8e94 100644
--- a/pr/2595/docs/iroh_docs/struct.NamespaceId.html
+++ b/pr/2595/docs/iroh_docs/struct.NamespaceId.html
@@ -156,6 +156,6 @@ letters are used (e.g. F9B4CA)
Into<Dispatch>, source§fn with_current_subscriber(self) -> WithDispatch<Self>
source§impl<T> DeserializeOwned for Twhere
- T: for<'de> Deserialize<'de>,
§impl<T> PeerIdentity for Twhere
+ T: for<'de> Deserialize<'de>,
source§impl<T> PeerIdentity for T
source§impl<T> RuleType for T
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_docs/struct.NamespacePublicKey.html b/pr/2595/docs/iroh_docs/struct.NamespacePublicKey.html
index 350dea9049..72b75ed510 100644
--- a/pr/2595/docs/iroh_docs/struct.NamespacePublicKey.html
+++ b/pr/2595/docs/iroh_docs/struct.NamespacePublicKey.html
@@ -147,6 +147,6 @@ builds.Into<Dispatch>,source§fn with_current_subscriber(self) -> WithDispatch<Self>
source§impl<T> DeserializeOwned for Twhere
- T: for<'de> Deserialize<'de>,
§impl<T> PeerIdentity for Twhere
+ T: for<'de> Deserialize<'de>,
source§impl<T> PeerIdentity for T
source§impl<T> RuleType for T
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_docs/sync/struct.Entry.html b/pr/2595/docs/iroh_docs/sync/struct.Entry.html
index 55bf06044f..055a4b6f54 100644
--- a/pr/2595/docs/iroh_docs/sync/struct.Entry.html
+++ b/pr/2595/docs/iroh_docs/sync/struct.Entry.html
@@ -1,6 +1,6 @@
Entry in iroh_docs::sync - Rust pub struct Entry { /* private fields */ }
Expand description
A single entry in a Replica
An entry is identified by a key, its Author, and the Replica’s
-NamespaceSecret. Its value is the 32-byte BLAKE3 hash
+NamespaceSecret. Its value is the 32-byte BLAKE3 hash
of the entry’s content data, the size of this content data, and a timestamp.
Implementations§
source§impl Entry
sourcepub fn new(id: RecordIdentifier, record: Record) -> Self
Create a new entry
sourcepub fn new_empty(id: RecordIdentifier) -> Self
Create a new empty entry with the current timestamp.
@@ -15,7 +15,7 @@ of the entry’s content data, the size of this content data, and a timestamp.
sourcepub fn sign(self, namespace: &NamespaceSecret, author: &Author) -> SignedEntry
Sign this entry with a NamespaceSecret and Author.
Methods from Deref<Target = Record>§
sourcepub fn content_len(&self) -> u64
Get the length of the data addressed by this record’s content hash.
-sourcepub fn content_hash(&self) -> Hash
Get the [struct@Hash] of the content data of this record.
+sourcepub fn content_hash(&self) -> Hash
Get the Hash of the content data of this record.
Trait Implementations§
source§impl<'de> Deserialize<'de> for Entry
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl From<SignedEntry> for Entry
source§fn from(value: SignedEntry) -> Self
Converts to this type from the input type.source§impl Ord for Entry
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
diff --git a/pr/2595/docs/iroh_docs/sync/struct.Record.html b/pr/2595/docs/iroh_docs/sync/struct.Record.html
index 94479a973e..f06cccab52 100644
--- a/pr/2595/docs/iroh_docs/sync/struct.Record.html
+++ b/pr/2595/docs/iroh_docs/sync/struct.Record.html
@@ -1,11 +1,11 @@
Record in iroh_docs::sync - Rust pub struct Record { /* private fields */ }
Expand description
The data part of an entry in a Replica.
-Implementations§
source§impl Record
Implementations§
source§impl Record
sourcepub fn empty_current() -> Self
Create a tombstone record with the timestamp set to now.
sourcepub fn new_current(hash: Hash, len: u64) -> Self
Create a new Record with the timestamp set to now.
+sourcepub fn new_current(hash: Hash, len: u64) -> Self
Create a new Record with the timestamp set to now.
sourcepub fn content_len(&self) -> u64
Get the length of the data addressed by this record’s content hash.
-sourcepub fn content_hash(&self) -> Hash
Get the [struct@Hash] of the content data of this record.
+sourcepub fn content_hash(&self) -> Hash
Get the Hash of the content data of this record.
Trait Implementations§
source§impl<'de> Deserialize<'de> for Record
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl Ord for Record
Ordering for entry values.
diff --git a/pr/2595/docs/iroh_docs/sync/struct.Replica.html b/pr/2595/docs/iroh_docs/sync/struct.Replica.html
index 23a9798651..c4e161f3c3 100644
--- a/pr/2595/docs/iroh_docs/sync/struct.Replica.html
+++ b/pr/2595/docs/iroh_docs/sync/struct.Replica.html
@@ -5,7 +5,7 @@
&mut self,
key: impl AsRef<[u8]>,
author: &Author,
- hash: Hash,
+ hash: Hash,
len: u64
) -> Result<usize, InsertError>Insert a new record at the given key.
The entry will by signed by the provided author.
@@ -35,7 +35,7 @@ or an error if the entry failed to validate or if a store operation failed.
key: impl AsRef<[u8]>,
author: &Author,
data: impl AsRef<[u8]>
-) -> Result<Hash, InsertError>Hashes the given data and inserts it.
+) -> Result<Hash, InsertError>Hashes the given data and inserts it.
This does not store the content, just the record of it.
Returns the calculated hash.
sourcepub fn record_id(
diff --git a/pr/2595/docs/iroh_docs/sync/struct.SignedEntry.html b/pr/2595/docs/iroh_docs/sync/struct.SignedEntry.html
index 21644eacb1..9ef5e98134 100644
--- a/pr/2595/docs/iroh_docs/sync/struct.SignedEntry.html
+++ b/pr/2595/docs/iroh_docs/sync/struct.SignedEntry.html
@@ -14,7 +14,7 @@
sourcepub fn signature(&self) -> &EntrySignature
Get the signature.
sourcepub fn validate_empty(&self) -> Result<(), ValidationFailure>
Validate that the entry has the empty hash if the length is 0, or a non-zero length.
sourcepub fn content_hash(&self) -> Hash
Get the content [struct@Hash] of the entry.
+sourcepub fn content_hash(&self) -> Hash
Get the content Hash of the entry.
sourcepub fn content_len(&self) -> u64
Get the content length of the entry.
Get the author bytes of this entry.
Methods from Deref<Target = Record>§
sourcepub fn content_len(&self) -> u64
Get the length of the data addressed by this record’s content hash.
-sourcepub fn content_hash(&self) -> Hash
Get the [struct@Hash] of the content data of this record.
+sourcepub fn content_hash(&self) -> Hash
Get the Hash of the content data of this record.
Trait Implementations§
source§impl Clone for SignedEntry
source§fn clone(&self) -> SignedEntry
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moresource§impl Debug for SignedEntry
source§impl Deref for SignedEntry
source§impl<'de> Deserialize<'de> for SignedEntry
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl From<SignedEntry> for Entry
source§fn from(value: SignedEntry) -> Self
Converts to this type from the input type.source§impl Ord for SignedEntry
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
diff --git a/pr/2595/docs/iroh_docs/sync/type.ContentStatusCallback.html b/pr/2595/docs/iroh_docs/sync/type.ContentStatusCallback.html
index 46d5a5a49c..84ffdbe8ee 100644
--- a/pr/2595/docs/iroh_docs/sync/type.ContentStatusCallback.html
+++ b/pr/2595/docs/iroh_docs/sync/type.ContentStatusCallback.html
@@ -1,2 +1,2 @@
-ContentStatusCallback in iroh_docs::sync - Rust Type Alias iroh_docs::sync::ContentStatusCallback
source · pub type ContentStatusCallback = Arc<dyn Fn(Hash) -> ContentStatus + Send + Sync + 'static>;
Expand description
Callback that may be set on a replica to determine the availability status for a content hash.
+ContentStatusCallback in iroh_docs::sync - Rust Type Alias iroh_docs::sync::ContentStatusCallback
source · pub type ContentStatusCallback = Arc<dyn Fn(Hash) -> ContentStatus + Send + Sync + 'static>;
Expand description
Callback that may be set on a replica to determine the availability status for a content hash.
Aliased Type§
struct ContentStatusCallback { /* private fields */ }
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_net/discovery/dns/index.html b/pr/2595/docs/iroh_net/discovery/dns/index.html
index 5a80538422..a752b49d78 100644
--- a/pr/2595/docs/iroh_net/discovery/dns/index.html
+++ b/pr/2595/docs/iroh_net/discovery/dns/index.html
@@ -1,2 +1,2 @@
-iroh_net::discovery::dns - Rust Expand description
DNS node discovery for iroh-net
+iroh_net::discovery::dns - Rust Expand description
DNS node discovery for iroh-net
Structs§
- DNS node discovery
Constants§
- The n0 testing DNS node origin, for production.
- The n0 testing DNS node origin, for testing.
- Testing DNS node origin, must run server from
crate::test_utils::DnsPkarrServer.
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_net/discovery/dns/struct.DnsDiscovery.html b/pr/2595/docs/iroh_net/discovery/dns/struct.DnsDiscovery.html
index 3e7d5d71cc..7628fb45a9 100644
--- a/pr/2595/docs/iroh_net/discovery/dns/struct.DnsDiscovery.html
+++ b/pr/2595/docs/iroh_net/discovery/dns/struct.DnsDiscovery.html
@@ -28,7 +28,7 @@ custom discovery mechanism.
For testing it is also possible to use the N0_DNS_NODE_ORIGIN_STAGING domain
with DnsDiscovery::new. This would then use a hosted discovery service again,
but for testing purposes.
-Trait Implementations§
Trait Implementations§
source§impl Debug for DnsDiscovery
source§impl Discovery for DnsDiscovery
source§fn resolve(
&self,
ep: Endpoint,
node_id: NodeId
diff --git a/pr/2595/docs/iroh_net/discovery/trait.Discovery.html b/pr/2595/docs/iroh_net/discovery/trait.Discovery.html
index a53a618708..d3832a56b5 100644
--- a/pr/2595/docs/iroh_net/discovery/trait.Discovery.html
+++ b/pr/2595/docs/iroh_net/discovery/trait.Discovery.html
@@ -29,4 +29,4 @@ These tasks will be run on the runtime of the Option<BoxStream<Result<DiscoveryItem>>>
Implementors§
source§impl Discovery for DnsDiscovery
source§impl Discovery for LocalSwarmDiscovery
source§impl Discovery for PkarrPublisher
source§impl Discovery for PkarrResolver
source§impl Discovery for ConcurrentDiscovery
\ No newline at end of file
+
Implementors§
source§impl Discovery for DnsDiscovery
source§impl Discovery for LocalSwarmDiscovery
source§impl Discovery for PkarrPublisher
source§impl Discovery for PkarrResolver
source§impl Discovery for ConcurrentDiscovery
\ No newline at end of file
diff --git a/pr/2595/docs/src/iroh_net/discovery/dns.rs.html b/pr/2595/docs/src/iroh_net/discovery/dns.rs.html
index dd1a279fb3..1d32545ed3 100644
--- a/pr/2595/docs/src/iroh_net/discovery/dns.rs.html
+++ b/pr/2595/docs/src/iroh_net/discovery/dns.rs.html
@@ -97,6 +97,10 @@
97
98
99
+100
+101
+102
+103
//! DNS node discovery for iroh-net
use anyhow::Result;
@@ -182,6 +186,10 @@
fn resolve(&self, ep: Endpoint, node_id: NodeId) -> Option<BoxStream<Result<DiscoveryItem>>> {
let resolver = ep.dns_resolver().clone();
let origin_domain = self.origin_domain.clone();
+ #[cfg(any(test, feature = "test-utils"))]
+ if origin_domain.contains(&TEST_DNS_NODE_ORIGIN.to_string()) {
+ panic!("wait. THIS IS ILLEGAL!");
+ }
let fut = async move {
let node_addr = resolver
.lookup_by_id_staggered(&node_id, &origin_domain, DNS_STAGGERING_MS)
diff --git a/pr/2595/docs/trait.impl/iroh_base/ticket/trait.Ticket.js b/pr/2595/docs/trait.impl/iroh_base/ticket/trait.Ticket.js
index 12fa1e3ee5..5d209fabd2 100644
--- a/pr/2595/docs/trait.impl/iroh_base/ticket/trait.Ticket.js
+++ b/pr/2595/docs/trait.impl/iroh_base/ticket/trait.Ticket.js
@@ -1,5 +1,5 @@
(function() {var implementors = {
"iroh":[],
"iroh_base":[],
-"iroh_docs":[["impl Ticket for DocTicket"]]
+"iroh_docs":[["impl Ticket for DocTicket"]]
};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
diff --git a/pr/2595/docs/type.impl/std/primitive.array.js b/pr/2595/docs/type.impl/std/primitive.array.js
index 588a8b53a3..3006964922 100644
--- a/pr/2595/docs/type.impl/std/primitive.array.js
+++ b/pr/2595/docs/type.impl/std/primitive.array.js
@@ -1,4 +1,4 @@
(function() {var type_impls = {
"iroh":[["source§impl<T, const N: usize> [T; N]
1.55.0 · sourcepub fn map<F, U>(self, f: F) -> [U; N]where\n F: FnMut(T) -> U,
Returns an array of the same size as self, with function f applied to each element\nin order.
\nIf you don’t necessarily need a new fixed-size array, consider using\nIterator::map instead.
\n§Note on performance and stack usage
\nUnfortunately, usages of this method are currently not always optimized\nas well as they could be. This mainly concerns large arrays, as mapping\nover small arrays seem to be optimized just fine. Also note that in\ndebug mode (i.e. without any optimizations), this method can use a lot\nof stack space (a few times the size of the array or more).
\nTherefore, in performance-critical code, try to avoid using this method\non large arrays or check the emitted code. Also try to avoid chained\nmaps (e.g. arr.map(...).map(...)).
\nIn many cases, you can instead use Iterator::map by calling .iter()\nor .into_iter() on your array. [T; N]::map is only necessary if you\nreally need a new array of the same size as the result. Rust’s lazy\niterators tend to get optimized very well.
\n§Examples
\nlet x = [1, 2, 3];\nlet y = x.map(|v| v + 1);\nassert_eq!(y, [2, 3, 4]);\n\nlet x = [1, 2, 3];\nlet mut temp = 0;\nlet y = x.map(|v| { temp += 1; v * temp });\nassert_eq!(y, [1, 4, 9]);\n\nlet x = [\"Ferris\", \"Bueller's\", \"Day\", \"Off\"];\nlet y = x.map(|v| v.len());\nassert_eq!(y, [6, 9, 3, 3]);
\nsourcepub fn try_map<F, R>(\n self,\n f: F\n) -> <<R as Try>::Residual as Residual<[<R as Try>::Output; N]>>::TryType
🔬This is a nightly-only experimental API. (array_try_map)
A fallible function f applied to each element on array self in order to\nreturn an array the same size as self or the first error encountered.
\nThe return type of this function depends on the return type of the closure.\nIf you return Result<T, E> from the closure, you’ll get a Result<[T; N], E>.\nIf you return Option<T> from the closure, you’ll get an Option<[T; N]>.
\n§Examples
\n#![feature(array_try_map)]\n\nlet a = [\"1\", \"2\", \"3\"];\nlet b = a.try_map(|v| v.parse::<u32>()).unwrap().map(|v| v + 1);\nassert_eq!(b, [2, 3, 4]);\n\nlet a = [\"1\", \"2a\", \"3\"];\nlet b = a.try_map(|v| v.parse::<u32>());\nassert!(b.is_err());\n\nuse std::num::NonZero;\n\nlet z = [1, 2, 0, 3, 4];\nassert_eq!(z.try_map(NonZero::new), None);\n\nlet a = [1, 2, 3];\nlet b = a.try_map(NonZero::new);\nlet c = b.map(|x| x.map(NonZero::get));\nassert_eq!(c, Some(a));
\n1.57.0 (const: 1.57.0) · sourcepub const fn as_slice(&self) -> &[T]
Returns a slice containing the entire array. Equivalent to &s[..].
\n1.57.0 · sourcepub fn as_mut_slice(&mut self) -> &mut [T]
Returns a mutable slice containing the entire array. Equivalent to\n&mut s[..].
\n1.77.0 · sourcepub fn each_ref(&self) -> [&T; N]
Borrows each element and returns an array of references with the same\nsize as self.
\n§Example
\nlet floats = [3.1, 2.7, -1.0];\nlet float_refs: [&f64; 3] = floats.each_ref();\nassert_eq!(float_refs, [&3.1, &2.7, &-1.0]);
\nThis method is particularly useful if combined with other methods, like\nmap. This way, you can avoid moving the original\narray if its elements are not Copy.
\n\nlet strings = [\"Ferris\".to_string(), \"♥\".to_string(), \"Rust\".to_string()];\nlet is_ascii = strings.each_ref().map(|s| s.is_ascii());\nassert_eq!(is_ascii, [true, false, true]);\n\n// We can still access the original array: it has not been moved.\nassert_eq!(strings.len(), 3);
\n1.77.0 · sourcepub fn each_mut(&mut self) -> [&mut T; N]
Borrows each element mutably and returns an array of mutable references\nwith the same size as self.
\n§Example
\n\nlet mut floats = [3.1, 2.7, -1.0];\nlet float_refs: [&mut f64; 3] = floats.each_mut();\n*float_refs[0] = 0.0;\nassert_eq!(float_refs, [&mut 0.0, &mut 2.7, &mut -1.0]);\nassert_eq!(floats, [0.0, 2.7, -1.0]);
\nsourcepub fn split_array_ref<const M: usize>(&self) -> (&[T; M], &[T])
🔬This is a nightly-only experimental API. (split_array)
Divides one array reference into two at an index.
\nThe first will contain all indices from [0, M) (excluding\nthe index M itself) and the second will contain all\nindices from [M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet v = [1, 2, 3, 4, 5, 6];\n\n{\n let (left, right) = v.split_array_ref::<0>();\n assert_eq!(left, &[]);\n assert_eq!(right, &[1, 2, 3, 4, 5, 6]);\n}\n\n{\n let (left, right) = v.split_array_ref::<2>();\n assert_eq!(left, &[1, 2]);\n assert_eq!(right, &[3, 4, 5, 6]);\n}\n\n{\n let (left, right) = v.split_array_ref::<6>();\n assert_eq!(left, &[1, 2, 3, 4, 5, 6]);\n assert_eq!(right, &[]);\n}
\nsourcepub fn split_array_mut<const M: usize>(&mut self) -> (&mut [T; M], &mut [T])
🔬This is a nightly-only experimental API. (split_array)
Divides one mutable array reference into two at an index.
\nThe first will contain all indices from [0, M) (excluding\nthe index M itself) and the second will contain all\nindices from [M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet mut v = [1, 0, 3, 0, 5, 6];\nlet (left, right) = v.split_array_mut::<2>();\nassert_eq!(left, &mut [1, 0][..]);\nassert_eq!(right, &mut [3, 0, 5, 6]);\nleft[1] = 2;\nright[1] = 4;\nassert_eq!(v, [1, 2, 3, 4, 5, 6]);
\nsourcepub fn rsplit_array_ref<const M: usize>(&self) -> (&[T], &[T; M])
🔬This is a nightly-only experimental API. (split_array)
Divides one array reference into two at an index from the end.
\nThe first will contain all indices from [0, N - M) (excluding\nthe index N - M itself) and the second will contain all\nindices from [N - M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet v = [1, 2, 3, 4, 5, 6];\n\n{\n let (left, right) = v.rsplit_array_ref::<0>();\n assert_eq!(left, &[1, 2, 3, 4, 5, 6]);\n assert_eq!(right, &[]);\n}\n\n{\n let (left, right) = v.rsplit_array_ref::<2>();\n assert_eq!(left, &[1, 2, 3, 4]);\n assert_eq!(right, &[5, 6]);\n}\n\n{\n let (left, right) = v.rsplit_array_ref::<6>();\n assert_eq!(left, &[]);\n assert_eq!(right, &[1, 2, 3, 4, 5, 6]);\n}
\nsourcepub fn rsplit_array_mut<const M: usize>(&mut self) -> (&mut [T], &mut [T; M])
🔬This is a nightly-only experimental API. (split_array)
Divides one mutable array reference into two at an index from the end.
\nThe first will contain all indices from [0, N - M) (excluding\nthe index N - M itself) and the second will contain all\nindices from [N - M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet mut v = [1, 0, 3, 0, 5, 6];\nlet (left, right) = v.rsplit_array_mut::<4>();\nassert_eq!(left, &mut [1, 0]);\nassert_eq!(right, &mut [3, 0, 5, 6][..]);\nleft[1] = 2;\nright[1] = 4;\nassert_eq!(v, [1, 2, 3, 4, 5, 6]);
\n",0,"iroh::docs::PeerIdBytes"],["source§impl<const N: usize> [u8; N]
sourcepub const fn as_ascii(&self) -> Option<&[AsciiChar; N]>
🔬This is a nightly-only experimental API. (ascii_char)
Converts this array of bytes into a array of ASCII characters,\nor returns None if any of the characters is non-ASCII.
\n§Examples
\n#![feature(ascii_char)]\n#![feature(const_option)]\n\nconst HEX_DIGITS: [std::ascii::Char; 16] =\n *b\"0123456789abcdef\".as_ascii().unwrap();\n\nassert_eq!(HEX_DIGITS[1].as_str(), \"1\");\nassert_eq!(HEX_DIGITS[10].as_str(), \"a\");
\nsourcepub const unsafe fn as_ascii_unchecked(&self) -> &[AsciiChar; N]
🔬This is a nightly-only experimental API. (ascii_char)
Converts this array of bytes into a array of ASCII characters,\nwithout checking whether they’re valid.
\n§Safety
\nEvery byte in the array must be in 0..=127, or else this is UB.
\n",0,"iroh::docs::PeerIdBytes"],["§impl<T> Array for [T; 32]where\n T: Default,
§fn as_slice_mut(&mut self) -> &mut [T]
Gives a unique slice over the whole thing. Read more","Array","iroh::docs::PeerIdBytes"],["","Array","iroh::docs::PeerIdBytes"],["§impl<const N: usize, T> AsBytes for [T; N]where\n T: AsBytes,
§fn write_to_prefix(&self, bytes: &mut [u8]) -> Option<()>
","AsBytes","iroh::docs::PeerIdBytes"],["","AsBytes","iroh::docs::PeerIdBytes"],["","AsMut<[T]>","iroh::docs::PeerIdBytes"],["","AsRef<[T]>","iroh::docs::PeerIdBytes"],["§impl<T, const N: usize> BitView for [T; N]where\n T: BitStore,
Note that overly-large arrays may cause the conversions to fail.
\n§fn view_bits<O>(&self) -> &BitSlice<T, O>where\n O: BitOrder,
Views a memory region as an immutable bit-slice.§fn try_view_bits<O>(&self) -> Result<&BitSlice<T, O>, BitSpanError<T>>where\n O: BitOrder,
Attempts to view a memory region as an immutable bit-slice. Read more§fn view_bits_mut<O>(&mut self) -> &mut BitSlice<T, O>where\n O: BitOrder,
Views a memory region as a mutable bit-slice.§fn try_view_bits_mut<O>(\n &mut self\n) -> Result<&mut BitSlice<T, O>, BitSpanError<T>>where\n O: BitOrder,
Attempts to view a memory region as a mutable bit-slice. Read more","BitView","iroh::docs::PeerIdBytes"],["§impl<T, const N: usize> BitViewSized for [T; N]where\n T: BitStore,
§fn as_raw_slice(&self) -> &[<[T; N] as BitView>::Store]
Views the type as a slice of its elements.§fn as_raw_mut_slice(&mut self) -> &mut [<[T; N] as BitView>::Store]
Views the type as a mutable slice of its elements.§fn into_bitarray<O>(self) -> BitArray<Self, O>where\n O: BitOrder,
Wraps self in a BitArray.","BitViewSized","iroh::docs::PeerIdBytes"],["","Borrow<[T]>","iroh::docs::PeerIdBytes"],["1.4.0 · source§impl<T, const N: usize> BorrowMut<[T]> for [T; N]
source§fn borrow_mut(&mut self) -> &mut [T]
Mutably borrows from an owned value. Read more","BorrowMut<[T]>","iroh::docs::PeerIdBytes"],["","Chain","iroh::docs::PeerIdBytes"],["","Clone","iroh::docs::PeerIdBytes"],["","Debug","iroh::docs::PeerIdBytes"],["§impl<const N: usize> Decode for [u8; N]
Decodes a byte array from byte[n] as described in RFC4251 § 5:
\n\nA byte represents an arbitrary 8-bit value (octet). Fixed length\ndata is sometimes represented as an array of bytes, written\nbyte[n], where n is the number of bytes in the array.
\n
\n","Decode","iroh::docs::PeerIdBytes"],["§impl<'a, T, const N: usize> DecodeValue<'a> for [T; N]where\n T: Decode<'a>,
§fn decode_value<R>(reader: &mut R, header: Header) -> Result<[T; N], Error>where\n R: Reader<'a>,
Attempt to decode this message using the provided [Reader].","DecodeValue<'a>","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["source§impl<'de, T> Deserialize<'de> for [T; 32]where\n T: Deserialize<'de>,
source§fn deserialize<D>(\n deserializer: D\n) -> Result<[T; 32], <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more","Deserialize<'de>","iroh::docs::PeerIdBytes"],["source§impl<'de, const N: usize> Deserialize<'de> for [u8; N]
source§fn deserialize<D>(\n deserializer: D\n) -> Result<[u8; N], <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
","Deserialize<'de>","iroh::docs::PeerIdBytes"],["§impl<const N: usize> Encode for [u8; N]
Encodes [u8; N] into byte[n] as described in RFC4251 § 5:
\n\nA byte represents an arbitrary 8-bit value (octet). Fixed length\ndata is sometimes represented as an array of bytes, written\nbyte[n], where n is the number of bytes in the array.
\n
\n§fn encoded_len(&self) -> Result<usize, Error>
Get the length of this type encoded in bytes, prior to Base64 encoding.§fn encode(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value using the provided [Writer].§fn encoded_len_prefixed(&self) -> Result<usize, Error>
Return the length of this type after encoding when prepended with a\nuint32 length prefix.§fn encode_prefixed(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value, first prepending a uint32 length prefix\nset to [Encode::encoded_len].","Encode","iroh::docs::PeerIdBytes"],["","EncodeLabelSet","iroh::docs::PeerIdBytes"],["§impl<T, const N: usize> EncodeValue for [T; N]where\n T: Encode,
","EncodeValue","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["§impl<'a> FindToken<&'a u8> for [u8; 32]
§fn find_token(&self, token: &u8) -> bool
Returns true if self contains the token","FindToken<&'a u8>","iroh::docs::PeerIdBytes"],["§impl FindToken<u8> for [u8; 32]
§fn find_token(&self, token: u8) -> bool
Returns true if self contains the token","FindToken","iroh::docs::PeerIdBytes"],["","FixedTag","iroh::docs::PeerIdBytes"],["","From<&Signature>","iroh::docs::PeerIdBytes"],["","From","iroh::docs::PeerIdBytes"],["§impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>>> for [T; 32]
","From, B0>, B0>, B0>, B0>, B0>>>","iroh::docs::PeerIdBytes"],["","From","iroh::docs::PeerIdBytes"],["","From","iroh::docs::PeerIdBytes"],["","From>","iroh::docs::PeerIdBytes"],["","From","iroh::docs::PeerIdBytes"],["","From","iroh::docs::PeerIdBytes"],["","From","iroh::docs::PeerIdBytes"],["","From>","iroh::docs::PeerIdBytes"],["§impl<const N: usize, T> FromBytes for [T; N]where\n T: FromBytes,
§fn slice_from_prefix(bytes: &[u8], count: usize) -> Option<(&[Self], &[u8])>where\n Self: Sized,
Interprets the prefix of the given bytes as a &[Self] with length\nequal to count without copying. Read more§fn slice_from_suffix(bytes: &[u8], count: usize) -> Option<(&[u8], &[Self])>where\n Self: Sized,
Interprets the suffix of the given bytes as a &[Self] with length\nequal to count without copying. Read more§fn read_from_prefix(bytes: &[u8]) -> Option<Self>where\n Self: Sized,
","FromBytes","iroh::docs::PeerIdBytes"],["","FromHex","iroh::docs::PeerIdBytes"],["","FromZeroes","iroh::docs::PeerIdBytes"],["","Hash","iroh::docs::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Hash for [T; N]where\n T: Hash,
The hash of an array is the same as that of the corresponding slice,\nas required by the Borrow implementation.
\n\nuse std::hash::BuildHasher;\n\nlet b = std::hash::RandomState::new();\nlet a: [u8; 3] = [0xa8, 0x3c, 0x09];\nlet s: &[u8] = &[0xa8, 0x3c, 0x09];\nassert_eq!(b.hash_one(a), b.hash_one(s));
\n","Hash","iroh::docs::PeerIdBytes"],["","Index","iroh::docs::PeerIdBytes"],["","IndexMut","iroh::docs::PeerIdBytes"],["","InputLength","iroh::docs::PeerIdBytes"],["1.53.0 · source§impl<T, const N: usize> IntoIterator for [T; N]
source§fn into_iter(self) -> <[T; N] as IntoIterator>::IntoIter
Creates a consuming iterator, that is, one that moves each value out of\nthe array (from start to end). The array cannot be used after calling\nthis unless T implements Copy, so the whole array is copied.
\nArrays have special behavior when calling .into_iter() prior to the\n2021 edition – see the array Editions section for more information.
\n","IntoIterator","iroh::docs::PeerIdBytes"],["§impl<const N: usize> IntoResponse for [u8; N]
§fn into_response(self) -> Response<Body>
Create a response.","IntoResponse","iroh::docs::PeerIdBytes"],["§impl<Fut, const N: usize> Join for [Fut; N]where\n Fut: IntoFuture,
§type Output = [<Fut as IntoFuture>::Output; N]
The resulting output type.§type Future = Join<<Fut as IntoFuture>::IntoFuture, N>
The Future implementation returned by this method.","Join","iroh::docs::PeerIdBytes"],["","Key","iroh::docs::PeerIdBytes"],["§impl<T, const N: usize> MaxSize for [T; N]where\n T: MaxSize,
§const POSTCARD_MAX_SIZE: usize = _
The maximum possible size that the serialization of this\ntype can have, in bytes.","MaxSize","iroh::docs::PeerIdBytes"],["","Merge","iroh::docs::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Ord for [T; N]where\n T: Ord,
Implements comparison of arrays lexicographically.
\n1.21.0 · source§fn max(self, other: Self) -> Selfwhere\n Self: Sized,
Compares and returns the maximum of two values. Read more","Ord","iroh::docs::PeerIdBytes"],["","PartialEq<&[U]>","iroh::docs::PeerIdBytes"],["1.0.0 · source§impl<T, U, const N: usize> PartialEq<&mut [U]> for [T; N]where\n T: PartialEq<U>,
","PartialEq<&mut [U]>","iroh::docs::PeerIdBytes"],["","PartialEq<[U]>","iroh::docs::PeerIdBytes"],["","PartialEq<[U; N]>","iroh::docs::PeerIdBytes"],["","PartialEq","iroh::docs::PeerIdBytes"],["§impl<A, B, const N: usize, const M: usize> PartialEq<Vec<A, N>> for [B; M]where\n A: PartialEq<B>,
","PartialEq>","iroh::docs::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> PartialOrd for [T; N]where\n T: PartialOrd,
Implements comparison of arrays lexicographically.
\nsource§fn le(&self, other: &[T; N]) -> bool
This method tests less than or equal to (for self and other) and is used by the <=\noperator. Read more","PartialOrd","iroh::docs::PeerIdBytes"],["§impl<Fut, const N: usize> Race for [Fut; N]where\n Fut: IntoFuture,
§type Output = <Fut as IntoFuture>::Output
The resulting output type.§type Future = Race<<Fut as IntoFuture>::IntoFuture, N>
Which kind of future are we turning this into?","Race","iroh::docs::PeerIdBytes"],["§impl<Fut, T, E, const N: usize> RaceOk for [Fut; N]where\n Fut: IntoFuture<Output = Result<T, E>>,
§type Future = RaceOk<<Fut as IntoFuture>::IntoFuture, T, E, N>
Which kind of future are we turning this into?","RaceOk","iroh::docs::PeerIdBytes"],["","Schema","iroh::docs::PeerIdBytes"],["source§impl<T> Serialize for [T; 32]where\n T: 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","iroh::docs::PeerIdBytes"],["source§impl<const N: usize> Serialize for [u8; N]
source§fn serialize<S>(\n &self,\n serializer: S\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where\n S: Serializer,
","Serialize","iroh::docs::PeerIdBytes"],["1.51.0 · source§impl<T, const N: usize> SlicePattern for [T; N]
","SlicePattern","iroh::docs::PeerIdBytes"],["1.34.0 · source§impl<T, const N: usize> TryFrom<&[T]> for [T; N]where\n T: Copy,
Tries to create an array [T; N] by copying from a slice &[T]. Succeeds if\nslice.len() == N.
\n\nlet bytes: [u8; 3] = [1, 0, 2];\n\nlet bytes_head: [u8; 2] = <[u8; 2]>::try_from(&bytes[0..2]).unwrap();\nassert_eq!(1, u16::from_le_bytes(bytes_head));\n\nlet bytes_tail: [u8; 2] = bytes[1..3].try_into().unwrap();\nassert_eq!(512, u16::from_le_bytes(bytes_tail));
\n§type Error = TryFromSliceError
The type returned in the event of a conversion error.","TryFrom<&[T]>","iroh::docs::PeerIdBytes"],["1.59.0 · source§impl<T, const N: usize> TryFrom<&mut [T]> for [T; N]where\n T: Copy,
Tries to create an array [T; N] by copying from a mutable slice &mut [T].\nSucceeds if slice.len() == N.
\n\nlet mut bytes: [u8; 3] = [1, 0, 2];\n\nlet bytes_head: [u8; 2] = <[u8; 2]>::try_from(&mut bytes[0..2]).unwrap();\nassert_eq!(1, u16::from_le_bytes(bytes_head));\n\nlet bytes_tail: [u8; 2] = (&mut bytes[1..3]).try_into().unwrap();\nassert_eq!(512, u16::from_le_bytes(bytes_tail));
\n§type Error = TryFromSliceError
The type returned in the event of a conversion error.","TryFrom<&mut [T]>","iroh::docs::PeerIdBytes"],["§impl<T, A, const N: usize> TryFrom<Vec<T, A>> for [T; N]where\n A: Allocator,
§fn try_from(vec: Vec<T, A>) -> Result<[T; N], Vec<T, A>>
Gets the entire contents of the Vec<T> as an array,\nif its size exactly matches that of the requested array.
\n§Examples
\nassert_eq!(vec![1, 2, 3].try_into(), Ok([1, 2, 3]));\nassert_eq!(<Vec<i32>>::new().try_into(), Ok([]));
\nIf the length doesn’t match, the input comes back in Err:
\n\nlet r: Result<[i32; 4], _> = (0..10).collect::<Vec<_>>().try_into();\nassert_eq!(r, Err(vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9]));
\nIf you’re fine with just getting a prefix of the Vec<T>,\nyou can call .truncate(N) first.
\n\nlet mut v = String::from(\"hello world\").into_bytes();\nv.sort();\nv.truncate(2);\nlet [a, b]: [_; 2] = v.try_into().unwrap();\nassert_eq!(a, b' ');\nassert_eq!(b, b'd');
\n","TryFrom>","iroh::docs::PeerIdBytes"],["1.48.0 · source§impl<T, A, const N: usize> TryFrom<Vec<T, A>> for [T; N]where\n A: Allocator,
source§fn try_from(vec: Vec<T, A>) -> Result<[T; N], Vec<T, A>>
Gets the entire contents of the Vec<T> as an array,\nif its size exactly matches that of the requested array.
\n§Examples
\nassert_eq!(vec![1, 2, 3].try_into(), Ok([1, 2, 3]));\nassert_eq!(<Vec<i32>>::new().try_into(), Ok([]));
\nIf the length doesn’t match, the input comes back in Err:
\n\nlet r: Result<[i32; 4], _> = (0..10).collect::<Vec<_>>().try_into();\nassert_eq!(r, Err(vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9]));
\nIf you’re fine with just getting a prefix of the Vec<T>,\nyou can call .truncate(N) first.
\n\nlet mut v = String::from(\"hello world\").into_bytes();\nv.sort();\nv.truncate(2);\nlet [a, b]: [_; 2] = v.try_into().unwrap();\nassert_eq!(a, b' ');\nassert_eq!(b, b'd');
\n","TryFrom>","iroh::docs::PeerIdBytes"],["§impl<Fut, T, E, const N: usize> TryJoin for [Fut; N]where\n Fut: IntoFuture<Output = Result<T, E>>,
§type Future = TryJoin<<Fut as IntoFuture>::IntoFuture, T, E, N>
Which kind of future are we turning this into?","TryJoin","iroh::docs::PeerIdBytes"],["§impl<const N: usize, T> Value for [T; N]where\n T: Value,
§type SelfType<'a> = [<T as Value>::SelfType<'a>; N]\nwhere\n [T; N]: 'a
SelfType<’a> must be the same type as Self with all lifetimes replaced with ’a§type AsBytes<'a> = Vec<u8>\nwhere\n [T; N]: 'a
§fn fixed_width() -> Option<usize>
Width of a fixed type, or None for variable width§fn from_bytes<'a>(data: &'a [u8]) -> [<T as Value>::SelfType<'a>; N]where\n [T; N]: 'a,
Deserializes data\nImplementations may return a view over data, or an owned type","Value","iroh::docs::PeerIdBytes"],["","ValueOrd","iroh::docs::PeerIdBytes"],["§impl<Z, const N: usize> Zeroize for [Z; N]where\n Z: Zeroize,
Impl [Zeroize] on arrays of types that impl [Zeroize].
\n","Zeroize","iroh::docs::PeerIdBytes"],["","Zip","iroh::docs::PeerIdBytes"],["source§impl<T, const N: usize> ConstParamTy for [T; N]where\n T: ConstParamTy,
","ConstParamTy","iroh::docs::PeerIdBytes"],["1.58.0 · source§impl<T, const N: usize> Copy for [T; N]where\n T: Copy,
","Copy","iroh::docs::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Eq for [T; N]where\n T: Eq,
","Eq","iroh::docs::PeerIdBytes"],["source§impl<T, const N: usize> StructuralPartialEq for [T; N]
","StructuralPartialEq","iroh::docs::PeerIdBytes"],["§impl<const N: usize, T> Unaligned for [T; N]where\n T: Unaligned,
","Unaligned","iroh::docs::PeerIdBytes"],["§impl<Z, const N: usize> ZeroizeOnDrop for [Z; N]where\n Z: ZeroizeOnDrop,
Impl [ZeroizeOnDrop] on arrays of types that impl [ZeroizeOnDrop].
\n","ZeroizeOnDrop","iroh::docs::PeerIdBytes"]],
-"iroh_docs":[["source§impl<T, const N: usize> [T; N]
1.55.0 · sourcepub fn map<F, U>(self, f: F) -> [U; N]where\n F: FnMut(T) -> U,
Returns an array of the same size as self, with function f applied to each element\nin order.
\nIf you don’t necessarily need a new fixed-size array, consider using\nIterator::map instead.
\n§Note on performance and stack usage
\nUnfortunately, usages of this method are currently not always optimized\nas well as they could be. This mainly concerns large arrays, as mapping\nover small arrays seem to be optimized just fine. Also note that in\ndebug mode (i.e. without any optimizations), this method can use a lot\nof stack space (a few times the size of the array or more).
\nTherefore, in performance-critical code, try to avoid using this method\non large arrays or check the emitted code. Also try to avoid chained\nmaps (e.g. arr.map(...).map(...)).
\nIn many cases, you can instead use Iterator::map by calling .iter()\nor .into_iter() on your array. [T; N]::map is only necessary if you\nreally need a new array of the same size as the result. Rust’s lazy\niterators tend to get optimized very well.
\n§Examples
\nlet x = [1, 2, 3];\nlet y = x.map(|v| v + 1);\nassert_eq!(y, [2, 3, 4]);\n\nlet x = [1, 2, 3];\nlet mut temp = 0;\nlet y = x.map(|v| { temp += 1; v * temp });\nassert_eq!(y, [1, 4, 9]);\n\nlet x = [\"Ferris\", \"Bueller's\", \"Day\", \"Off\"];\nlet y = x.map(|v| v.len());\nassert_eq!(y, [6, 9, 3, 3]);
\nsourcepub fn try_map<F, R>(\n self,\n f: F\n) -> <<R as Try>::Residual as Residual<[<R as Try>::Output; N]>>::TryType
🔬This is a nightly-only experimental API. (array_try_map)
A fallible function f applied to each element on array self in order to\nreturn an array the same size as self or the first error encountered.
\nThe return type of this function depends on the return type of the closure.\nIf you return Result<T, E> from the closure, you’ll get a Result<[T; N], E>.\nIf you return Option<T> from the closure, you’ll get an Option<[T; N]>.
\n§Examples
\n#![feature(array_try_map)]\n\nlet a = [\"1\", \"2\", \"3\"];\nlet b = a.try_map(|v| v.parse::<u32>()).unwrap().map(|v| v + 1);\nassert_eq!(b, [2, 3, 4]);\n\nlet a = [\"1\", \"2a\", \"3\"];\nlet b = a.try_map(|v| v.parse::<u32>());\nassert!(b.is_err());\n\nuse std::num::NonZero;\n\nlet z = [1, 2, 0, 3, 4];\nassert_eq!(z.try_map(NonZero::new), None);\n\nlet a = [1, 2, 3];\nlet b = a.try_map(NonZero::new);\nlet c = b.map(|x| x.map(NonZero::get));\nassert_eq!(c, Some(a));
\n1.57.0 (const: 1.57.0) · sourcepub const fn as_slice(&self) -> &[T]
Returns a slice containing the entire array. Equivalent to &s[..].
\n1.57.0 · sourcepub fn as_mut_slice(&mut self) -> &mut [T]
Returns a mutable slice containing the entire array. Equivalent to\n&mut s[..].
\n1.77.0 · sourcepub fn each_ref(&self) -> [&T; N]
Borrows each element and returns an array of references with the same\nsize as self.
\n§Example
\nlet floats = [3.1, 2.7, -1.0];\nlet float_refs: [&f64; 3] = floats.each_ref();\nassert_eq!(float_refs, [&3.1, &2.7, &-1.0]);
\nThis method is particularly useful if combined with other methods, like\nmap. This way, you can avoid moving the original\narray if its elements are not Copy.
\n\nlet strings = [\"Ferris\".to_string(), \"♥\".to_string(), \"Rust\".to_string()];\nlet is_ascii = strings.each_ref().map(|s| s.is_ascii());\nassert_eq!(is_ascii, [true, false, true]);\n\n// We can still access the original array: it has not been moved.\nassert_eq!(strings.len(), 3);
\n1.77.0 · sourcepub fn each_mut(&mut self) -> [&mut T; N]
Borrows each element mutably and returns an array of mutable references\nwith the same size as self.
\n§Example
\n\nlet mut floats = [3.1, 2.7, -1.0];\nlet float_refs: [&mut f64; 3] = floats.each_mut();\n*float_refs[0] = 0.0;\nassert_eq!(float_refs, [&mut 0.0, &mut 2.7, &mut -1.0]);\nassert_eq!(floats, [0.0, 2.7, -1.0]);
\nsourcepub fn split_array_ref<const M: usize>(&self) -> (&[T; M], &[T])
🔬This is a nightly-only experimental API. (split_array)
Divides one array reference into two at an index.
\nThe first will contain all indices from [0, M) (excluding\nthe index M itself) and the second will contain all\nindices from [M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet v = [1, 2, 3, 4, 5, 6];\n\n{\n let (left, right) = v.split_array_ref::<0>();\n assert_eq!(left, &[]);\n assert_eq!(right, &[1, 2, 3, 4, 5, 6]);\n}\n\n{\n let (left, right) = v.split_array_ref::<2>();\n assert_eq!(left, &[1, 2]);\n assert_eq!(right, &[3, 4, 5, 6]);\n}\n\n{\n let (left, right) = v.split_array_ref::<6>();\n assert_eq!(left, &[1, 2, 3, 4, 5, 6]);\n assert_eq!(right, &[]);\n}
\nsourcepub fn split_array_mut<const M: usize>(&mut self) -> (&mut [T; M], &mut [T])
🔬This is a nightly-only experimental API. (split_array)
Divides one mutable array reference into two at an index.
\nThe first will contain all indices from [0, M) (excluding\nthe index M itself) and the second will contain all\nindices from [M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet mut v = [1, 0, 3, 0, 5, 6];\nlet (left, right) = v.split_array_mut::<2>();\nassert_eq!(left, &mut [1, 0][..]);\nassert_eq!(right, &mut [3, 0, 5, 6]);\nleft[1] = 2;\nright[1] = 4;\nassert_eq!(v, [1, 2, 3, 4, 5, 6]);
\nsourcepub fn rsplit_array_ref<const M: usize>(&self) -> (&[T], &[T; M])
🔬This is a nightly-only experimental API. (split_array)
Divides one array reference into two at an index from the end.
\nThe first will contain all indices from [0, N - M) (excluding\nthe index N - M itself) and the second will contain all\nindices from [N - M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet v = [1, 2, 3, 4, 5, 6];\n\n{\n let (left, right) = v.rsplit_array_ref::<0>();\n assert_eq!(left, &[1, 2, 3, 4, 5, 6]);\n assert_eq!(right, &[]);\n}\n\n{\n let (left, right) = v.rsplit_array_ref::<2>();\n assert_eq!(left, &[1, 2, 3, 4]);\n assert_eq!(right, &[5, 6]);\n}\n\n{\n let (left, right) = v.rsplit_array_ref::<6>();\n assert_eq!(left, &[]);\n assert_eq!(right, &[1, 2, 3, 4, 5, 6]);\n}
\nsourcepub fn rsplit_array_mut<const M: usize>(&mut self) -> (&mut [T], &mut [T; M])
🔬This is a nightly-only experimental API. (split_array)
Divides one mutable array reference into two at an index from the end.
\nThe first will contain all indices from [0, N - M) (excluding\nthe index N - M itself) and the second will contain all\nindices from [N - M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet mut v = [1, 0, 3, 0, 5, 6];\nlet (left, right) = v.rsplit_array_mut::<4>();\nassert_eq!(left, &mut [1, 0]);\nassert_eq!(right, &mut [3, 0, 5, 6][..]);\nleft[1] = 2;\nright[1] = 4;\nassert_eq!(v, [1, 2, 3, 4, 5, 6]);
\n",0,"iroh_docs::sync::PeerIdBytes"],["source§impl<const N: usize> [u8; N]
sourcepub const fn as_ascii(&self) -> Option<&[AsciiChar; N]>
🔬This is a nightly-only experimental API. (ascii_char)
Converts this array of bytes into a array of ASCII characters,\nor returns None if any of the characters is non-ASCII.
\n§Examples
\n#![feature(ascii_char)]\n#![feature(const_option)]\n\nconst HEX_DIGITS: [std::ascii::Char; 16] =\n *b\"0123456789abcdef\".as_ascii().unwrap();\n\nassert_eq!(HEX_DIGITS[1].as_str(), \"1\");\nassert_eq!(HEX_DIGITS[10].as_str(), \"a\");
\nsourcepub const unsafe fn as_ascii_unchecked(&self) -> &[AsciiChar; N]
🔬This is a nightly-only experimental API. (ascii_char)
Converts this array of bytes into a array of ASCII characters,\nwithout checking whether they’re valid.
\n§Safety
\nEvery byte in the array must be in 0..=127, or else this is UB.
\n",0,"iroh_docs::sync::PeerIdBytes"],["§impl<T> Array for [T; 32]where\n T: Default,
§fn as_slice_mut(&mut self) -> &mut [T]
Gives a unique slice over the whole thing. Read more","Array","iroh_docs::sync::PeerIdBytes"],["","Array","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> AsBytes for [T; N]where\n T: AsBytes,
§fn write_to_prefix(&self, bytes: &mut [u8]) -> Option<()>
","AsBytes","iroh_docs::sync::PeerIdBytes"],["","AsBytes","iroh_docs::sync::PeerIdBytes"],["","AsMut<[T]>","iroh_docs::sync::PeerIdBytes"],["","AsRef<[T]>","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> BitView for [T; N]where\n T: BitStore,
Note that overly-large arrays may cause the conversions to fail.
\n§fn view_bits<O>(&self) -> &BitSlice<T, O>where\n O: BitOrder,
Views a memory region as an immutable bit-slice.§fn try_view_bits<O>(&self) -> Result<&BitSlice<T, O>, BitSpanError<T>>where\n O: BitOrder,
Attempts to view a memory region as an immutable bit-slice. Read more§fn view_bits_mut<O>(&mut self) -> &mut BitSlice<T, O>where\n O: BitOrder,
Views a memory region as a mutable bit-slice.§fn try_view_bits_mut<O>(\n &mut self\n) -> Result<&mut BitSlice<T, O>, BitSpanError<T>>where\n O: BitOrder,
Attempts to view a memory region as a mutable bit-slice. Read more","BitView","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> BitViewSized for [T; N]where\n T: BitStore,
§fn as_raw_slice(&self) -> &[<[T; N] as BitView>::Store]
Views the type as a slice of its elements.§fn as_raw_mut_slice(&mut self) -> &mut [<[T; N] as BitView>::Store]
Views the type as a mutable slice of its elements.§fn into_bitarray<O>(self) -> BitArray<Self, O>where\n O: BitOrder,
Wraps self in a BitArray.","BitViewSized","iroh_docs::sync::PeerIdBytes"],["","Borrow<[T]>","iroh_docs::sync::PeerIdBytes"],["1.4.0 · source§impl<T, const N: usize> BorrowMut<[T]> for [T; N]
source§fn borrow_mut(&mut self) -> &mut [T]
Mutably borrows from an owned value. Read more","BorrowMut<[T]>","iroh_docs::sync::PeerIdBytes"],["","Chain","iroh_docs::sync::PeerIdBytes"],["","Clone","iroh_docs::sync::PeerIdBytes"],["","Debug","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize> Decode for [u8; N]
Decodes a byte array from byte[n] as described in RFC4251 § 5:
\n\nA byte represents an arbitrary 8-bit value (octet). Fixed length\ndata is sometimes represented as an array of bytes, written\nbyte[n], where n is the number of bytes in the array.
\n
\n","Decode","iroh_docs::sync::PeerIdBytes"],["§impl<'a, T, const N: usize> DecodeValue<'a> for [T; N]where\n T: Decode<'a>,
§fn decode_value<R>(reader: &mut R, header: Header) -> Result<[T; N], Error>where\n R: Reader<'a>,
Attempt to decode this message using the provided [Reader].","DecodeValue<'a>","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["source§impl<'de, T> Deserialize<'de> for [T; 32]where\n T: Deserialize<'de>,
source§fn deserialize<D>(\n deserializer: D\n) -> Result<[T; 32], <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more","Deserialize<'de>","iroh_docs::sync::PeerIdBytes"],["source§impl<'de, const N: usize> Deserialize<'de> for [u8; N]
source§fn deserialize<D>(\n deserializer: D\n) -> Result<[u8; N], <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
","Deserialize<'de>","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize> Encode for [u8; N]
Encodes [u8; N] into byte[n] as described in RFC4251 § 5:
\n\nA byte represents an arbitrary 8-bit value (octet). Fixed length\ndata is sometimes represented as an array of bytes, written\nbyte[n], where n is the number of bytes in the array.
\n
\n§fn encoded_len(&self) -> Result<usize, Error>
Get the length of this type encoded in bytes, prior to Base64 encoding.§fn encode(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value using the provided [Writer].§fn encoded_len_prefixed(&self) -> Result<usize, Error>
Return the length of this type after encoding when prepended with a\nuint32 length prefix.§fn encode_prefixed(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value, first prepending a uint32 length prefix\nset to [Encode::encoded_len].","Encode","iroh_docs::sync::PeerIdBytes"],["","EncodeLabelSet","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> EncodeValue for [T; N]where\n T: Encode,
","EncodeValue","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["§impl<'a> FindToken<&'a u8> for [u8; 32]
§fn find_token(&self, token: &u8) -> bool
Returns true if self contains the token","FindToken<&'a u8>","iroh_docs::sync::PeerIdBytes"],["§impl FindToken<u8> for [u8; 32]
§fn find_token(&self, token: u8) -> bool
Returns true if self contains the token","FindToken","iroh_docs::sync::PeerIdBytes"],["","FixedTag","iroh_docs::sync::PeerIdBytes"],["","From<&Signature>","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["§impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>>> for [T; 32]
","From, B0>, B0>, B0>, B0>, B0>>>","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["","From>","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["source§impl From<NamespaceId> for [u8; 32]
source§fn from(value: NamespaceId) -> Self
Converts to this type from the input type.","From","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["","From>","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> FromBytes for [T; N]where\n T: FromBytes,
§fn slice_from_prefix(bytes: &[u8], count: usize) -> Option<(&[Self], &[u8])>where\n Self: Sized,
Interprets the prefix of the given bytes as a &[Self] with length\nequal to count without copying. Read more§fn slice_from_suffix(bytes: &[u8], count: usize) -> Option<(&[u8], &[Self])>where\n Self: Sized,
Interprets the suffix of the given bytes as a &[Self] with length\nequal to count without copying. Read more§fn read_from_prefix(bytes: &[u8]) -> Option<Self>where\n Self: Sized,
","FromBytes","iroh_docs::sync::PeerIdBytes"],["","FromHex","iroh_docs::sync::PeerIdBytes"],["","FromZeroes","iroh_docs::sync::PeerIdBytes"],["","Hash","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Hash for [T; N]where\n T: Hash,
The hash of an array is the same as that of the corresponding slice,\nas required by the Borrow implementation.
\n\nuse std::hash::BuildHasher;\n\nlet b = std::hash::RandomState::new();\nlet a: [u8; 3] = [0xa8, 0x3c, 0x09];\nlet s: &[u8] = &[0xa8, 0x3c, 0x09];\nassert_eq!(b.hash_one(a), b.hash_one(s));
\n","Hash","iroh_docs::sync::PeerIdBytes"],["","Index","iroh_docs::sync::PeerIdBytes"],["","IndexMut","iroh_docs::sync::PeerIdBytes"],["","InputLength","iroh_docs::sync::PeerIdBytes"],["1.53.0 · source§impl<T, const N: usize> IntoIterator for [T; N]
source§fn into_iter(self) -> <[T; N] as IntoIterator>::IntoIter
Creates a consuming iterator, that is, one that moves each value out of\nthe array (from start to end). The array cannot be used after calling\nthis unless T implements Copy, so the whole array is copied.
\nArrays have special behavior when calling .into_iter() prior to the\n2021 edition – see the array Editions section for more information.
\n","IntoIterator","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize> IntoResponse for [u8; N]
§fn into_response(self) -> Response<Body>
Create a response.","IntoResponse","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, const N: usize> Join for [Fut; N]where\n Fut: IntoFuture,
§type Output = [<Fut as IntoFuture>::Output; N]
The resulting output type.§type Future = Join<<Fut as IntoFuture>::IntoFuture, N>
The Future implementation returned by this method.","Join","iroh_docs::sync::PeerIdBytes"],["","Key","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> MaxSize for [T; N]where\n T: MaxSize,
§const POSTCARD_MAX_SIZE: usize = _
The maximum possible size that the serialization of this\ntype can have, in bytes.","MaxSize","iroh_docs::sync::PeerIdBytes"],["","Merge","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Ord for [T; N]where\n T: Ord,
Implements comparison of arrays lexicographically.
\n1.21.0 · source§fn max(self, other: Self) -> Selfwhere\n Self: Sized,
Compares and returns the maximum of two values. Read more","Ord","iroh_docs::sync::PeerIdBytes"],["","PartialEq<&[U]>","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, U, const N: usize> PartialEq<&mut [U]> for [T; N]where\n T: PartialEq<U>,
","PartialEq<&mut [U]>","iroh_docs::sync::PeerIdBytes"],["","PartialEq<[U]>","iroh_docs::sync::PeerIdBytes"],["","PartialEq<[U; N]>","iroh_docs::sync::PeerIdBytes"],["","PartialEq","iroh_docs::sync::PeerIdBytes"],["§impl<A, B, const N: usize, const M: usize> PartialEq<Vec<A, N>> for [B; M]where\n A: PartialEq<B>,
","PartialEq>","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> PartialOrd for [T; N]where\n T: PartialOrd,
Implements comparison of arrays lexicographically.
\nsource§fn le(&self, other: &[T; N]) -> bool
This method tests less than or equal to (for self and other) and is used by the <=\noperator. Read more","PartialOrd","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, const N: usize> Race for [Fut; N]where\n Fut: IntoFuture,
§type Output = <Fut as IntoFuture>::Output
The resulting output type.§type Future = Race<<Fut as IntoFuture>::IntoFuture, N>
Which kind of future are we turning this into?","Race","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, T, E, const N: usize> RaceOk for [Fut; N]where\n Fut: IntoFuture<Output = Result<T, E>>,
§type Future = RaceOk<<Fut as IntoFuture>::IntoFuture, T, E, N>
Which kind of future are we turning this into?","RaceOk","iroh_docs::sync::PeerIdBytes"],["","Schema","iroh_docs::sync::PeerIdBytes"],["source§impl<T> Serialize for [T; 32]where\n T: 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","iroh_docs::sync::PeerIdBytes"],["source§impl<const N: usize> Serialize for [u8; N]
source§fn serialize<S>(\n &self,\n serializer: S\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where\n S: Serializer,
","Serialize","iroh_docs::sync::PeerIdBytes"],["1.51.0 · source§impl<T, const N: usize> SlicePattern for [T; N]
","SlicePattern","iroh_docs::sync::PeerIdBytes"],["1.34.0 · source§impl<T, const N: usize> TryFrom<&[T]> for [T; N]where\n T: Copy,
Tries to create an array [T; N] by copying from a slice &[T]. Succeeds if\nslice.len() == N.
\n\nlet bytes: [u8; 3] = [1, 0, 2];\n\nlet bytes_head: [u8; 2] = <[u8; 2]>::try_from(&bytes[0..2]).unwrap();\nassert_eq!(1, u16::from_le_bytes(bytes_head));\n\nlet bytes_tail: [u8; 2] = bytes[1..3].try_into().unwrap();\nassert_eq!(512, u16::from_le_bytes(bytes_tail));
\n§type Error = TryFromSliceError
The type returned in the event of a conversion error.","TryFrom<&[T]>","iroh_docs::sync::PeerIdBytes"],["1.59.0 · source§impl<T, const N: usize> TryFrom<&mut [T]> for [T; N]where\n T: Copy,
Tries to create an array [T; N] by copying from a mutable slice &mut [T].\nSucceeds if slice.len() == N.
\n\nlet mut bytes: [u8; 3] = [1, 0, 2];\n\nlet bytes_head: [u8; 2] = <[u8; 2]>::try_from(&mut bytes[0..2]).unwrap();\nassert_eq!(1, u16::from_le_bytes(bytes_head));\n\nlet bytes_tail: [u8; 2] = (&mut bytes[1..3]).try_into().unwrap();\nassert_eq!(512, u16::from_le_bytes(bytes_tail));
\n§type Error = TryFromSliceError
The type returned in the event of a conversion error.","TryFrom<&mut [T]>","iroh_docs::sync::PeerIdBytes"],["§impl<T, A, const N: usize> TryFrom<Vec<T, A>> for [T; N]where\n A: Allocator,
§fn try_from(vec: Vec<T, A>) -> Result<[T; N], Vec<T, A>>
Gets the entire contents of the Vec<T> as an array,\nif its size exactly matches that of the requested array.
\n§Examples
\nassert_eq!(vec![1, 2, 3].try_into(), Ok([1, 2, 3]));\nassert_eq!(<Vec<i32>>::new().try_into(), Ok([]));
\nIf the length doesn’t match, the input comes back in Err:
\n\nlet r: Result<[i32; 4], _> = (0..10).collect::<Vec<_>>().try_into();\nassert_eq!(r, Err(vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9]));
\nIf you’re fine with just getting a prefix of the Vec<T>,\nyou can call .truncate(N) first.
\n\nlet mut v = String::from(\"hello world\").into_bytes();\nv.sort();\nv.truncate(2);\nlet [a, b]: [_; 2] = v.try_into().unwrap();\nassert_eq!(a, b' ');\nassert_eq!(b, b'd');
\n","TryFrom>","iroh_docs::sync::PeerIdBytes"],["1.48.0 · source§impl<T, A, const N: usize> TryFrom<Vec<T, A>> for [T; N]where\n A: Allocator,
source§fn try_from(vec: Vec<T, A>) -> Result<[T; N], Vec<T, A>>
Gets the entire contents of the Vec<T> as an array,\nif its size exactly matches that of the requested array.
\n§Examples
\nassert_eq!(vec![1, 2, 3].try_into(), Ok([1, 2, 3]));\nassert_eq!(<Vec<i32>>::new().try_into(), Ok([]));
\nIf the length doesn’t match, the input comes back in Err:
\n\nlet r: Result<[i32; 4], _> = (0..10).collect::<Vec<_>>().try_into();\nassert_eq!(r, Err(vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9]));
\nIf you’re fine with just getting a prefix of the Vec<T>,\nyou can call .truncate(N) first.
\n\nlet mut v = String::from(\"hello world\").into_bytes();\nv.sort();\nv.truncate(2);\nlet [a, b]: [_; 2] = v.try_into().unwrap();\nassert_eq!(a, b' ');\nassert_eq!(b, b'd');
\n","TryFrom>","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, T, E, const N: usize> TryJoin for [Fut; N]where\n Fut: IntoFuture<Output = Result<T, E>>,
§type Future = TryJoin<<Fut as IntoFuture>::IntoFuture, T, E, N>
Which kind of future are we turning this into?","TryJoin","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> Value for [T; N]where\n T: Value,
§type SelfType<'a> = [<T as Value>::SelfType<'a>; N]\nwhere\n [T; N]: 'a
SelfType<’a> must be the same type as Self with all lifetimes replaced with ’a§type AsBytes<'a> = Vec<u8>\nwhere\n [T; N]: 'a
§fn fixed_width() -> Option<usize>
Width of a fixed type, or None for variable width§fn from_bytes<'a>(data: &'a [u8]) -> [<T as Value>::SelfType<'a>; N]where\n [T; N]: 'a,
Deserializes data\nImplementations may return a view over data, or an owned type","Value","iroh_docs::sync::PeerIdBytes"],["","ValueOrd","iroh_docs::sync::PeerIdBytes"],["§impl<Z, const N: usize> Zeroize for [Z; N]where\n Z: Zeroize,
Impl [Zeroize] on arrays of types that impl [Zeroize].
\n","Zeroize","iroh_docs::sync::PeerIdBytes"],["","Zip","iroh_docs::sync::PeerIdBytes"],["source§impl<T, const N: usize> ConstParamTy for [T; N]where\n T: ConstParamTy,
","ConstParamTy","iroh_docs::sync::PeerIdBytes"],["1.58.0 · source§impl<T, const N: usize> Copy for [T; N]where\n T: Copy,
","Copy","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Eq for [T; N]where\n T: Eq,
","Eq","iroh_docs::sync::PeerIdBytes"],["source§impl<T, const N: usize> StructuralPartialEq for [T; N]
","StructuralPartialEq","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> Unaligned for [T; N]where\n T: Unaligned,
","Unaligned","iroh_docs::sync::PeerIdBytes"],["§impl<Z, const N: usize> ZeroizeOnDrop for [Z; N]where\n Z: ZeroizeOnDrop,
Impl [ZeroizeOnDrop] on arrays of types that impl [ZeroizeOnDrop].
\n","ZeroizeOnDrop","iroh_docs::sync::PeerIdBytes"]]
+"iroh_docs":[["source§impl<T, const N: usize> [T; N]
1.55.0 · sourcepub fn map<F, U>(self, f: F) -> [U; N]where\n F: FnMut(T) -> U,
Returns an array of the same size as self, with function f applied to each element\nin order.
\nIf you don’t necessarily need a new fixed-size array, consider using\nIterator::map instead.
\n§Note on performance and stack usage
\nUnfortunately, usages of this method are currently not always optimized\nas well as they could be. This mainly concerns large arrays, as mapping\nover small arrays seem to be optimized just fine. Also note that in\ndebug mode (i.e. without any optimizations), this method can use a lot\nof stack space (a few times the size of the array or more).
\nTherefore, in performance-critical code, try to avoid using this method\non large arrays or check the emitted code. Also try to avoid chained\nmaps (e.g. arr.map(...).map(...)).
\nIn many cases, you can instead use Iterator::map by calling .iter()\nor .into_iter() on your array. [T; N]::map is only necessary if you\nreally need a new array of the same size as the result. Rust’s lazy\niterators tend to get optimized very well.
\n§Examples
\nlet x = [1, 2, 3];\nlet y = x.map(|v| v + 1);\nassert_eq!(y, [2, 3, 4]);\n\nlet x = [1, 2, 3];\nlet mut temp = 0;\nlet y = x.map(|v| { temp += 1; v * temp });\nassert_eq!(y, [1, 4, 9]);\n\nlet x = [\"Ferris\", \"Bueller's\", \"Day\", \"Off\"];\nlet y = x.map(|v| v.len());\nassert_eq!(y, [6, 9, 3, 3]);
\nsourcepub fn try_map<F, R>(\n self,\n f: F\n) -> <<R as Try>::Residual as Residual<[<R as Try>::Output; N]>>::TryType
🔬This is a nightly-only experimental API. (array_try_map)
A fallible function f applied to each element on array self in order to\nreturn an array the same size as self or the first error encountered.
\nThe return type of this function depends on the return type of the closure.\nIf you return Result<T, E> from the closure, you’ll get a Result<[T; N], E>.\nIf you return Option<T> from the closure, you’ll get an Option<[T; N]>.
\n§Examples
\n#![feature(array_try_map)]\n\nlet a = [\"1\", \"2\", \"3\"];\nlet b = a.try_map(|v| v.parse::<u32>()).unwrap().map(|v| v + 1);\nassert_eq!(b, [2, 3, 4]);\n\nlet a = [\"1\", \"2a\", \"3\"];\nlet b = a.try_map(|v| v.parse::<u32>());\nassert!(b.is_err());\n\nuse std::num::NonZero;\n\nlet z = [1, 2, 0, 3, 4];\nassert_eq!(z.try_map(NonZero::new), None);\n\nlet a = [1, 2, 3];\nlet b = a.try_map(NonZero::new);\nlet c = b.map(|x| x.map(NonZero::get));\nassert_eq!(c, Some(a));
\n1.57.0 (const: 1.57.0) · sourcepub const fn as_slice(&self) -> &[T]
Returns a slice containing the entire array. Equivalent to &s[..].
\n1.57.0 · sourcepub fn as_mut_slice(&mut self) -> &mut [T]
Returns a mutable slice containing the entire array. Equivalent to\n&mut s[..].
\n1.77.0 · sourcepub fn each_ref(&self) -> [&T; N]
Borrows each element and returns an array of references with the same\nsize as self.
\n§Example
\nlet floats = [3.1, 2.7, -1.0];\nlet float_refs: [&f64; 3] = floats.each_ref();\nassert_eq!(float_refs, [&3.1, &2.7, &-1.0]);
\nThis method is particularly useful if combined with other methods, like\nmap. This way, you can avoid moving the original\narray if its elements are not Copy.
\n\nlet strings = [\"Ferris\".to_string(), \"♥\".to_string(), \"Rust\".to_string()];\nlet is_ascii = strings.each_ref().map(|s| s.is_ascii());\nassert_eq!(is_ascii, [true, false, true]);\n\n// We can still access the original array: it has not been moved.\nassert_eq!(strings.len(), 3);
\n1.77.0 · sourcepub fn each_mut(&mut self) -> [&mut T; N]
Borrows each element mutably and returns an array of mutable references\nwith the same size as self.
\n§Example
\n\nlet mut floats = [3.1, 2.7, -1.0];\nlet float_refs: [&mut f64; 3] = floats.each_mut();\n*float_refs[0] = 0.0;\nassert_eq!(float_refs, [&mut 0.0, &mut 2.7, &mut -1.0]);\nassert_eq!(floats, [0.0, 2.7, -1.0]);
\nsourcepub fn split_array_ref<const M: usize>(&self) -> (&[T; M], &[T])
🔬This is a nightly-only experimental API. (split_array)
Divides one array reference into two at an index.
\nThe first will contain all indices from [0, M) (excluding\nthe index M itself) and the second will contain all\nindices from [M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet v = [1, 2, 3, 4, 5, 6];\n\n{\n let (left, right) = v.split_array_ref::<0>();\n assert_eq!(left, &[]);\n assert_eq!(right, &[1, 2, 3, 4, 5, 6]);\n}\n\n{\n let (left, right) = v.split_array_ref::<2>();\n assert_eq!(left, &[1, 2]);\n assert_eq!(right, &[3, 4, 5, 6]);\n}\n\n{\n let (left, right) = v.split_array_ref::<6>();\n assert_eq!(left, &[1, 2, 3, 4, 5, 6]);\n assert_eq!(right, &[]);\n}
\nsourcepub fn split_array_mut<const M: usize>(&mut self) -> (&mut [T; M], &mut [T])
🔬This is a nightly-only experimental API. (split_array)
Divides one mutable array reference into two at an index.
\nThe first will contain all indices from [0, M) (excluding\nthe index M itself) and the second will contain all\nindices from [M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet mut v = [1, 0, 3, 0, 5, 6];\nlet (left, right) = v.split_array_mut::<2>();\nassert_eq!(left, &mut [1, 0][..]);\nassert_eq!(right, &mut [3, 0, 5, 6]);\nleft[1] = 2;\nright[1] = 4;\nassert_eq!(v, [1, 2, 3, 4, 5, 6]);
\nsourcepub fn rsplit_array_ref<const M: usize>(&self) -> (&[T], &[T; M])
🔬This is a nightly-only experimental API. (split_array)
Divides one array reference into two at an index from the end.
\nThe first will contain all indices from [0, N - M) (excluding\nthe index N - M itself) and the second will contain all\nindices from [N - M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet v = [1, 2, 3, 4, 5, 6];\n\n{\n let (left, right) = v.rsplit_array_ref::<0>();\n assert_eq!(left, &[1, 2, 3, 4, 5, 6]);\n assert_eq!(right, &[]);\n}\n\n{\n let (left, right) = v.rsplit_array_ref::<2>();\n assert_eq!(left, &[1, 2, 3, 4]);\n assert_eq!(right, &[5, 6]);\n}\n\n{\n let (left, right) = v.rsplit_array_ref::<6>();\n assert_eq!(left, &[]);\n assert_eq!(right, &[1, 2, 3, 4, 5, 6]);\n}
\nsourcepub fn rsplit_array_mut<const M: usize>(&mut self) -> (&mut [T], &mut [T; M])
🔬This is a nightly-only experimental API. (split_array)
Divides one mutable array reference into two at an index from the end.
\nThe first will contain all indices from [0, N - M) (excluding\nthe index N - M itself) and the second will contain all\nindices from [N - M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet mut v = [1, 0, 3, 0, 5, 6];\nlet (left, right) = v.rsplit_array_mut::<4>();\nassert_eq!(left, &mut [1, 0]);\nassert_eq!(right, &mut [3, 0, 5, 6][..]);\nleft[1] = 2;\nright[1] = 4;\nassert_eq!(v, [1, 2, 3, 4, 5, 6]);
\n",0,"iroh_docs::sync::PeerIdBytes"],["source§impl<const N: usize> [u8; N]
sourcepub const fn as_ascii(&self) -> Option<&[AsciiChar; N]>
🔬This is a nightly-only experimental API. (ascii_char)
Converts this array of bytes into a array of ASCII characters,\nor returns None if any of the characters is non-ASCII.
\n§Examples
\n#![feature(ascii_char)]\n#![feature(const_option)]\n\nconst HEX_DIGITS: [std::ascii::Char; 16] =\n *b\"0123456789abcdef\".as_ascii().unwrap();\n\nassert_eq!(HEX_DIGITS[1].as_str(), \"1\");\nassert_eq!(HEX_DIGITS[10].as_str(), \"a\");
\nsourcepub const unsafe fn as_ascii_unchecked(&self) -> &[AsciiChar; N]
🔬This is a nightly-only experimental API. (ascii_char)
Converts this array of bytes into a array of ASCII characters,\nwithout checking whether they’re valid.
\n§Safety
\nEvery byte in the array must be in 0..=127, or else this is UB.
\n",0,"iroh_docs::sync::PeerIdBytes"],["§impl<T> Array for [T; 32]where\n T: Default,
§fn as_slice_mut(&mut self) -> &mut [T]
Gives a unique slice over the whole thing. Read more","Array","iroh_docs::sync::PeerIdBytes"],["","Array","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> AsBytes for [T; N]where\n T: AsBytes,
§fn write_to_prefix(&self, bytes: &mut [u8]) -> Option<()>
","AsBytes","iroh_docs::sync::PeerIdBytes"],["","AsBytes","iroh_docs::sync::PeerIdBytes"],["","AsMut<[T]>","iroh_docs::sync::PeerIdBytes"],["","AsRef<[T]>","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> BitView for [T; N]where\n T: BitStore,
Note that overly-large arrays may cause the conversions to fail.
\n§fn view_bits<O>(&self) -> &BitSlice<T, O>where\n O: BitOrder,
Views a memory region as an immutable bit-slice.§fn try_view_bits<O>(&self) -> Result<&BitSlice<T, O>, BitSpanError<T>>where\n O: BitOrder,
Attempts to view a memory region as an immutable bit-slice. Read more§fn view_bits_mut<O>(&mut self) -> &mut BitSlice<T, O>where\n O: BitOrder,
Views a memory region as a mutable bit-slice.§fn try_view_bits_mut<O>(\n &mut self\n) -> Result<&mut BitSlice<T, O>, BitSpanError<T>>where\n O: BitOrder,
Attempts to view a memory region as a mutable bit-slice. Read more","BitView","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> BitViewSized for [T; N]where\n T: BitStore,
§fn as_raw_slice(&self) -> &[<[T; N] as BitView>::Store]
Views the type as a slice of its elements.§fn as_raw_mut_slice(&mut self) -> &mut [<[T; N] as BitView>::Store]
Views the type as a mutable slice of its elements.§fn into_bitarray<O>(self) -> BitArray<Self, O>where\n O: BitOrder,
Wraps self in a BitArray.","BitViewSized","iroh_docs::sync::PeerIdBytes"],["","Borrow<[T]>","iroh_docs::sync::PeerIdBytes"],["1.4.0 · source§impl<T, const N: usize> BorrowMut<[T]> for [T; N]
source§fn borrow_mut(&mut self) -> &mut [T]
Mutably borrows from an owned value. Read more","BorrowMut<[T]>","iroh_docs::sync::PeerIdBytes"],["","Chain","iroh_docs::sync::PeerIdBytes"],["","Clone","iroh_docs::sync::PeerIdBytes"],["","Debug","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize> Decode for [u8; N]
Decodes a byte array from byte[n] as described in RFC4251 § 5:
\n\nA byte represents an arbitrary 8-bit value (octet). Fixed length\ndata is sometimes represented as an array of bytes, written\nbyte[n], where n is the number of bytes in the array.
\n
\n","Decode","iroh_docs::sync::PeerIdBytes"],["§impl<'a, T, const N: usize> DecodeValue<'a> for [T; N]where\n T: Decode<'a>,
§fn decode_value<R>(reader: &mut R, header: Header) -> Result<[T; N], Error>where\n R: Reader<'a>,
Attempt to decode this message using the provided [Reader].","DecodeValue<'a>","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["source§impl<'de, T> Deserialize<'de> for [T; 32]where\n T: Deserialize<'de>,
source§fn deserialize<D>(\n deserializer: D\n) -> Result<[T; 32], <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more","Deserialize<'de>","iroh_docs::sync::PeerIdBytes"],["source§impl<'de, const N: usize> Deserialize<'de> for [u8; N]
source§fn deserialize<D>(\n deserializer: D\n) -> Result<[u8; N], <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
","Deserialize<'de>","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize> Encode for [u8; N]
Encodes [u8; N] into byte[n] as described in RFC4251 § 5:
\n\nA byte represents an arbitrary 8-bit value (octet). Fixed length\ndata is sometimes represented as an array of bytes, written\nbyte[n], where n is the number of bytes in the array.
\n
\n§fn encoded_len(&self) -> Result<usize, Error>
Get the length of this type encoded in bytes, prior to Base64 encoding.§fn encode(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value using the provided [Writer].§fn encoded_len_prefixed(&self) -> Result<usize, Error>
Return the length of this type after encoding when prepended with a\nuint32 length prefix.§fn encode_prefixed(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value, first prepending a uint32 length prefix\nset to [Encode::encoded_len].","Encode","iroh_docs::sync::PeerIdBytes"],["","EncodeLabelSet","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> EncodeValue for [T; N]where\n T: Encode,
","EncodeValue","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["§impl<'a> FindToken<&'a u8> for [u8; 32]
§fn find_token(&self, token: &u8) -> bool
Returns true if self contains the token","FindToken<&'a u8>","iroh_docs::sync::PeerIdBytes"],["§impl FindToken<u8> for [u8; 32]
§fn find_token(&self, token: u8) -> bool
Returns true if self contains the token","FindToken","iroh_docs::sync::PeerIdBytes"],["","FixedTag","iroh_docs::sync::PeerIdBytes"],["","From<&Signature>","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["§impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>>> for [T; 32]
","From, B0>, B0>, B0>, B0>, B0>>>","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["","From>","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["source§impl From<NamespaceId> for [u8; 32]
source§fn from(value: NamespaceId) -> Self
Converts to this type from the input type.","From","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["","From>","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> FromBytes for [T; N]where\n T: FromBytes,
§fn slice_from_prefix(bytes: &[u8], count: usize) -> Option<(&[Self], &[u8])>where\n Self: Sized,
Interprets the prefix of the given bytes as a &[Self] with length\nequal to count without copying. Read more§fn slice_from_suffix(bytes: &[u8], count: usize) -> Option<(&[u8], &[Self])>where\n Self: Sized,
Interprets the suffix of the given bytes as a &[Self] with length\nequal to count without copying. Read more§fn read_from_prefix(bytes: &[u8]) -> Option<Self>where\n Self: Sized,
","FromBytes","iroh_docs::sync::PeerIdBytes"],["","FromHex","iroh_docs::sync::PeerIdBytes"],["","FromZeroes","iroh_docs::sync::PeerIdBytes"],["","Hash","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Hash for [T; N]where\n T: Hash,
The hash of an array is the same as that of the corresponding slice,\nas required by the Borrow implementation.
\n\nuse std::hash::BuildHasher;\n\nlet b = std::hash::RandomState::new();\nlet a: [u8; 3] = [0xa8, 0x3c, 0x09];\nlet s: &[u8] = &[0xa8, 0x3c, 0x09];\nassert_eq!(b.hash_one(a), b.hash_one(s));
\n","Hash","iroh_docs::sync::PeerIdBytes"],["","Index","iroh_docs::sync::PeerIdBytes"],["","IndexMut","iroh_docs::sync::PeerIdBytes"],["","InputLength","iroh_docs::sync::PeerIdBytes"],["1.53.0 · source§impl<T, const N: usize> IntoIterator for [T; N]
source§fn into_iter(self) -> <[T; N] as IntoIterator>::IntoIter
Creates a consuming iterator, that is, one that moves each value out of\nthe array (from start to end). The array cannot be used after calling\nthis unless T implements Copy, so the whole array is copied.
\nArrays have special behavior when calling .into_iter() prior to the\n2021 edition – see the array Editions section for more information.
\n","IntoIterator","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize> IntoResponse for [u8; N]
§fn into_response(self) -> Response<Body>
Create a response.","IntoResponse","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, const N: usize> Join for [Fut; N]where\n Fut: IntoFuture,
§type Output = [<Fut as IntoFuture>::Output; N]
The resulting output type.§type Future = Join<<Fut as IntoFuture>::IntoFuture, N>
The Future implementation returned by this method.","Join","iroh_docs::sync::PeerIdBytes"],["","Key","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> MaxSize for [T; N]where\n T: MaxSize,
§const POSTCARD_MAX_SIZE: usize = _
The maximum possible size that the serialization of this\ntype can have, in bytes.","MaxSize","iroh_docs::sync::PeerIdBytes"],["","Merge","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Ord for [T; N]where\n T: Ord,
Implements comparison of arrays lexicographically.
\n1.21.0 · source§fn max(self, other: Self) -> Selfwhere\n Self: Sized,
Compares and returns the maximum of two values. Read more","Ord","iroh_docs::sync::PeerIdBytes"],["","PartialEq<&[U]>","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, U, const N: usize> PartialEq<&mut [U]> for [T; N]where\n T: PartialEq<U>,
","PartialEq<&mut [U]>","iroh_docs::sync::PeerIdBytes"],["","PartialEq<[U]>","iroh_docs::sync::PeerIdBytes"],["","PartialEq<[U; N]>","iroh_docs::sync::PeerIdBytes"],["","PartialEq","iroh_docs::sync::PeerIdBytes"],["§impl<A, B, const N: usize, const M: usize> PartialEq<Vec<A, N>> for [B; M]where\n A: PartialEq<B>,
","PartialEq>","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> PartialOrd for [T; N]where\n T: PartialOrd,
Implements comparison of arrays lexicographically.
\nsource§fn le(&self, other: &[T; N]) -> bool
This method tests less than or equal to (for self and other) and is used by the <=\noperator. Read more","PartialOrd","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, const N: usize> Race for [Fut; N]where\n Fut: IntoFuture,
§type Output = <Fut as IntoFuture>::Output
The resulting output type.§type Future = Race<<Fut as IntoFuture>::IntoFuture, N>
Which kind of future are we turning this into?","Race","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, T, E, const N: usize> RaceOk for [Fut; N]where\n Fut: IntoFuture<Output = Result<T, E>>,
§type Future = RaceOk<<Fut as IntoFuture>::IntoFuture, T, E, N>
Which kind of future are we turning this into?","RaceOk","iroh_docs::sync::PeerIdBytes"],["","Schema","iroh_docs::sync::PeerIdBytes"],["source§impl<T> Serialize for [T; 32]where\n T: 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","iroh_docs::sync::PeerIdBytes"],["source§impl<const N: usize> Serialize for [u8; N]
source§fn serialize<S>(\n &self,\n serializer: S\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where\n S: Serializer,
","Serialize","iroh_docs::sync::PeerIdBytes"],["1.51.0 · source§impl<T, const N: usize> SlicePattern for [T; N]
","SlicePattern","iroh_docs::sync::PeerIdBytes"],["1.34.0 · source§impl<T, const N: usize> TryFrom<&[T]> for [T; N]where\n T: Copy,
Tries to create an array [T; N] by copying from a slice &[T]. Succeeds if\nslice.len() == N.
\n\nlet bytes: [u8; 3] = [1, 0, 2];\n\nlet bytes_head: [u8; 2] = <[u8; 2]>::try_from(&bytes[0..2]).unwrap();\nassert_eq!(1, u16::from_le_bytes(bytes_head));\n\nlet bytes_tail: [u8; 2] = bytes[1..3].try_into().unwrap();\nassert_eq!(512, u16::from_le_bytes(bytes_tail));
\n§type Error = TryFromSliceError
The type returned in the event of a conversion error.","TryFrom<&[T]>","iroh_docs::sync::PeerIdBytes"],["1.59.0 · source§impl<T, const N: usize> TryFrom<&mut [T]> for [T; N]where\n T: Copy,
Tries to create an array [T; N] by copying from a mutable slice &mut [T].\nSucceeds if slice.len() == N.
\n\nlet mut bytes: [u8; 3] = [1, 0, 2];\n\nlet bytes_head: [u8; 2] = <[u8; 2]>::try_from(&mut bytes[0..2]).unwrap();\nassert_eq!(1, u16::from_le_bytes(bytes_head));\n\nlet bytes_tail: [u8; 2] = (&mut bytes[1..3]).try_into().unwrap();\nassert_eq!(512, u16::from_le_bytes(bytes_tail));
\n§type Error = TryFromSliceError
The type returned in the event of a conversion error.","TryFrom<&mut [T]>","iroh_docs::sync::PeerIdBytes"],["§impl<T, A, const N: usize> TryFrom<Vec<T, A>> for [T; N]where\n A: Allocator,
§fn try_from(vec: Vec<T, A>) -> Result<[T; N], Vec<T, A>>
Gets the entire contents of the Vec<T> as an array,\nif its size exactly matches that of the requested array.
\n§Examples
\nassert_eq!(vec![1, 2, 3].try_into(), Ok([1, 2, 3]));\nassert_eq!(<Vec<i32>>::new().try_into(), Ok([]));
\nIf the length doesn’t match, the input comes back in Err:
\n\nlet r: Result<[i32; 4], _> = (0..10).collect::<Vec<_>>().try_into();\nassert_eq!(r, Err(vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9]));
\nIf you’re fine with just getting a prefix of the Vec<T>,\nyou can call .truncate(N) first.
\n\nlet mut v = String::from(\"hello world\").into_bytes();\nv.sort();\nv.truncate(2);\nlet [a, b]: [_; 2] = v.try_into().unwrap();\nassert_eq!(a, b' ');\nassert_eq!(b, b'd');
\n","TryFrom>","iroh_docs::sync::PeerIdBytes"],["1.48.0 · source§impl<T, A, const N: usize> TryFrom<Vec<T, A>> for [T; N]where\n A: Allocator,
source§fn try_from(vec: Vec<T, A>) -> Result<[T; N], Vec<T, A>>
Gets the entire contents of the Vec<T> as an array,\nif its size exactly matches that of the requested array.
\n§Examples
\nassert_eq!(vec![1, 2, 3].try_into(), Ok([1, 2, 3]));\nassert_eq!(<Vec<i32>>::new().try_into(), Ok([]));
\nIf the length doesn’t match, the input comes back in Err:
\n\nlet r: Result<[i32; 4], _> = (0..10).collect::<Vec<_>>().try_into();\nassert_eq!(r, Err(vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9]));
\nIf you’re fine with just getting a prefix of the Vec<T>,\nyou can call .truncate(N) first.
\n\nlet mut v = String::from(\"hello world\").into_bytes();\nv.sort();\nv.truncate(2);\nlet [a, b]: [_; 2] = v.try_into().unwrap();\nassert_eq!(a, b' ');\nassert_eq!(b, b'd');
\n","TryFrom>","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, T, E, const N: usize> TryJoin for [Fut; N]where\n Fut: IntoFuture<Output = Result<T, E>>,
§type Future = TryJoin<<Fut as IntoFuture>::IntoFuture, T, E, N>
Which kind of future are we turning this into?","TryJoin","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> Value for [T; N]where\n T: Value,
§type SelfType<'a> = [<T as Value>::SelfType<'a>; N]\nwhere\n [T; N]: 'a
SelfType<’a> must be the same type as Self with all lifetimes replaced with ’a§type AsBytes<'a> = Vec<u8>\nwhere\n [T; N]: 'a
§fn fixed_width() -> Option<usize>
Width of a fixed type, or None for variable width§fn from_bytes<'a>(data: &'a [u8]) -> [<T as Value>::SelfType<'a>; N]where\n [T; N]: 'a,
Deserializes data\nImplementations may return a view over data, or an owned type","Value","iroh_docs::sync::PeerIdBytes"],["","ValueOrd","iroh_docs::sync::PeerIdBytes"],["§impl<Z, const N: usize> Zeroize for [Z; N]where\n Z: Zeroize,
Impl [Zeroize] on arrays of types that impl [Zeroize].
\n","Zeroize","iroh_docs::sync::PeerIdBytes"],["","Zip","iroh_docs::sync::PeerIdBytes"],["source§impl<T, const N: usize> ConstParamTy for [T; N]where\n T: ConstParamTy,
","ConstParamTy","iroh_docs::sync::PeerIdBytes"],["1.58.0 · source§impl<T, const N: usize> Copy for [T; N]where\n T: Copy,
","Copy","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Eq for [T; N]where\n T: Eq,
","Eq","iroh_docs::sync::PeerIdBytes"],["source§impl<T, const N: usize> StructuralPartialEq for [T; N]
","StructuralPartialEq","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> Unaligned for [T; N]where\n T: Unaligned,
","Unaligned","iroh_docs::sync::PeerIdBytes"],["§impl<Z, const N: usize> ZeroizeOnDrop for [Z; N]where\n Z: ZeroizeOnDrop,
Impl [ZeroizeOnDrop] on arrays of types that impl [ZeroizeOnDrop].
\n","ZeroizeOnDrop","iroh_docs::sync::PeerIdBytes"]]
};if (window.register_type_impls) {window.register_type_impls(type_impls);} else {window.pending_type_impls = type_impls;}})()
\ No newline at end of file
Expand description
Progress updates for the add operation.
Variants§
Found
An item was found with name name, from now on referred to via id
Fields
Abort(RpcError)
We got an error and need to abort.
This will be the last message in the stream.
Trait Implementations§
source§impl Debug for AddProgress
impl Debug for AddProgress
source§impl<'de> Deserialize<'de> for AddProgress
impl<'de> Deserialize<'de> for AddProgress
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
source§impl Serialize for AddProgress
impl Serialize for AddProgress
source§fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where
diff --git a/pr/2595/docs/iroh_blobs/store/enum.ConsistencyCheckProgress.html b/pr/2595/docs/iroh_blobs/store/enum.ConsistencyCheckProgress.html
index ad14d9476a..46469fe5e2 100644
--- a/pr/2595/docs/iroh_blobs/store/enum.ConsistencyCheckProgress.html
+++ b/pr/2595/docs/iroh_blobs/store/enum.ConsistencyCheckProgress.html
@@ -6,7 +6,7 @@
level: ReportLevel,
},
Done,
- Abort(RpcError),
+ Abort(RpcError),
}Expand description
Progress updates for the validate operation
Variants§
§level: ReportLevelThe level of the message
§Done
Consistency check ended
-§Abort(RpcError)
We got an error and need to abort.
+§Abort(RpcError)
We got an error and need to abort.
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where
diff --git a/pr/2595/docs/iroh_blobs/store/enum.ConsistencyCheckProgress.html b/pr/2595/docs/iroh_blobs/store/enum.ConsistencyCheckProgress.html
index ad14d9476a..46469fe5e2 100644
--- a/pr/2595/docs/iroh_blobs/store/enum.ConsistencyCheckProgress.html
+++ b/pr/2595/docs/iroh_blobs/store/enum.ConsistencyCheckProgress.html
@@ -6,7 +6,7 @@
level: ReportLevel,
},
Done,
- Abort(RpcError),
+ Abort(RpcError),
}Expand description
Progress updates for the validate operation
Variants§
§level: ReportLevelThe level of the message
§Done
Consistency check ended
-§Abort(RpcError)
We got an error and need to abort.
+§Abort(RpcError)
We got an error and need to abort.
Expand description
Progress updates for the validate operation
Variants§
level: ReportLevelThe level of the message
Done
Consistency check ended
-Abort(RpcError)
We got an error and need to abort.
+Abort(RpcError)
We got an error and need to abort.
Trait Implementations§
source§impl Debug for ConsistencyCheckProgress
impl Debug for ConsistencyCheckProgress
source§impl<'de> Deserialize<'de> for ConsistencyCheckProgress
impl<'de> Deserialize<'de> for ConsistencyCheckProgress
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for ConsistencyCheckProgress
impl RefUnwindSafe for ConsistencyCheckProgress
impl Send for ConsistencyCheckProgress
impl Sync for ConsistencyCheckProgress
impl Unpin for ConsistencyCheckProgress
impl UnwindSafe for ConsistencyCheckProgress
Blanket Implementations§
source§impl<T> Any for Twhere
diff --git a/pr/2595/docs/iroh_blobs/store/enum.ValidateProgress.html b/pr/2595/docs/iroh_blobs/store/enum.ValidateProgress.html
index 76a8f01e97..f4494f3a46 100644
--- a/pr/2595/docs/iroh_blobs/store/enum.ValidateProgress.html
+++ b/pr/2595/docs/iroh_blobs/store/enum.ValidateProgress.html
@@ -31,7 +31,7 @@
ranges: RangeSpec,
},
AllDone,
- Abort(RpcError),
+ Abort(RpcError),
}Expand description
Progress updates for the validate operation
Variants§
§Starting
started validating
Fields
§total: u64The total number of entries to validate
@@ -62,7 +62,7 @@ Otherwise it might be an url or something else to uniquely identify the entry.
§AllDone
We are done with the whole operation.
-§Abort(RpcError)
We got an error and need to abort.
+§Abort(RpcError)
We got an error and need to abort.
Trait Implementations§
source§impl Debug for ValidateProgress
source§impl<'de> Deserialize<'de> for ValidateProgress
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreAuto Trait Implementations§
§impl Freeze for ValidateProgress
§impl RefUnwindSafe for ValidateProgress
§impl Send for ValidateProgress
§impl Sync for ValidateProgress
§impl Unpin for ValidateProgress
§impl UnwindSafe for ValidateProgress
Blanket Implementations§
source§impl<T> Any for Twhere
diff --git a/pr/2595/docs/iroh_blobs/struct.Hash.html b/pr/2595/docs/iroh_blobs/struct.Hash.html
index 260e50d4b9..ba12d52876 100644
--- a/pr/2595/docs/iroh_blobs/struct.Hash.html
+++ b/pr/2595/docs/iroh_blobs/struct.Hash.html
@@ -1,36 +1,36 @@
-Hash in iroh_blobs - Rust Struct iroh_blobs::Hash
pub struct Hash(/* private fields */);
Expand description
Hash type used throughout.
-Implementations§
§impl Hash
pub const fn from_bytes(bytes: [u8; 32]) -> Hash
Create a Hash from its raw bytes representation.
-pub fn fmt_short(&self) -> String
Convert to a base32 string limited to the first 10 bytes for a friendly string
+
Hash in iroh_blobs - Rust Struct iroh_blobs::Hash
source · pub struct Hash(/* private fields */);
Expand description
Hash type used throughout.
+Implementations§
Trait Implementations§
Trait Implementations§
source§impl<'de> Deserialize<'de> for Hash
source§fn deserialize<D>(
deserializer: D
) -> Result<Hash, <D as Deserializer<'de>>::Error>where
- D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl FromIterator<Hash> for HashSeq
§impl Hash for Hash
§fn hash<__H>(&self, state: &mut __H)where
+ D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl FromIterator<Hash> for HashSeq
§impl MaxSize for Hash
§const POSTCARD_MAX_SIZE: usize = 32usize
The maximum possible size that the serialization of this
-type can have, in bytes.source§impl MaxSize for Hash
source§const POSTCARD_MAX_SIZE: usize = 32usize
The maximum possible size that the serialization of this
+type can have, in bytes.source§impl Ord for Hash
source§impl PartialEq for Hash
§impl PartialOrd for Hash
source§impl PartialOrd for Hash
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 <=
operator. Read moresource§impl Serialize for Hash
source§fn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
- S: Serializer,
Serialize this value into the given Serde serializer. Read more§impl Value for Hash
§type SelfType<'a> = Hash
SelfType<’a> must be the same type as Self with all lifetimes replaced with ’a§type AsBytes<'a> = &'a [u8; 32]
§fn fixed_width() -> Option<usize>
Width of a fixed type, or None for variable width§fn from_bytes<'a>(data: &'a [u8]) -> <Hash as Value>::SelfType<'a>where
+ S: Serializer,
Serialize this value into the given Serde serializer. Read moresource§impl Value for Hash
§type SelfType<'a> = Hash
SelfType<’a> must be the same type as Self with all lifetimes replaced with ’a§type AsBytes<'a> = &'a [u8; 32]
source§fn fixed_width() -> Option<usize>
Width of a fixed type, or None for variable width§impl Copy for Hash
§impl Eq for Hash
§impl StructuralPartialEq for Hash
Auto Trait Implementations§
§impl Freeze for Hash
§impl RefUnwindSafe for Hash
§impl Send for Hash
§impl Sync for Hash
§impl Unpin for Hash
§impl UnwindSafe for Hash
Blanket Implementations§
source§impl Copy for Hash
source§impl Eq for Hash
source§impl StructuralPartialEq for Hash
Auto Trait Implementations§
§impl Freeze for Hash
§impl RefUnwindSafe for Hash
§impl Send for Hash
§impl Sync for Hash
§impl Unpin for Hash
§impl UnwindSafe for Hash
Blanket Implementations§
§impl<A, T> AsBits<T> for A
§fn as_bits<O>(&self) -> &BitSlice<T, O>where
diff --git a/pr/2595/docs/iroh_blobs/struct.HashAndFormat.html b/pr/2595/docs/iroh_blobs/struct.HashAndFormat.html
index 8eb7ba64d5..421c7e1439 100644
--- a/pr/2595/docs/iroh_blobs/struct.HashAndFormat.html
+++ b/pr/2595/docs/iroh_blobs/struct.HashAndFormat.html
@@ -1,37 +1,37 @@
-HashAndFormat in iroh_blobs - Rust Struct iroh_blobs::HashAndFormat
pub struct HashAndFormat {
+HashAndFormat in iroh_blobs - Rust Struct iroh_blobs::HashAndFormat
source · pub struct HashAndFormat {
pub hash: Hash,
pub format: BlobFormat,
}
Expand description
A hash and format pair
Fields§
§hash: HashThe hash
§format: BlobFormatThe format
-Implementations§
§impl HashAndFormat
pub fn new(hash: Hash, format: BlobFormat) -> HashAndFormat
Create a new hash and format pair.
-pub fn raw(hash: Hash) -> HashAndFormat
Create a new hash and format pair, using the default (raw) format.
-pub fn hash_seq(hash: Hash) -> HashAndFormat
Create a new hash and format pair, using the collection format.
-Trait Implementations§
§impl Clone for HashAndFormat
§fn clone(&self) -> HashAndFormat
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more§impl Debug for HashAndFormat
§impl<'de> Deserialize<'de> for HashAndFormat
§fn deserialize<D>(
+
Implementations§
source§impl HashAndFormat
sourcepub fn new(hash: Hash, format: BlobFormat) -> HashAndFormat
Create a new hash and format pair.
+sourcepub fn raw(hash: Hash) -> HashAndFormat
Create a new hash and format pair, using the default (raw) format.
+sourcepub fn hash_seq(hash: Hash) -> HashAndFormat
Create a new hash and format pair, using the collection format.
+Trait Implementations§
source§impl Clone for HashAndFormat
source§fn clone(&self) -> HashAndFormat
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moresource§impl Debug for HashAndFormat
source§impl<'de> Deserialize<'de> for HashAndFormat
source§fn deserialize<D>(
deserializer: D
) -> Result<HashAndFormat, <D as Deserializer<'de>>::Error>where
- D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more§impl Display for HashAndFormat
source§impl From<DownloadKind> for HashAndFormat
source§fn from(value: DownloadKind) -> Self
Converts to this type from the input type.source§impl From<HashAndFormat> for DownloadKind
source§fn from(value: HashAndFormat) -> Self
Converts to this type from the input type.§impl FromStr for HashAndFormat
§impl Hash for HashAndFormat
§fn hash<__H>(&self, state: &mut __H)where
+ D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl Display for HashAndFormat
source§impl From<DownloadKind> for HashAndFormat
source§fn from(value: DownloadKind) -> Self
Converts to this type from the input type.source§impl From<HashAndFormat> for DownloadKind
source§fn from(value: HashAndFormat) -> Self
Converts to this type from the input type.source§impl FromStr for HashAndFormat
source§impl Hash for HashAndFormat
§impl MaxSize for HashAndFormat
§const POSTCARD_MAX_SIZE: usize = 33usize
The maximum possible size that the serialization of this
-type can have, in bytes.§impl Ord for HashAndFormat
source§impl MaxSize for HashAndFormat
source§const POSTCARD_MAX_SIZE: usize = 33usize
The maximum possible size that the serialization of this
+type can have, in bytes.source§impl Ord for HashAndFormat
source§fn cmp(&self, other: &HashAndFormat) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more§impl PartialEq for HashAndFormat
§fn eq(&self, other: &HashAndFormat) -> bool
Restrict a value to a certain interval. Read moresource§impl PartialEq for HashAndFormat
source§fn eq(&self, other: &HashAndFormat) -> bool
This method tests for self and other values to be equal, and is used
by ==.§impl PartialOrd for HashAndFormat
§fn partial_cmp(&self, other: &HashAndFormat) -> Option<Ordering>
source§impl PartialOrd for HashAndFormat
source§fn partial_cmp(&self, other: &HashAndFormat) -> Option<Ordering>
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 <=
operator. Read moresource§impl Serialize for HashAndFormat
source§fn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
- S: Serializer,
Serialize this value into the given Serde serializer. Read more§impl Value for HashAndFormat
§type SelfType<'a> = HashAndFormat
SelfType<’a> must be the same type as Self with all lifetimes replaced with ’a§type AsBytes<'a> = [u8; 33]
§fn fixed_width() -> Option<usize>
Width of a fixed type, or None for variable width§fn from_bytes<'a>(data: &'a [u8]) -> <HashAndFormat as Value>::SelfType<'a>where
+ S: Serializer,
Serialize this value into the given Serde serializer. Read moresource§impl Value for HashAndFormat
§type SelfType<'a> = HashAndFormat
SelfType<’a> must be the same type as Self with all lifetimes replaced with ’a§type AsBytes<'a> = [u8; 33]
source§fn fixed_width() -> Option<usize>
Width of a fixed type, or None for variable widthsource§fn from_bytes<'a>(data: &'a [u8]) -> <HashAndFormat as Value>::SelfType<'a>where
HashAndFormat: 'a,
Deserializes data
-Implementations may return a view over data, or an owned typesource§fn as_bytes<'a, 'b>(
value: &'a <HashAndFormat as Value>::SelfType<'b>
) -> <HashAndFormat as Value>::AsBytes<'a>where
'b: 'a,
- HashAndFormat: 'a + 'b,
Serialize the value to a slice§impl Copy for HashAndFormat
§impl Eq for HashAndFormat
§impl StructuralPartialEq for HashAndFormat
Auto Trait Implementations§
§impl Freeze for HashAndFormat
§impl RefUnwindSafe for HashAndFormat
§impl Send for HashAndFormat
§impl Sync for HashAndFormat
§impl Unpin for HashAndFormat
§impl UnwindSafe for HashAndFormat
Blanket Implementations§
source§impl<T> Any for Twhere
+ HashAndFormat: 'a + 'b,
Serialize the value to a slicesource§impl Copy for HashAndFormat
source§impl Eq for HashAndFormat
source§impl StructuralPartialEq for HashAndFormat
Auto Trait Implementations§
§impl Freeze for HashAndFormat
§impl RefUnwindSafe for HashAndFormat
§impl Send for HashAndFormat
§impl Sync for HashAndFormat
§impl Unpin for HashAndFormat
§impl UnwindSafe for HashAndFormat
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
diff --git a/pr/2595/docs/iroh_docs/actor/struct.SyncHandle.html b/pr/2595/docs/iroh_docs/actor/struct.SyncHandle.html
index cfd29c2ce8..6c70a0ff39 100644
--- a/pr/2595/docs/iroh_docs/actor/struct.SyncHandle.html
+++ b/pr/2595/docs/iroh_docs/actor/struct.SyncHandle.html
@@ -26,7 +26,7 @@ waiting for the actor to finish happens in an async context, and therefore that
namespace: NamespaceId,
author: AuthorId,
key: Bytes,
- hash: Hash,
+ hash: Hash,
len: u64
) -> Result<()>sourcepub async fn delete_prefix(
&self,
diff --git a/pr/2595/docs/iroh_docs/engine/enum.LiveEvent.html b/pr/2595/docs/iroh_docs/engine/enum.LiveEvent.html
index ceb8545b50..f0d33bcb21 100644
--- a/pr/2595/docs/iroh_docs/engine/enum.LiveEvent.html
+++ b/pr/2595/docs/iroh_docs/engine/enum.LiveEvent.html
@@ -3,34 +3,34 @@
entry: Entry,
},
InsertRemote {
- from: PublicKey,
+ from: PublicKey,
entry: Entry,
content_status: ContentStatus,
},
ContentReady {
- hash: Hash,
+ hash: Hash,
},
PendingContentReady,
- NeighborUp(PublicKey),
- NeighborDown(PublicKey),
+ NeighborUp(PublicKey),
+ NeighborDown(PublicKey),
SyncFinished(SyncEvent),
}Expand description
Events informing about actions of the live sync progress.
Variants§
§InsertLocal
A local insertion.
§InsertRemote
Received a remote insert.
-Fields
§from: PublicKeyThe peer that sent us the entry.
+Fields
§content_status: ContentStatusIf the content is available at the local node
§ContentReady
The content of an entry was downloaded and is now available at the local node
-Fields
§hash: HashThe content hash of the newly available entry content
+§PendingContentReady
All pending content is now ready.
This event signals that all queued content downloads from the last sync run have either
completed or failed.
It will only be emitted after a Self::SyncFinished event, never before.
Receiving this event does not guarantee that all content in the document is available. If
blobs failed to download, this event will still be emitted after all operations completed.
-§NeighborUp(PublicKey)
We have a new neighbor in the swarm.
-§NeighborDown(PublicKey)
We lost a neighbor in the swarm.
+§NeighborUp(PublicKey)
We have a new neighbor in the swarm.
+§NeighborDown(PublicKey)
We lost a neighbor in the swarm.
§SyncFinished(SyncEvent)
A set-reconciliation sync finished.
Trait Implementations§
source§impl<'de> Deserialize<'de> for LiveEvent
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl PartialEq for LiveEvent
source§fn eq(&self, other: &LiveEvent) -> bool
This method tests for self and other values to be equal, and is used
diff --git a/pr/2595/docs/iroh_docs/engine/fn.entry_to_content_status.html b/pr/2595/docs/iroh_docs/engine/fn.entry_to_content_status.html
index 459a6719d2..3b39df6428 100644
--- a/pr/2595/docs/iroh_docs/engine/fn.entry_to_content_status.html
+++ b/pr/2595/docs/iroh_docs/engine/fn.entry_to_content_status.html
@@ -1,2 +1,2 @@
-entry_to_content_status in iroh_docs::engine - Rust Function iroh_docs::engine::entry_to_content_status
source · pub fn entry_to_content_status(entry: Result<EntryStatus>) -> ContentStatus
Expand description
Converts an [EntryStatus] into a [‘ContentStatus’].
+entry_to_content_status in iroh_docs::engine - Rust Function iroh_docs::engine::entry_to_content_status
source · pub fn entry_to_content_status(entry: Result<EntryStatus>) -> ContentStatus
Expand description
Converts an EntryStatus into a [‘ContentStatus’].
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_docs/engine/index.html b/pr/2595/docs/iroh_docs/engine/index.html
index 5f78e23386..622ab4b871 100644
--- a/pr/2595/docs/iroh_docs/engine/index.html
+++ b/pr/2595/docs/iroh_docs/engine/index.html
@@ -1,4 +1,4 @@
iroh_docs::engine - Rust Expand description
Handlers and actors to for live syncing replicas.
crate::Replica is also called documents here.
Structs§
- Persistent default author for a docs engine.
- The sync engine coordinates actors that manage open documents, set-reconciliation syncs with
-peers and a gossip swarm for each syncing document.
- Event emitted when a sync operation completes
Enums§
- Where to persist the default author.
- Events informing about actions of the live sync progress.
- Why we performed a sync exchange
- Why we started a sync request
Functions§
- Converts an [
EntryStatus] into a [‘ContentStatus’].
\ No newline at end of file
+peers and a gossip swarm for each syncing document.Event emitted when a sync operation completes Enums§
- Where to persist the default author.
- Events informing about actions of the live sync progress.
- Why we performed a sync exchange
- Why we started a sync request
Functions§
- Converts an
EntryStatus into a [‘ContentStatus’].
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_docs/engine/struct.Engine.html b/pr/2595/docs/iroh_docs/engine/struct.Engine.html
index 1b88a96726..46cd25179e 100644
--- a/pr/2595/docs/iroh_docs/engine/struct.Engine.html
+++ b/pr/2595/docs/iroh_docs/engine/struct.Engine.html
@@ -8,12 +8,12 @@ peers and a gossip swarm for each syncing document.
Fields§
§endpoint: EndpointEndpoint used by the engine.
§sync: SyncHandleHandle to the actor thread.
The persistent default author for this engine.
-Implementations§
source§impl Engine
Implementations§
source§impl Engine
sourcepub async fn spawn<B: Store>(
endpoint: Endpoint,
- gossip: Gossip,
+ gossip: Gossip,
replica_store: Store,
bao_store: B,
- downloader: Downloader,
+ downloader: Downloader,
default_author_storage: DefaultAuthorStorage
) -> Result<Self>
Start the sync engine.
This will spawn two tokio tasks for the live sync coordination and gossip actors, and a
@@ -21,7 +21,7 @@ thread for the sourcepub async fn start_sync(
&self,
namespace: NamespaceId,
- peers: Vec<NodeAddr>
+ peers: Vec<NodeAddr>
) -> Result<()>
Start to sync a document.
If peers is non-empty, it will both do an initial set-reconciliation sync with each peer,
and join an iroh-gossip swarm with these peers to receive and broadcast document updates.
diff --git a/pr/2595/docs/iroh_docs/engine/struct.SyncEvent.html b/pr/2595/docs/iroh_docs/engine/struct.SyncEvent.html
index 49ba954022..d7eb730d81 100644
--- a/pr/2595/docs/iroh_docs/engine/struct.SyncEvent.html
+++ b/pr/2595/docs/iroh_docs/engine/struct.SyncEvent.html
@@ -1,11 +1,11 @@
SyncEvent in iroh_docs::engine - Rust pub struct SyncEvent {
- pub peer: PublicKey,
+ pub peer: PublicKey,
pub origin: Origin,
pub finished: SystemTime,
pub started: SystemTime,
pub result: Result<SyncDetails, String>,
}
Expand description
Event emitted when a sync operation completes
-Fields§
§peer: PublicKeyPeer we synced with
+Fields§
§peer: PublicKeyPeer we synced with
§origin: OriginOrigin of the sync exchange
§finished: SystemTimeTimestamp when the sync started
§started: SystemTimeTimestamp when the sync finished
diff --git a/pr/2595/docs/iroh_docs/index.html b/pr/2595/docs/iroh_docs/index.html
index a37d30e2a6..41c792c5e5 100644
--- a/pr/2595/docs/iroh_docs/index.html
+++ b/pr/2595/docs/iroh_docs/index.html
@@ -1,7 +1,7 @@
iroh_docs - Rust Expand description
Multi-dimensional key-value documents with an efficient synchronization protocol
The crate operates on Replicas. A replica contains an unlimited number of
Entries. Each entry is identified by a key, its author, and the replica’s
-namespace. Its value is the 32-byte BLAKE3 hash
+namespace. Its value is the 32-byte BLAKE3 hash
of the entry’s content data, the size of this content data, and a timestamp.
The content data itself is not stored or transferred through a replica.
All entries in a replica are signed with two keypairs:
diff --git a/pr/2595/docs/iroh_docs/net/enum.AcceptError.html b/pr/2595/docs/iroh_docs/net/enum.AcceptError.html
index 87e9a07ad3..cf11b5b695 100644
--- a/pr/2595/docs/iroh_docs/net/enum.AcceptError.html
+++ b/pr/2595/docs/iroh_docs/net/enum.AcceptError.html
@@ -3,31 +3,31 @@
error: Error,
},
Open {
- peer: PublicKey,
+ peer: PublicKey,
error: Error,
},
Abort {
- peer: PublicKey,
+ peer: PublicKey,
namespace: NamespaceId,
reason: AbortReason,
},
Sync {
- peer: PublicKey,
+ peer: PublicKey,
namespace: Option<NamespaceId>,
error: Error,
},
Close {
- peer: PublicKey,
+ peer: PublicKey,
namespace: Option<NamespaceId>,
error: Error,
},
}Expand description
Errors that may occur on handling incoming sync connections.
Variants§
§Connect
Failed to establish connection
§Open
Failed to open replica
-§Abort
We aborted the sync request.
-§Sync
Failed to run sync
-§Close
Failed to close
-Implementations§
source§impl AcceptError
Implementations§
Trait Implementations§
source§impl Debug for AcceptError
source§impl Display for AcceptError
source§impl Error for AcceptError
source§fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more1.0.0 · source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()Auto Trait Implementations§
§impl Freeze for AcceptError
§impl RefUnwindSafe for AcceptError
§impl Send for AcceptError
§impl Sync for AcceptError
§impl Unpin for AcceptError
§impl UnwindSafe for AcceptError
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
diff --git a/pr/2595/docs/iroh_docs/net/fn.connect_and_sync.html b/pr/2595/docs/iroh_docs/net/fn.connect_and_sync.html
index 1ee6909d53..7bec313309 100644
--- a/pr/2595/docs/iroh_docs/net/fn.connect_and_sync.html
+++ b/pr/2595/docs/iroh_docs/net/fn.connect_and_sync.html
@@ -2,6 +2,6 @@
endpoint: &Endpoint,
sync: &SyncHandle,
namespace: NamespaceId,
- peer: NodeAddr
+ peer: NodeAddr
) -> Result<SyncFinished, ConnectError>Expand description
Connect to a peer and sync a replica
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_docs/net/fn.handle_connection.html b/pr/2595/docs/iroh_docs/net/fn.handle_connection.html
index 347a0c22bf..e96816b362 100644
--- a/pr/2595/docs/iroh_docs/net/fn.handle_connection.html
+++ b/pr/2595/docs/iroh_docs/net/fn.handle_connection.html
@@ -3,6 +3,6 @@
connecting: Connecting,
accept_cb: F
) -> Result<SyncFinished, AcceptError>where
- F: Fn(NamespaceId, PublicKey) -> Fut,
+ F: Fn(NamespaceId, PublicKey) -> Fut,
Fut: Future<Output = AcceptOutcome>,Expand description
Handle an iroh-docs connection and sync all shared documents in the replica store.
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_docs/net/struct.SyncFinished.html b/pr/2595/docs/iroh_docs/net/struct.SyncFinished.html
index 74ab2f6632..dcd549e6fc 100644
--- a/pr/2595/docs/iroh_docs/net/struct.SyncFinished.html
+++ b/pr/2595/docs/iroh_docs/net/struct.SyncFinished.html
@@ -1,11 +1,11 @@
SyncFinished in iroh_docs::net - Rust Struct iroh_docs::net::SyncFinished
source · pub struct SyncFinished {
pub namespace: NamespaceId,
- pub peer: PublicKey,
+ pub peer: PublicKey,
pub outcome: SyncOutcome,
pub timings: Timings,
}
Expand description
Details of a finished sync operation.
Fields§
§namespace: NamespaceIdThe namespace that was synced.
-§peer: PublicKeyThe peer we syned with.
+§peer: PublicKeyThe peer we syned with.
§outcome: SyncOutcomeThe outcome of the sync operation
§timings: TimingsThe time this operation took
Trait Implementations§
source§impl Clone for SyncFinished
source§fn clone(&self) -> SyncFinished
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moreAuto Trait Implementations§
§impl Freeze for SyncFinished
§impl RefUnwindSafe for SyncFinished
§impl Send for SyncFinished
§impl Sync for SyncFinished
§impl Unpin for SyncFinished
§impl UnwindSafe for SyncFinished
Blanket Implementations§
source§impl<T> Any for Twhere
diff --git a/pr/2595/docs/iroh_docs/store/fs/struct.ContentHashesIterator.html b/pr/2595/docs/iroh_docs/store/fs/struct.ContentHashesIterator.html
index 8bebf68ec6..df1fc8865f 100644
--- a/pr/2595/docs/iroh_docs/store/fs/struct.ContentHashesIterator.html
+++ b/pr/2595/docs/iroh_docs/store/fs/struct.ContentHashesIterator.html
@@ -6,7 +6,7 @@ It needs a copy of a redb::ReadOnlyTable to be self-contained.
Implementations§
Trait Implementations§
source§impl Debug for ContentHashesIterator
Trait Implementations§
source§impl Debug for ContentHashesIterator
source§impl Iterator for ContentHashesIterator
source§fn next(&mut self) -> Option<Self::Item>
Advances the iterator and returns the next value. Read moresource§fn next_chunk<const N: usize>(
&mut self
) -> Result<[Self::Item; N], IntoIter<Self::Item, N>>where
Self: Sized,
🔬This is a nightly-only experimental API. (iter_next_chunk)Advances the iterator and returns an array containing the next N values. Read more1.0.0 · source§fn size_hint(&self) -> (usize, Option<usize>)
Returns the bounds on the remaining length of the iterator. Read more1.0.0 · source§fn count(self) -> usizewhere
diff --git a/pr/2595/docs/iroh_docs/struct.AuthorId.html b/pr/2595/docs/iroh_docs/struct.AuthorId.html
index 7dfa3dea5b..02221b0eb6 100644
--- a/pr/2595/docs/iroh_docs/struct.AuthorId.html
+++ b/pr/2595/docs/iroh_docs/struct.AuthorId.html
@@ -156,6 +156,6 @@ letters are used (e.g. F9B4CA)
Into<Dispatch>, source§fn with_current_subscriber(self) -> WithDispatch<Self>
source§impl<T> DeserializeOwned for Twhere
- T: for<'de> Deserialize<'de>,
§impl<T> PeerIdentity for Twhere
+ T: for<'de> Deserialize<'de>,
source§impl<T> PeerIdentity for T
source§impl<T> RuleType for T
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_docs/struct.AuthorPublicKey.html b/pr/2595/docs/iroh_docs/struct.AuthorPublicKey.html
index 8e72b11c8a..7a83ce68e4 100644
--- a/pr/2595/docs/iroh_docs/struct.AuthorPublicKey.html
+++ b/pr/2595/docs/iroh_docs/struct.AuthorPublicKey.html
@@ -148,6 +148,6 @@ builds. Into<Dispatch>,source§fn with_current_subscriber(self) -> WithDispatch<Self>
source§impl<T> DeserializeOwned for Twhere
- T: for<'de> Deserialize<'de>,
§impl<T> PeerIdentity for Twhere
+ T: for<'de> Deserialize<'de>,
source§impl<T> PeerIdentity for T
source§impl<T> RuleType for T
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_docs/struct.DocTicket.html b/pr/2595/docs/iroh_docs/struct.DocTicket.html
index d53a93c4c4..fd1bb5eb02 100644
--- a/pr/2595/docs/iroh_docs/struct.DocTicket.html
+++ b/pr/2595/docs/iroh_docs/struct.DocTicket.html
@@ -1,13 +1,13 @@
DocTicket in iroh_docs - Rust pub struct DocTicket {
pub capability: Capability,
- pub nodes: Vec<NodeAddr>,
+ pub nodes: Vec<NodeAddr>,
}
Expand description
Contains both a key (either secret or public) to a document, and a list of peers to join.
Fields§
§capability: Capabilityeither a public or private key
-§nodes: Vec<NodeAddr>A list of nodes to contact.
-Implementations§
source§impl DocTicket
sourcepub fn new(capability: Capability, peers: Vec<NodeAddr>) -> Self
Create a new doc ticket
+§nodes: Vec<NodeAddr>A list of nodes to contact.
+Implementations§
Trait Implementations§
source§impl<'de> Deserialize<'de> for DocTicket
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
- __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreAuto Trait Implementations§
§impl Freeze for DocTicket
§impl RefUnwindSafe for DocTicket
§impl Send for DocTicket
§impl Sync for DocTicket
§impl Unpin for DocTicket
§impl UnwindSafe for DocTicket
Blanket Implementations§
source§impl<T> Any for Twhere
+ __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreAuto Trait Implementations§
§impl Freeze for DocTicket
§impl RefUnwindSafe for DocTicket
§impl Send for DocTicket
§impl Sync for DocTicket
§impl Unpin for DocTicket
§impl UnwindSafe for DocTicket
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
diff --git a/pr/2595/docs/iroh_docs/struct.NamespaceId.html b/pr/2595/docs/iroh_docs/struct.NamespaceId.html
index 433d51afc6..f9acda8e94 100644
--- a/pr/2595/docs/iroh_docs/struct.NamespaceId.html
+++ b/pr/2595/docs/iroh_docs/struct.NamespaceId.html
@@ -156,6 +156,6 @@ letters are used (e.g. F9B4CA)
Into<Dispatch>, source§fn with_current_subscriber(self) -> WithDispatch<Self>
source§impl<T> DeserializeOwned for Twhere
- T: for<'de> Deserialize<'de>,
§impl<T> PeerIdentity for Twhere
+ T: for<'de> Deserialize<'de>,
source§impl<T> PeerIdentity for T
source§impl<T> RuleType for T
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_docs/struct.NamespacePublicKey.html b/pr/2595/docs/iroh_docs/struct.NamespacePublicKey.html
index 350dea9049..72b75ed510 100644
--- a/pr/2595/docs/iroh_docs/struct.NamespacePublicKey.html
+++ b/pr/2595/docs/iroh_docs/struct.NamespacePublicKey.html
@@ -147,6 +147,6 @@ builds.Into<Dispatch>,source§fn with_current_subscriber(self) -> WithDispatch<Self>
source§impl<T> DeserializeOwned for Twhere
- T: for<'de> Deserialize<'de>,
§impl<T> PeerIdentity for Twhere
+ T: for<'de> Deserialize<'de>,
source§impl<T> PeerIdentity for T
source§impl<T> RuleType for T
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_docs/sync/struct.Entry.html b/pr/2595/docs/iroh_docs/sync/struct.Entry.html
index 55bf06044f..055a4b6f54 100644
--- a/pr/2595/docs/iroh_docs/sync/struct.Entry.html
+++ b/pr/2595/docs/iroh_docs/sync/struct.Entry.html
@@ -1,6 +1,6 @@
Entry in iroh_docs::sync - Rust pub struct Entry { /* private fields */ }
Expand description
A single entry in a Replica
An entry is identified by a key, its Author, and the Replica’s
-NamespaceSecret. Its value is the 32-byte BLAKE3 hash
+NamespaceSecret. Its value is the 32-byte BLAKE3 hash
of the entry’s content data, the size of this content data, and a timestamp.
Implementations§
source§impl Entry
sourcepub fn new(id: RecordIdentifier, record: Record) -> Self
Create a new entry
sourcepub fn new_empty(id: RecordIdentifier) -> Self
Create a new empty entry with the current timestamp.
@@ -15,7 +15,7 @@ of the entry’s content data, the size of this content data, and a timestamp.
sourcepub fn sign(self, namespace: &NamespaceSecret, author: &Author) -> SignedEntry
Sign this entry with a NamespaceSecret and Author.
Methods from Deref<Target = Record>§
sourcepub fn content_len(&self) -> u64
Get the length of the data addressed by this record’s content hash.
-sourcepub fn content_hash(&self) -> Hash
Get the [struct@Hash] of the content data of this record.
+sourcepub fn content_hash(&self) -> Hash
Get the Hash of the content data of this record.
Trait Implementations§
source§impl<'de> Deserialize<'de> for Entry
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl From<SignedEntry> for Entry
source§fn from(value: SignedEntry) -> Self
Converts to this type from the input type.source§impl Ord for Entry
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
diff --git a/pr/2595/docs/iroh_docs/sync/struct.Record.html b/pr/2595/docs/iroh_docs/sync/struct.Record.html
index 94479a973e..f06cccab52 100644
--- a/pr/2595/docs/iroh_docs/sync/struct.Record.html
+++ b/pr/2595/docs/iroh_docs/sync/struct.Record.html
@@ -1,11 +1,11 @@
Record in iroh_docs::sync - Rust pub struct Record { /* private fields */ }
Expand description
The data part of an entry in a Replica.
-Implementations§
source§impl Record
Implementations§
source§impl Record
sourcepub fn empty_current() -> Self
Create a tombstone record with the timestamp set to now.
sourcepub fn new_current(hash: Hash, len: u64) -> Self
Create a new Record with the timestamp set to now.
+sourcepub fn new_current(hash: Hash, len: u64) -> Self
Create a new Record with the timestamp set to now.
sourcepub fn content_len(&self) -> u64
Get the length of the data addressed by this record’s content hash.
-sourcepub fn content_hash(&self) -> Hash
Get the [struct@Hash] of the content data of this record.
+sourcepub fn content_hash(&self) -> Hash
Get the Hash of the content data of this record.
Trait Implementations§
source§impl<'de> Deserialize<'de> for Record
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl Ord for Record
Ordering for entry values.
diff --git a/pr/2595/docs/iroh_docs/sync/struct.Replica.html b/pr/2595/docs/iroh_docs/sync/struct.Replica.html
index 23a9798651..c4e161f3c3 100644
--- a/pr/2595/docs/iroh_docs/sync/struct.Replica.html
+++ b/pr/2595/docs/iroh_docs/sync/struct.Replica.html
@@ -5,7 +5,7 @@
&mut self,
key: impl AsRef<[u8]>,
author: &Author,
- hash: Hash,
+ hash: Hash,
len: u64
) -> Result<usize, InsertError>Insert a new record at the given key.
The entry will by signed by the provided author.
@@ -35,7 +35,7 @@ or an error if the entry failed to validate or if a store operation failed.
key: impl AsRef<[u8]>,
author: &Author,
data: impl AsRef<[u8]>
-) -> Result<Hash, InsertError>Hashes the given data and inserts it.
+) -> Result<Hash, InsertError>Hashes the given data and inserts it.
This does not store the content, just the record of it.
Returns the calculated hash.
sourcepub fn record_id(
diff --git a/pr/2595/docs/iroh_docs/sync/struct.SignedEntry.html b/pr/2595/docs/iroh_docs/sync/struct.SignedEntry.html
index 21644eacb1..9ef5e98134 100644
--- a/pr/2595/docs/iroh_docs/sync/struct.SignedEntry.html
+++ b/pr/2595/docs/iroh_docs/sync/struct.SignedEntry.html
@@ -14,7 +14,7 @@
sourcepub fn signature(&self) -> &EntrySignature
Get the signature.
sourcepub fn validate_empty(&self) -> Result<(), ValidationFailure>
Validate that the entry has the empty hash if the length is 0, or a non-zero length.
sourcepub fn content_hash(&self) -> Hash
Get the content [struct@Hash] of the entry.
+sourcepub fn content_hash(&self) -> Hash
Get the content Hash of the entry.
sourcepub fn content_len(&self) -> u64
Get the content length of the entry.
Get the author bytes of this entry.
Methods from Deref<Target = Record>§
sourcepub fn content_len(&self) -> u64
Get the length of the data addressed by this record’s content hash.
-sourcepub fn content_hash(&self) -> Hash
Get the [struct@Hash] of the content data of this record.
+sourcepub fn content_hash(&self) -> Hash
Get the Hash of the content data of this record.
Trait Implementations§
source§impl Clone for SignedEntry
source§fn clone(&self) -> SignedEntry
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moresource§impl Debug for SignedEntry
source§impl Deref for SignedEntry
source§impl<'de> Deserialize<'de> for SignedEntry
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl From<SignedEntry> for Entry
source§fn from(value: SignedEntry) -> Self
Converts to this type from the input type.source§impl Ord for SignedEntry
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
diff --git a/pr/2595/docs/iroh_docs/sync/type.ContentStatusCallback.html b/pr/2595/docs/iroh_docs/sync/type.ContentStatusCallback.html
index 46d5a5a49c..84ffdbe8ee 100644
--- a/pr/2595/docs/iroh_docs/sync/type.ContentStatusCallback.html
+++ b/pr/2595/docs/iroh_docs/sync/type.ContentStatusCallback.html
@@ -1,2 +1,2 @@
-ContentStatusCallback in iroh_docs::sync - Rust Type Alias iroh_docs::sync::ContentStatusCallback
source · pub type ContentStatusCallback = Arc<dyn Fn(Hash) -> ContentStatus + Send + Sync + 'static>;
Expand description
Callback that may be set on a replica to determine the availability status for a content hash.
+ContentStatusCallback in iroh_docs::sync - Rust Type Alias iroh_docs::sync::ContentStatusCallback
source · pub type ContentStatusCallback = Arc<dyn Fn(Hash) -> ContentStatus + Send + Sync + 'static>;
Expand description
Callback that may be set on a replica to determine the availability status for a content hash.
Aliased Type§
struct ContentStatusCallback { /* private fields */ }
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_net/discovery/dns/index.html b/pr/2595/docs/iroh_net/discovery/dns/index.html
index 5a80538422..a752b49d78 100644
--- a/pr/2595/docs/iroh_net/discovery/dns/index.html
+++ b/pr/2595/docs/iroh_net/discovery/dns/index.html
@@ -1,2 +1,2 @@
-iroh_net::discovery::dns - Rust Expand description
DNS node discovery for iroh-net
+iroh_net::discovery::dns - Rust Expand description
DNS node discovery for iroh-net
Structs§
- DNS node discovery
Constants§
- The n0 testing DNS node origin, for production.
- The n0 testing DNS node origin, for testing.
- Testing DNS node origin, must run server from
crate::test_utils::DnsPkarrServer.
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_net/discovery/dns/struct.DnsDiscovery.html b/pr/2595/docs/iroh_net/discovery/dns/struct.DnsDiscovery.html
index 3e7d5d71cc..7628fb45a9 100644
--- a/pr/2595/docs/iroh_net/discovery/dns/struct.DnsDiscovery.html
+++ b/pr/2595/docs/iroh_net/discovery/dns/struct.DnsDiscovery.html
@@ -28,7 +28,7 @@ custom discovery mechanism.
For testing it is also possible to use the N0_DNS_NODE_ORIGIN_STAGING domain
with DnsDiscovery::new. This would then use a hosted discovery service again,
but for testing purposes.
-Trait Implementations§
Trait Implementations§
source§impl Debug for DnsDiscovery
source§impl Discovery for DnsDiscovery
source§fn resolve(
&self,
ep: Endpoint,
node_id: NodeId
diff --git a/pr/2595/docs/iroh_net/discovery/trait.Discovery.html b/pr/2595/docs/iroh_net/discovery/trait.Discovery.html
index a53a618708..d3832a56b5 100644
--- a/pr/2595/docs/iroh_net/discovery/trait.Discovery.html
+++ b/pr/2595/docs/iroh_net/discovery/trait.Discovery.html
@@ -29,4 +29,4 @@ These tasks will be run on the runtime of the Option<BoxStream<Result<DiscoveryItem>>>
Implementors§
source§impl Discovery for DnsDiscovery
source§impl Discovery for LocalSwarmDiscovery
source§impl Discovery for PkarrPublisher
source§impl Discovery for PkarrResolver
source§impl Discovery for ConcurrentDiscovery
\ No newline at end of file
+
Implementors§
source§impl Discovery for DnsDiscovery
source§impl Discovery for LocalSwarmDiscovery
source§impl Discovery for PkarrPublisher
source§impl Discovery for PkarrResolver
source§impl Discovery for ConcurrentDiscovery
\ No newline at end of file
diff --git a/pr/2595/docs/src/iroh_net/discovery/dns.rs.html b/pr/2595/docs/src/iroh_net/discovery/dns.rs.html
index dd1a279fb3..1d32545ed3 100644
--- a/pr/2595/docs/src/iroh_net/discovery/dns.rs.html
+++ b/pr/2595/docs/src/iroh_net/discovery/dns.rs.html
@@ -97,6 +97,10 @@
97
98
99
+100
+101
+102
+103
//! DNS node discovery for iroh-net
use anyhow::Result;
@@ -182,6 +186,10 @@
fn resolve(&self, ep: Endpoint, node_id: NodeId) -> Option<BoxStream<Result<DiscoveryItem>>> {
let resolver = ep.dns_resolver().clone();
let origin_domain = self.origin_domain.clone();
+ #[cfg(any(test, feature = "test-utils"))]
+ if origin_domain.contains(&TEST_DNS_NODE_ORIGIN.to_string()) {
+ panic!("wait. THIS IS ILLEGAL!");
+ }
let fut = async move {
let node_addr = resolver
.lookup_by_id_staggered(&node_id, &origin_domain, DNS_STAGGERING_MS)
diff --git a/pr/2595/docs/trait.impl/iroh_base/ticket/trait.Ticket.js b/pr/2595/docs/trait.impl/iroh_base/ticket/trait.Ticket.js
index 12fa1e3ee5..5d209fabd2 100644
--- a/pr/2595/docs/trait.impl/iroh_base/ticket/trait.Ticket.js
+++ b/pr/2595/docs/trait.impl/iroh_base/ticket/trait.Ticket.js
@@ -1,5 +1,5 @@
(function() {var implementors = {
"iroh":[],
"iroh_base":[],
-"iroh_docs":[["impl Ticket for DocTicket"]]
+"iroh_docs":[["impl Ticket for DocTicket"]]
};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
diff --git a/pr/2595/docs/type.impl/std/primitive.array.js b/pr/2595/docs/type.impl/std/primitive.array.js
index 588a8b53a3..3006964922 100644
--- a/pr/2595/docs/type.impl/std/primitive.array.js
+++ b/pr/2595/docs/type.impl/std/primitive.array.js
@@ -1,4 +1,4 @@
(function() {var type_impls = {
"iroh":[["source§impl<T, const N: usize> [T; N]
1.55.0 · sourcepub fn map<F, U>(self, f: F) -> [U; N]where\n F: FnMut(T) -> U,
Returns an array of the same size as self, with function f applied to each element\nin order.
\nIf you don’t necessarily need a new fixed-size array, consider using\nIterator::map instead.
\n§Note on performance and stack usage
\nUnfortunately, usages of this method are currently not always optimized\nas well as they could be. This mainly concerns large arrays, as mapping\nover small arrays seem to be optimized just fine. Also note that in\ndebug mode (i.e. without any optimizations), this method can use a lot\nof stack space (a few times the size of the array or more).
\nTherefore, in performance-critical code, try to avoid using this method\non large arrays or check the emitted code. Also try to avoid chained\nmaps (e.g. arr.map(...).map(...)).
\nIn many cases, you can instead use Iterator::map by calling .iter()\nor .into_iter() on your array. [T; N]::map is only necessary if you\nreally need a new array of the same size as the result. Rust’s lazy\niterators tend to get optimized very well.
\n§Examples
\nlet x = [1, 2, 3];\nlet y = x.map(|v| v + 1);\nassert_eq!(y, [2, 3, 4]);\n\nlet x = [1, 2, 3];\nlet mut temp = 0;\nlet y = x.map(|v| { temp += 1; v * temp });\nassert_eq!(y, [1, 4, 9]);\n\nlet x = [\"Ferris\", \"Bueller's\", \"Day\", \"Off\"];\nlet y = x.map(|v| v.len());\nassert_eq!(y, [6, 9, 3, 3]);
\nsourcepub fn try_map<F, R>(\n self,\n f: F\n) -> <<R as Try>::Residual as Residual<[<R as Try>::Output; N]>>::TryType
🔬This is a nightly-only experimental API. (array_try_map)
A fallible function f applied to each element on array self in order to\nreturn an array the same size as self or the first error encountered.
\nThe return type of this function depends on the return type of the closure.\nIf you return Result<T, E> from the closure, you’ll get a Result<[T; N], E>.\nIf you return Option<T> from the closure, you’ll get an Option<[T; N]>.
\n§Examples
\n#![feature(array_try_map)]\n\nlet a = [\"1\", \"2\", \"3\"];\nlet b = a.try_map(|v| v.parse::<u32>()).unwrap().map(|v| v + 1);\nassert_eq!(b, [2, 3, 4]);\n\nlet a = [\"1\", \"2a\", \"3\"];\nlet b = a.try_map(|v| v.parse::<u32>());\nassert!(b.is_err());\n\nuse std::num::NonZero;\n\nlet z = [1, 2, 0, 3, 4];\nassert_eq!(z.try_map(NonZero::new), None);\n\nlet a = [1, 2, 3];\nlet b = a.try_map(NonZero::new);\nlet c = b.map(|x| x.map(NonZero::get));\nassert_eq!(c, Some(a));
\n1.57.0 (const: 1.57.0) · sourcepub const fn as_slice(&self) -> &[T]
Returns a slice containing the entire array. Equivalent to &s[..].
\n1.57.0 · sourcepub fn as_mut_slice(&mut self) -> &mut [T]
Returns a mutable slice containing the entire array. Equivalent to\n&mut s[..].
\n1.77.0 · sourcepub fn each_ref(&self) -> [&T; N]
Borrows each element and returns an array of references with the same\nsize as self.
\n§Example
\nlet floats = [3.1, 2.7, -1.0];\nlet float_refs: [&f64; 3] = floats.each_ref();\nassert_eq!(float_refs, [&3.1, &2.7, &-1.0]);
\nThis method is particularly useful if combined with other methods, like\nmap. This way, you can avoid moving the original\narray if its elements are not Copy.
\n\nlet strings = [\"Ferris\".to_string(), \"♥\".to_string(), \"Rust\".to_string()];\nlet is_ascii = strings.each_ref().map(|s| s.is_ascii());\nassert_eq!(is_ascii, [true, false, true]);\n\n// We can still access the original array: it has not been moved.\nassert_eq!(strings.len(), 3);
\n1.77.0 · sourcepub fn each_mut(&mut self) -> [&mut T; N]
Borrows each element mutably and returns an array of mutable references\nwith the same size as self.
\n§Example
\n\nlet mut floats = [3.1, 2.7, -1.0];\nlet float_refs: [&mut f64; 3] = floats.each_mut();\n*float_refs[0] = 0.0;\nassert_eq!(float_refs, [&mut 0.0, &mut 2.7, &mut -1.0]);\nassert_eq!(floats, [0.0, 2.7, -1.0]);
\nsourcepub fn split_array_ref<const M: usize>(&self) -> (&[T; M], &[T])
🔬This is a nightly-only experimental API. (split_array)
Divides one array reference into two at an index.
\nThe first will contain all indices from [0, M) (excluding\nthe index M itself) and the second will contain all\nindices from [M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet v = [1, 2, 3, 4, 5, 6];\n\n{\n let (left, right) = v.split_array_ref::<0>();\n assert_eq!(left, &[]);\n assert_eq!(right, &[1, 2, 3, 4, 5, 6]);\n}\n\n{\n let (left, right) = v.split_array_ref::<2>();\n assert_eq!(left, &[1, 2]);\n assert_eq!(right, &[3, 4, 5, 6]);\n}\n\n{\n let (left, right) = v.split_array_ref::<6>();\n assert_eq!(left, &[1, 2, 3, 4, 5, 6]);\n assert_eq!(right, &[]);\n}
\nsourcepub fn split_array_mut<const M: usize>(&mut self) -> (&mut [T; M], &mut [T])
🔬This is a nightly-only experimental API. (split_array)
Divides one mutable array reference into two at an index.
\nThe first will contain all indices from [0, M) (excluding\nthe index M itself) and the second will contain all\nindices from [M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet mut v = [1, 0, 3, 0, 5, 6];\nlet (left, right) = v.split_array_mut::<2>();\nassert_eq!(left, &mut [1, 0][..]);\nassert_eq!(right, &mut [3, 0, 5, 6]);\nleft[1] = 2;\nright[1] = 4;\nassert_eq!(v, [1, 2, 3, 4, 5, 6]);
\nsourcepub fn rsplit_array_ref<const M: usize>(&self) -> (&[T], &[T; M])
🔬This is a nightly-only experimental API. (split_array)
Divides one array reference into two at an index from the end.
\nThe first will contain all indices from [0, N - M) (excluding\nthe index N - M itself) and the second will contain all\nindices from [N - M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet v = [1, 2, 3, 4, 5, 6];\n\n{\n let (left, right) = v.rsplit_array_ref::<0>();\n assert_eq!(left, &[1, 2, 3, 4, 5, 6]);\n assert_eq!(right, &[]);\n}\n\n{\n let (left, right) = v.rsplit_array_ref::<2>();\n assert_eq!(left, &[1, 2, 3, 4]);\n assert_eq!(right, &[5, 6]);\n}\n\n{\n let (left, right) = v.rsplit_array_ref::<6>();\n assert_eq!(left, &[]);\n assert_eq!(right, &[1, 2, 3, 4, 5, 6]);\n}
\nsourcepub fn rsplit_array_mut<const M: usize>(&mut self) -> (&mut [T], &mut [T; M])
🔬This is a nightly-only experimental API. (split_array)
Divides one mutable array reference into two at an index from the end.
\nThe first will contain all indices from [0, N - M) (excluding\nthe index N - M itself) and the second will contain all\nindices from [N - M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet mut v = [1, 0, 3, 0, 5, 6];\nlet (left, right) = v.rsplit_array_mut::<4>();\nassert_eq!(left, &mut [1, 0]);\nassert_eq!(right, &mut [3, 0, 5, 6][..]);\nleft[1] = 2;\nright[1] = 4;\nassert_eq!(v, [1, 2, 3, 4, 5, 6]);
\n",0,"iroh::docs::PeerIdBytes"],["source§impl<const N: usize> [u8; N]
sourcepub const fn as_ascii(&self) -> Option<&[AsciiChar; N]>
🔬This is a nightly-only experimental API. (ascii_char)
Converts this array of bytes into a array of ASCII characters,\nor returns None if any of the characters is non-ASCII.
\n§Examples
\n#![feature(ascii_char)]\n#![feature(const_option)]\n\nconst HEX_DIGITS: [std::ascii::Char; 16] =\n *b\"0123456789abcdef\".as_ascii().unwrap();\n\nassert_eq!(HEX_DIGITS[1].as_str(), \"1\");\nassert_eq!(HEX_DIGITS[10].as_str(), \"a\");
\nsourcepub const unsafe fn as_ascii_unchecked(&self) -> &[AsciiChar; N]
🔬This is a nightly-only experimental API. (ascii_char)
Converts this array of bytes into a array of ASCII characters,\nwithout checking whether they’re valid.
\n§Safety
\nEvery byte in the array must be in 0..=127, or else this is UB.
\n",0,"iroh::docs::PeerIdBytes"],["§impl<T> Array for [T; 32]where\n T: Default,
§fn as_slice_mut(&mut self) -> &mut [T]
Gives a unique slice over the whole thing. Read more","Array","iroh::docs::PeerIdBytes"],["","Array","iroh::docs::PeerIdBytes"],["§impl<const N: usize, T> AsBytes for [T; N]where\n T: AsBytes,
§fn write_to_prefix(&self, bytes: &mut [u8]) -> Option<()>
","AsBytes","iroh::docs::PeerIdBytes"],["","AsBytes","iroh::docs::PeerIdBytes"],["","AsMut<[T]>","iroh::docs::PeerIdBytes"],["","AsRef<[T]>","iroh::docs::PeerIdBytes"],["§impl<T, const N: usize> BitView for [T; N]where\n T: BitStore,
Note that overly-large arrays may cause the conversions to fail.
\n§fn view_bits<O>(&self) -> &BitSlice<T, O>where\n O: BitOrder,
Views a memory region as an immutable bit-slice.§fn try_view_bits<O>(&self) -> Result<&BitSlice<T, O>, BitSpanError<T>>where\n O: BitOrder,
Attempts to view a memory region as an immutable bit-slice. Read more§fn view_bits_mut<O>(&mut self) -> &mut BitSlice<T, O>where\n O: BitOrder,
Views a memory region as a mutable bit-slice.§fn try_view_bits_mut<O>(\n &mut self\n) -> Result<&mut BitSlice<T, O>, BitSpanError<T>>where\n O: BitOrder,
Attempts to view a memory region as a mutable bit-slice. Read more","BitView","iroh::docs::PeerIdBytes"],["§impl<T, const N: usize> BitViewSized for [T; N]where\n T: BitStore,
§fn as_raw_slice(&self) -> &[<[T; N] as BitView>::Store]
Views the type as a slice of its elements.§fn as_raw_mut_slice(&mut self) -> &mut [<[T; N] as BitView>::Store]
Views the type as a mutable slice of its elements.§fn into_bitarray<O>(self) -> BitArray<Self, O>where\n O: BitOrder,
Wraps self in a BitArray.","BitViewSized","iroh::docs::PeerIdBytes"],["","Borrow<[T]>","iroh::docs::PeerIdBytes"],["1.4.0 · source§impl<T, const N: usize> BorrowMut<[T]> for [T; N]
source§fn borrow_mut(&mut self) -> &mut [T]
Mutably borrows from an owned value. Read more","BorrowMut<[T]>","iroh::docs::PeerIdBytes"],["","Chain","iroh::docs::PeerIdBytes"],["","Clone","iroh::docs::PeerIdBytes"],["","Debug","iroh::docs::PeerIdBytes"],["§impl<const N: usize> Decode for [u8; N]
Decodes a byte array from byte[n] as described in RFC4251 § 5:
\n\nA byte represents an arbitrary 8-bit value (octet). Fixed length\ndata is sometimes represented as an array of bytes, written\nbyte[n], where n is the number of bytes in the array.
\n
\n","Decode","iroh::docs::PeerIdBytes"],["§impl<'a, T, const N: usize> DecodeValue<'a> for [T; N]where\n T: Decode<'a>,
§fn decode_value<R>(reader: &mut R, header: Header) -> Result<[T; N], Error>where\n R: Reader<'a>,
Attempt to decode this message using the provided [Reader].","DecodeValue<'a>","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["source§impl<'de, T> Deserialize<'de> for [T; 32]where\n T: Deserialize<'de>,
source§fn deserialize<D>(\n deserializer: D\n) -> Result<[T; 32], <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more","Deserialize<'de>","iroh::docs::PeerIdBytes"],["source§impl<'de, const N: usize> Deserialize<'de> for [u8; N]
source§fn deserialize<D>(\n deserializer: D\n) -> Result<[u8; N], <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
","Deserialize<'de>","iroh::docs::PeerIdBytes"],["§impl<const N: usize> Encode for [u8; N]
Encodes [u8; N] into byte[n] as described in RFC4251 § 5:
\n\nA byte represents an arbitrary 8-bit value (octet). Fixed length\ndata is sometimes represented as an array of bytes, written\nbyte[n], where n is the number of bytes in the array.
\n
\n§fn encoded_len(&self) -> Result<usize, Error>
Get the length of this type encoded in bytes, prior to Base64 encoding.§fn encode(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value using the provided [Writer].§fn encoded_len_prefixed(&self) -> Result<usize, Error>
Return the length of this type after encoding when prepended with a\nuint32 length prefix.§fn encode_prefixed(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value, first prepending a uint32 length prefix\nset to [Encode::encoded_len].","Encode","iroh::docs::PeerIdBytes"],["","EncodeLabelSet","iroh::docs::PeerIdBytes"],["§impl<T, const N: usize> EncodeValue for [T; N]where\n T: Encode,
","EncodeValue","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["§impl<'a> FindToken<&'a u8> for [u8; 32]
§fn find_token(&self, token: &u8) -> bool
Returns true if self contains the token","FindToken<&'a u8>","iroh::docs::PeerIdBytes"],["§impl FindToken<u8> for [u8; 32]
§fn find_token(&self, token: u8) -> bool
Returns true if self contains the token","FindToken","iroh::docs::PeerIdBytes"],["","FixedTag","iroh::docs::PeerIdBytes"],["","From<&Signature>","iroh::docs::PeerIdBytes"],["","From","iroh::docs::PeerIdBytes"],["§impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>>> for [T; 32]
","From, B0>, B0>, B0>, B0>, B0>>>","iroh::docs::PeerIdBytes"],["","From","iroh::docs::PeerIdBytes"],["","From","iroh::docs::PeerIdBytes"],["","From>","iroh::docs::PeerIdBytes"],["","From","iroh::docs::PeerIdBytes"],["","From","iroh::docs::PeerIdBytes"],["","From","iroh::docs::PeerIdBytes"],["","From>","iroh::docs::PeerIdBytes"],["§impl<const N: usize, T> FromBytes for [T; N]where\n T: FromBytes,
§fn slice_from_prefix(bytes: &[u8], count: usize) -> Option<(&[Self], &[u8])>where\n Self: Sized,
Interprets the prefix of the given bytes as a &[Self] with length\nequal to count without copying. Read more§fn slice_from_suffix(bytes: &[u8], count: usize) -> Option<(&[u8], &[Self])>where\n Self: Sized,
Interprets the suffix of the given bytes as a &[Self] with length\nequal to count without copying. Read more§fn read_from_prefix(bytes: &[u8]) -> Option<Self>where\n Self: Sized,
","FromBytes","iroh::docs::PeerIdBytes"],["","FromHex","iroh::docs::PeerIdBytes"],["","FromZeroes","iroh::docs::PeerIdBytes"],["","Hash","iroh::docs::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Hash for [T; N]where\n T: Hash,
The hash of an array is the same as that of the corresponding slice,\nas required by the Borrow implementation.
\n\nuse std::hash::BuildHasher;\n\nlet b = std::hash::RandomState::new();\nlet a: [u8; 3] = [0xa8, 0x3c, 0x09];\nlet s: &[u8] = &[0xa8, 0x3c, 0x09];\nassert_eq!(b.hash_one(a), b.hash_one(s));
\n","Hash","iroh::docs::PeerIdBytes"],["","Index","iroh::docs::PeerIdBytes"],["","IndexMut","iroh::docs::PeerIdBytes"],["","InputLength","iroh::docs::PeerIdBytes"],["1.53.0 · source§impl<T, const N: usize> IntoIterator for [T; N]
source§fn into_iter(self) -> <[T; N] as IntoIterator>::IntoIter
Creates a consuming iterator, that is, one that moves each value out of\nthe array (from start to end). The array cannot be used after calling\nthis unless T implements Copy, so the whole array is copied.
\nArrays have special behavior when calling .into_iter() prior to the\n2021 edition – see the array Editions section for more information.
\n","IntoIterator","iroh::docs::PeerIdBytes"],["§impl<const N: usize> IntoResponse for [u8; N]
§fn into_response(self) -> Response<Body>
Create a response.","IntoResponse","iroh::docs::PeerIdBytes"],["§impl<Fut, const N: usize> Join for [Fut; N]where\n Fut: IntoFuture,
§type Output = [<Fut as IntoFuture>::Output; N]
The resulting output type.§type Future = Join<<Fut as IntoFuture>::IntoFuture, N>
The Future implementation returned by this method.","Join","iroh::docs::PeerIdBytes"],["","Key","iroh::docs::PeerIdBytes"],["§impl<T, const N: usize> MaxSize for [T; N]where\n T: MaxSize,
§const POSTCARD_MAX_SIZE: usize = _
The maximum possible size that the serialization of this\ntype can have, in bytes.","MaxSize","iroh::docs::PeerIdBytes"],["","Merge","iroh::docs::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Ord for [T; N]where\n T: Ord,
Implements comparison of arrays lexicographically.
\n1.21.0 · source§fn max(self, other: Self) -> Selfwhere\n Self: Sized,
Compares and returns the maximum of two values. Read more","Ord","iroh::docs::PeerIdBytes"],["","PartialEq<&[U]>","iroh::docs::PeerIdBytes"],["1.0.0 · source§impl<T, U, const N: usize> PartialEq<&mut [U]> for [T; N]where\n T: PartialEq<U>,
","PartialEq<&mut [U]>","iroh::docs::PeerIdBytes"],["","PartialEq<[U]>","iroh::docs::PeerIdBytes"],["","PartialEq<[U; N]>","iroh::docs::PeerIdBytes"],["","PartialEq","iroh::docs::PeerIdBytes"],["§impl<A, B, const N: usize, const M: usize> PartialEq<Vec<A, N>> for [B; M]where\n A: PartialEq<B>,
","PartialEq>","iroh::docs::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> PartialOrd for [T; N]where\n T: PartialOrd,
Implements comparison of arrays lexicographically.
\nsource§fn le(&self, other: &[T; N]) -> bool
This method tests less than or equal to (for self and other) and is used by the <=\noperator. Read more","PartialOrd","iroh::docs::PeerIdBytes"],["§impl<Fut, const N: usize> Race for [Fut; N]where\n Fut: IntoFuture,
§type Output = <Fut as IntoFuture>::Output
The resulting output type.§type Future = Race<<Fut as IntoFuture>::IntoFuture, N>
Which kind of future are we turning this into?","Race","iroh::docs::PeerIdBytes"],["§impl<Fut, T, E, const N: usize> RaceOk for [Fut; N]where\n Fut: IntoFuture<Output = Result<T, E>>,
§type Future = RaceOk<<Fut as IntoFuture>::IntoFuture, T, E, N>
Which kind of future are we turning this into?","RaceOk","iroh::docs::PeerIdBytes"],["","Schema","iroh::docs::PeerIdBytes"],["source§impl<T> Serialize for [T; 32]where\n T: 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","iroh::docs::PeerIdBytes"],["source§impl<const N: usize> Serialize for [u8; N]
source§fn serialize<S>(\n &self,\n serializer: S\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where\n S: Serializer,
","Serialize","iroh::docs::PeerIdBytes"],["1.51.0 · source§impl<T, const N: usize> SlicePattern for [T; N]
","SlicePattern","iroh::docs::PeerIdBytes"],["1.34.0 · source§impl<T, const N: usize> TryFrom<&[T]> for [T; N]where\n T: Copy,
Tries to create an array [T; N] by copying from a slice &[T]. Succeeds if\nslice.len() == N.
\n\nlet bytes: [u8; 3] = [1, 0, 2];\n\nlet bytes_head: [u8; 2] = <[u8; 2]>::try_from(&bytes[0..2]).unwrap();\nassert_eq!(1, u16::from_le_bytes(bytes_head));\n\nlet bytes_tail: [u8; 2] = bytes[1..3].try_into().unwrap();\nassert_eq!(512, u16::from_le_bytes(bytes_tail));
\n§type Error = TryFromSliceError
The type returned in the event of a conversion error.","TryFrom<&[T]>","iroh::docs::PeerIdBytes"],["1.59.0 · source§impl<T, const N: usize> TryFrom<&mut [T]> for [T; N]where\n T: Copy,
Tries to create an array [T; N] by copying from a mutable slice &mut [T].\nSucceeds if slice.len() == N.
\n\nlet mut bytes: [u8; 3] = [1, 0, 2];\n\nlet bytes_head: [u8; 2] = <[u8; 2]>::try_from(&mut bytes[0..2]).unwrap();\nassert_eq!(1, u16::from_le_bytes(bytes_head));\n\nlet bytes_tail: [u8; 2] = (&mut bytes[1..3]).try_into().unwrap();\nassert_eq!(512, u16::from_le_bytes(bytes_tail));
\n§type Error = TryFromSliceError
The type returned in the event of a conversion error.","TryFrom<&mut [T]>","iroh::docs::PeerIdBytes"],["§impl<T, A, const N: usize> TryFrom<Vec<T, A>> for [T; N]where\n A: Allocator,
§fn try_from(vec: Vec<T, A>) -> Result<[T; N], Vec<T, A>>
Gets the entire contents of the Vec<T> as an array,\nif its size exactly matches that of the requested array.
\n§Examples
\nassert_eq!(vec![1, 2, 3].try_into(), Ok([1, 2, 3]));\nassert_eq!(<Vec<i32>>::new().try_into(), Ok([]));
\nIf the length doesn’t match, the input comes back in Err:
\n\nlet r: Result<[i32; 4], _> = (0..10).collect::<Vec<_>>().try_into();\nassert_eq!(r, Err(vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9]));
\nIf you’re fine with just getting a prefix of the Vec<T>,\nyou can call .truncate(N) first.
\n\nlet mut v = String::from(\"hello world\").into_bytes();\nv.sort();\nv.truncate(2);\nlet [a, b]: [_; 2] = v.try_into().unwrap();\nassert_eq!(a, b' ');\nassert_eq!(b, b'd');
\n","TryFrom>","iroh::docs::PeerIdBytes"],["1.48.0 · source§impl<T, A, const N: usize> TryFrom<Vec<T, A>> for [T; N]where\n A: Allocator,
source§fn try_from(vec: Vec<T, A>) -> Result<[T; N], Vec<T, A>>
Gets the entire contents of the Vec<T> as an array,\nif its size exactly matches that of the requested array.
\n§Examples
\nassert_eq!(vec![1, 2, 3].try_into(), Ok([1, 2, 3]));\nassert_eq!(<Vec<i32>>::new().try_into(), Ok([]));
\nIf the length doesn’t match, the input comes back in Err:
\n\nlet r: Result<[i32; 4], _> = (0..10).collect::<Vec<_>>().try_into();\nassert_eq!(r, Err(vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9]));
\nIf you’re fine with just getting a prefix of the Vec<T>,\nyou can call .truncate(N) first.
\n\nlet mut v = String::from(\"hello world\").into_bytes();\nv.sort();\nv.truncate(2);\nlet [a, b]: [_; 2] = v.try_into().unwrap();\nassert_eq!(a, b' ');\nassert_eq!(b, b'd');
\n","TryFrom>","iroh::docs::PeerIdBytes"],["§impl<Fut, T, E, const N: usize> TryJoin for [Fut; N]where\n Fut: IntoFuture<Output = Result<T, E>>,
§type Future = TryJoin<<Fut as IntoFuture>::IntoFuture, T, E, N>
Which kind of future are we turning this into?","TryJoin","iroh::docs::PeerIdBytes"],["§impl<const N: usize, T> Value for [T; N]where\n T: Value,
§type SelfType<'a> = [<T as Value>::SelfType<'a>; N]\nwhere\n [T; N]: 'a
SelfType<’a> must be the same type as Self with all lifetimes replaced with ’a§type AsBytes<'a> = Vec<u8>\nwhere\n [T; N]: 'a
§fn fixed_width() -> Option<usize>
Width of a fixed type, or None for variable width§fn from_bytes<'a>(data: &'a [u8]) -> [<T as Value>::SelfType<'a>; N]where\n [T; N]: 'a,
Deserializes data\nImplementations may return a view over data, or an owned type","Value","iroh::docs::PeerIdBytes"],["","ValueOrd","iroh::docs::PeerIdBytes"],["§impl<Z, const N: usize> Zeroize for [Z; N]where\n Z: Zeroize,
Impl [Zeroize] on arrays of types that impl [Zeroize].
\n","Zeroize","iroh::docs::PeerIdBytes"],["","Zip","iroh::docs::PeerIdBytes"],["source§impl<T, const N: usize> ConstParamTy for [T; N]where\n T: ConstParamTy,
","ConstParamTy","iroh::docs::PeerIdBytes"],["1.58.0 · source§impl<T, const N: usize> Copy for [T; N]where\n T: Copy,
","Copy","iroh::docs::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Eq for [T; N]where\n T: Eq,
","Eq","iroh::docs::PeerIdBytes"],["source§impl<T, const N: usize> StructuralPartialEq for [T; N]
","StructuralPartialEq","iroh::docs::PeerIdBytes"],["§impl<const N: usize, T> Unaligned for [T; N]where\n T: Unaligned,
","Unaligned","iroh::docs::PeerIdBytes"],["§impl<Z, const N: usize> ZeroizeOnDrop for [Z; N]where\n Z: ZeroizeOnDrop,
Impl [ZeroizeOnDrop] on arrays of types that impl [ZeroizeOnDrop].
\n","ZeroizeOnDrop","iroh::docs::PeerIdBytes"]],
-"iroh_docs":[["source§impl<T, const N: usize> [T; N]
1.55.0 · sourcepub fn map<F, U>(self, f: F) -> [U; N]where\n F: FnMut(T) -> U,
Returns an array of the same size as self, with function f applied to each element\nin order.
\nIf you don’t necessarily need a new fixed-size array, consider using\nIterator::map instead.
\n§Note on performance and stack usage
\nUnfortunately, usages of this method are currently not always optimized\nas well as they could be. This mainly concerns large arrays, as mapping\nover small arrays seem to be optimized just fine. Also note that in\ndebug mode (i.e. without any optimizations), this method can use a lot\nof stack space (a few times the size of the array or more).
\nTherefore, in performance-critical code, try to avoid using this method\non large arrays or check the emitted code. Also try to avoid chained\nmaps (e.g. arr.map(...).map(...)).
\nIn many cases, you can instead use Iterator::map by calling .iter()\nor .into_iter() on your array. [T; N]::map is only necessary if you\nreally need a new array of the same size as the result. Rust’s lazy\niterators tend to get optimized very well.
\n§Examples
\nlet x = [1, 2, 3];\nlet y = x.map(|v| v + 1);\nassert_eq!(y, [2, 3, 4]);\n\nlet x = [1, 2, 3];\nlet mut temp = 0;\nlet y = x.map(|v| { temp += 1; v * temp });\nassert_eq!(y, [1, 4, 9]);\n\nlet x = [\"Ferris\", \"Bueller's\", \"Day\", \"Off\"];\nlet y = x.map(|v| v.len());\nassert_eq!(y, [6, 9, 3, 3]);
\nsourcepub fn try_map<F, R>(\n self,\n f: F\n) -> <<R as Try>::Residual as Residual<[<R as Try>::Output; N]>>::TryType
🔬This is a nightly-only experimental API. (array_try_map)
A fallible function f applied to each element on array self in order to\nreturn an array the same size as self or the first error encountered.
\nThe return type of this function depends on the return type of the closure.\nIf you return Result<T, E> from the closure, you’ll get a Result<[T; N], E>.\nIf you return Option<T> from the closure, you’ll get an Option<[T; N]>.
\n§Examples
\n#![feature(array_try_map)]\n\nlet a = [\"1\", \"2\", \"3\"];\nlet b = a.try_map(|v| v.parse::<u32>()).unwrap().map(|v| v + 1);\nassert_eq!(b, [2, 3, 4]);\n\nlet a = [\"1\", \"2a\", \"3\"];\nlet b = a.try_map(|v| v.parse::<u32>());\nassert!(b.is_err());\n\nuse std::num::NonZero;\n\nlet z = [1, 2, 0, 3, 4];\nassert_eq!(z.try_map(NonZero::new), None);\n\nlet a = [1, 2, 3];\nlet b = a.try_map(NonZero::new);\nlet c = b.map(|x| x.map(NonZero::get));\nassert_eq!(c, Some(a));
\n1.57.0 (const: 1.57.0) · sourcepub const fn as_slice(&self) -> &[T]
Returns a slice containing the entire array. Equivalent to &s[..].
\n1.57.0 · sourcepub fn as_mut_slice(&mut self) -> &mut [T]
Returns a mutable slice containing the entire array. Equivalent to\n&mut s[..].
\n1.77.0 · sourcepub fn each_ref(&self) -> [&T; N]
Borrows each element and returns an array of references with the same\nsize as self.
\n§Example
\nlet floats = [3.1, 2.7, -1.0];\nlet float_refs: [&f64; 3] = floats.each_ref();\nassert_eq!(float_refs, [&3.1, &2.7, &-1.0]);
\nThis method is particularly useful if combined with other methods, like\nmap. This way, you can avoid moving the original\narray if its elements are not Copy.
\n\nlet strings = [\"Ferris\".to_string(), \"♥\".to_string(), \"Rust\".to_string()];\nlet is_ascii = strings.each_ref().map(|s| s.is_ascii());\nassert_eq!(is_ascii, [true, false, true]);\n\n// We can still access the original array: it has not been moved.\nassert_eq!(strings.len(), 3);
\n1.77.0 · sourcepub fn each_mut(&mut self) -> [&mut T; N]
Borrows each element mutably and returns an array of mutable references\nwith the same size as self.
\n§Example
\n\nlet mut floats = [3.1, 2.7, -1.0];\nlet float_refs: [&mut f64; 3] = floats.each_mut();\n*float_refs[0] = 0.0;\nassert_eq!(float_refs, [&mut 0.0, &mut 2.7, &mut -1.0]);\nassert_eq!(floats, [0.0, 2.7, -1.0]);
\nsourcepub fn split_array_ref<const M: usize>(&self) -> (&[T; M], &[T])
🔬This is a nightly-only experimental API. (split_array)
Divides one array reference into two at an index.
\nThe first will contain all indices from [0, M) (excluding\nthe index M itself) and the second will contain all\nindices from [M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet v = [1, 2, 3, 4, 5, 6];\n\n{\n let (left, right) = v.split_array_ref::<0>();\n assert_eq!(left, &[]);\n assert_eq!(right, &[1, 2, 3, 4, 5, 6]);\n}\n\n{\n let (left, right) = v.split_array_ref::<2>();\n assert_eq!(left, &[1, 2]);\n assert_eq!(right, &[3, 4, 5, 6]);\n}\n\n{\n let (left, right) = v.split_array_ref::<6>();\n assert_eq!(left, &[1, 2, 3, 4, 5, 6]);\n assert_eq!(right, &[]);\n}
\nsourcepub fn split_array_mut<const M: usize>(&mut self) -> (&mut [T; M], &mut [T])
🔬This is a nightly-only experimental API. (split_array)
Divides one mutable array reference into two at an index.
\nThe first will contain all indices from [0, M) (excluding\nthe index M itself) and the second will contain all\nindices from [M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet mut v = [1, 0, 3, 0, 5, 6];\nlet (left, right) = v.split_array_mut::<2>();\nassert_eq!(left, &mut [1, 0][..]);\nassert_eq!(right, &mut [3, 0, 5, 6]);\nleft[1] = 2;\nright[1] = 4;\nassert_eq!(v, [1, 2, 3, 4, 5, 6]);
\nsourcepub fn rsplit_array_ref<const M: usize>(&self) -> (&[T], &[T; M])
🔬This is a nightly-only experimental API. (split_array)
Divides one array reference into two at an index from the end.
\nThe first will contain all indices from [0, N - M) (excluding\nthe index N - M itself) and the second will contain all\nindices from [N - M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet v = [1, 2, 3, 4, 5, 6];\n\n{\n let (left, right) = v.rsplit_array_ref::<0>();\n assert_eq!(left, &[1, 2, 3, 4, 5, 6]);\n assert_eq!(right, &[]);\n}\n\n{\n let (left, right) = v.rsplit_array_ref::<2>();\n assert_eq!(left, &[1, 2, 3, 4]);\n assert_eq!(right, &[5, 6]);\n}\n\n{\n let (left, right) = v.rsplit_array_ref::<6>();\n assert_eq!(left, &[]);\n assert_eq!(right, &[1, 2, 3, 4, 5, 6]);\n}
\nsourcepub fn rsplit_array_mut<const M: usize>(&mut self) -> (&mut [T], &mut [T; M])
🔬This is a nightly-only experimental API. (split_array)
Divides one mutable array reference into two at an index from the end.
\nThe first will contain all indices from [0, N - M) (excluding\nthe index N - M itself) and the second will contain all\nindices from [N - M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet mut v = [1, 0, 3, 0, 5, 6];\nlet (left, right) = v.rsplit_array_mut::<4>();\nassert_eq!(left, &mut [1, 0]);\nassert_eq!(right, &mut [3, 0, 5, 6][..]);\nleft[1] = 2;\nright[1] = 4;\nassert_eq!(v, [1, 2, 3, 4, 5, 6]);
\n",0,"iroh_docs::sync::PeerIdBytes"],["source§impl<const N: usize> [u8; N]
sourcepub const fn as_ascii(&self) -> Option<&[AsciiChar; N]>
🔬This is a nightly-only experimental API. (ascii_char)
Converts this array of bytes into a array of ASCII characters,\nor returns None if any of the characters is non-ASCII.
\n§Examples
\n#![feature(ascii_char)]\n#![feature(const_option)]\n\nconst HEX_DIGITS: [std::ascii::Char; 16] =\n *b\"0123456789abcdef\".as_ascii().unwrap();\n\nassert_eq!(HEX_DIGITS[1].as_str(), \"1\");\nassert_eq!(HEX_DIGITS[10].as_str(), \"a\");
\nsourcepub const unsafe fn as_ascii_unchecked(&self) -> &[AsciiChar; N]
🔬This is a nightly-only experimental API. (ascii_char)
Converts this array of bytes into a array of ASCII characters,\nwithout checking whether they’re valid.
\n§Safety
\nEvery byte in the array must be in 0..=127, or else this is UB.
\n",0,"iroh_docs::sync::PeerIdBytes"],["§impl<T> Array for [T; 32]where\n T: Default,
§fn as_slice_mut(&mut self) -> &mut [T]
Gives a unique slice over the whole thing. Read more","Array","iroh_docs::sync::PeerIdBytes"],["","Array","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> AsBytes for [T; N]where\n T: AsBytes,
§fn write_to_prefix(&self, bytes: &mut [u8]) -> Option<()>
","AsBytes","iroh_docs::sync::PeerIdBytes"],["","AsBytes","iroh_docs::sync::PeerIdBytes"],["","AsMut<[T]>","iroh_docs::sync::PeerIdBytes"],["","AsRef<[T]>","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> BitView for [T; N]where\n T: BitStore,
Note that overly-large arrays may cause the conversions to fail.
\n§fn view_bits<O>(&self) -> &BitSlice<T, O>where\n O: BitOrder,
Views a memory region as an immutable bit-slice.§fn try_view_bits<O>(&self) -> Result<&BitSlice<T, O>, BitSpanError<T>>where\n O: BitOrder,
Attempts to view a memory region as an immutable bit-slice. Read more§fn view_bits_mut<O>(&mut self) -> &mut BitSlice<T, O>where\n O: BitOrder,
Views a memory region as a mutable bit-slice.§fn try_view_bits_mut<O>(\n &mut self\n) -> Result<&mut BitSlice<T, O>, BitSpanError<T>>where\n O: BitOrder,
Attempts to view a memory region as a mutable bit-slice. Read more","BitView","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> BitViewSized for [T; N]where\n T: BitStore,
§fn as_raw_slice(&self) -> &[<[T; N] as BitView>::Store]
Views the type as a slice of its elements.§fn as_raw_mut_slice(&mut self) -> &mut [<[T; N] as BitView>::Store]
Views the type as a mutable slice of its elements.§fn into_bitarray<O>(self) -> BitArray<Self, O>where\n O: BitOrder,
Wraps self in a BitArray.","BitViewSized","iroh_docs::sync::PeerIdBytes"],["","Borrow<[T]>","iroh_docs::sync::PeerIdBytes"],["1.4.0 · source§impl<T, const N: usize> BorrowMut<[T]> for [T; N]
source§fn borrow_mut(&mut self) -> &mut [T]
Mutably borrows from an owned value. Read more","BorrowMut<[T]>","iroh_docs::sync::PeerIdBytes"],["","Chain","iroh_docs::sync::PeerIdBytes"],["","Clone","iroh_docs::sync::PeerIdBytes"],["","Debug","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize> Decode for [u8; N]
Decodes a byte array from byte[n] as described in RFC4251 § 5:
\n\nA byte represents an arbitrary 8-bit value (octet). Fixed length\ndata is sometimes represented as an array of bytes, written\nbyte[n], where n is the number of bytes in the array.
\n
\n","Decode","iroh_docs::sync::PeerIdBytes"],["§impl<'a, T, const N: usize> DecodeValue<'a> for [T; N]where\n T: Decode<'a>,
§fn decode_value<R>(reader: &mut R, header: Header) -> Result<[T; N], Error>where\n R: Reader<'a>,
Attempt to decode this message using the provided [Reader].","DecodeValue<'a>","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["source§impl<'de, T> Deserialize<'de> for [T; 32]where\n T: Deserialize<'de>,
source§fn deserialize<D>(\n deserializer: D\n) -> Result<[T; 32], <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more","Deserialize<'de>","iroh_docs::sync::PeerIdBytes"],["source§impl<'de, const N: usize> Deserialize<'de> for [u8; N]
source§fn deserialize<D>(\n deserializer: D\n) -> Result<[u8; N], <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
","Deserialize<'de>","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize> Encode for [u8; N]
Encodes [u8; N] into byte[n] as described in RFC4251 § 5:
\n\nA byte represents an arbitrary 8-bit value (octet). Fixed length\ndata is sometimes represented as an array of bytes, written\nbyte[n], where n is the number of bytes in the array.
\n
\n§fn encoded_len(&self) -> Result<usize, Error>
Get the length of this type encoded in bytes, prior to Base64 encoding.§fn encode(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value using the provided [Writer].§fn encoded_len_prefixed(&self) -> Result<usize, Error>
Return the length of this type after encoding when prepended with a\nuint32 length prefix.§fn encode_prefixed(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value, first prepending a uint32 length prefix\nset to [Encode::encoded_len].","Encode","iroh_docs::sync::PeerIdBytes"],["","EncodeLabelSet","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> EncodeValue for [T; N]where\n T: Encode,
","EncodeValue","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["§impl<'a> FindToken<&'a u8> for [u8; 32]
§fn find_token(&self, token: &u8) -> bool
Returns true if self contains the token","FindToken<&'a u8>","iroh_docs::sync::PeerIdBytes"],["§impl FindToken<u8> for [u8; 32]
§fn find_token(&self, token: u8) -> bool
Returns true if self contains the token","FindToken","iroh_docs::sync::PeerIdBytes"],["","FixedTag","iroh_docs::sync::PeerIdBytes"],["","From<&Signature>","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["§impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>>> for [T; 32]
","From, B0>, B0>, B0>, B0>, B0>>>","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["","From>","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["source§impl From<NamespaceId> for [u8; 32]
source§fn from(value: NamespaceId) -> Self
Converts to this type from the input type.","From","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["","From>","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> FromBytes for [T; N]where\n T: FromBytes,
§fn slice_from_prefix(bytes: &[u8], count: usize) -> Option<(&[Self], &[u8])>where\n Self: Sized,
Interprets the prefix of the given bytes as a &[Self] with length\nequal to count without copying. Read more§fn slice_from_suffix(bytes: &[u8], count: usize) -> Option<(&[u8], &[Self])>where\n Self: Sized,
Interprets the suffix of the given bytes as a &[Self] with length\nequal to count without copying. Read more§fn read_from_prefix(bytes: &[u8]) -> Option<Self>where\n Self: Sized,
","FromBytes","iroh_docs::sync::PeerIdBytes"],["","FromHex","iroh_docs::sync::PeerIdBytes"],["","FromZeroes","iroh_docs::sync::PeerIdBytes"],["","Hash","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Hash for [T; N]where\n T: Hash,
The hash of an array is the same as that of the corresponding slice,\nas required by the Borrow implementation.
\n\nuse std::hash::BuildHasher;\n\nlet b = std::hash::RandomState::new();\nlet a: [u8; 3] = [0xa8, 0x3c, 0x09];\nlet s: &[u8] = &[0xa8, 0x3c, 0x09];\nassert_eq!(b.hash_one(a), b.hash_one(s));
\n","Hash","iroh_docs::sync::PeerIdBytes"],["","Index","iroh_docs::sync::PeerIdBytes"],["","IndexMut","iroh_docs::sync::PeerIdBytes"],["","InputLength","iroh_docs::sync::PeerIdBytes"],["1.53.0 · source§impl<T, const N: usize> IntoIterator for [T; N]
source§fn into_iter(self) -> <[T; N] as IntoIterator>::IntoIter
Creates a consuming iterator, that is, one that moves each value out of\nthe array (from start to end). The array cannot be used after calling\nthis unless T implements Copy, so the whole array is copied.
\nArrays have special behavior when calling .into_iter() prior to the\n2021 edition – see the array Editions section for more information.
\n","IntoIterator","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize> IntoResponse for [u8; N]
§fn into_response(self) -> Response<Body>
Create a response.","IntoResponse","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, const N: usize> Join for [Fut; N]where\n Fut: IntoFuture,
§type Output = [<Fut as IntoFuture>::Output; N]
The resulting output type.§type Future = Join<<Fut as IntoFuture>::IntoFuture, N>
The Future implementation returned by this method.","Join","iroh_docs::sync::PeerIdBytes"],["","Key","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> MaxSize for [T; N]where\n T: MaxSize,
§const POSTCARD_MAX_SIZE: usize = _
The maximum possible size that the serialization of this\ntype can have, in bytes.","MaxSize","iroh_docs::sync::PeerIdBytes"],["","Merge","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Ord for [T; N]where\n T: Ord,
Implements comparison of arrays lexicographically.
\n1.21.0 · source§fn max(self, other: Self) -> Selfwhere\n Self: Sized,
Compares and returns the maximum of two values. Read more","Ord","iroh_docs::sync::PeerIdBytes"],["","PartialEq<&[U]>","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, U, const N: usize> PartialEq<&mut [U]> for [T; N]where\n T: PartialEq<U>,
","PartialEq<&mut [U]>","iroh_docs::sync::PeerIdBytes"],["","PartialEq<[U]>","iroh_docs::sync::PeerIdBytes"],["","PartialEq<[U; N]>","iroh_docs::sync::PeerIdBytes"],["","PartialEq","iroh_docs::sync::PeerIdBytes"],["§impl<A, B, const N: usize, const M: usize> PartialEq<Vec<A, N>> for [B; M]where\n A: PartialEq<B>,
","PartialEq>","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> PartialOrd for [T; N]where\n T: PartialOrd,
Implements comparison of arrays lexicographically.
\nsource§fn le(&self, other: &[T; N]) -> bool
This method tests less than or equal to (for self and other) and is used by the <=\noperator. Read more","PartialOrd","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, const N: usize> Race for [Fut; N]where\n Fut: IntoFuture,
§type Output = <Fut as IntoFuture>::Output
The resulting output type.§type Future = Race<<Fut as IntoFuture>::IntoFuture, N>
Which kind of future are we turning this into?","Race","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, T, E, const N: usize> RaceOk for [Fut; N]where\n Fut: IntoFuture<Output = Result<T, E>>,
§type Future = RaceOk<<Fut as IntoFuture>::IntoFuture, T, E, N>
Which kind of future are we turning this into?","RaceOk","iroh_docs::sync::PeerIdBytes"],["","Schema","iroh_docs::sync::PeerIdBytes"],["source§impl<T> Serialize for [T; 32]where\n T: 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","iroh_docs::sync::PeerIdBytes"],["source§impl<const N: usize> Serialize for [u8; N]
source§fn serialize<S>(\n &self,\n serializer: S\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where\n S: Serializer,
","Serialize","iroh_docs::sync::PeerIdBytes"],["1.51.0 · source§impl<T, const N: usize> SlicePattern for [T; N]
","SlicePattern","iroh_docs::sync::PeerIdBytes"],["1.34.0 · source§impl<T, const N: usize> TryFrom<&[T]> for [T; N]where\n T: Copy,
Tries to create an array [T; N] by copying from a slice &[T]. Succeeds if\nslice.len() == N.
\n\nlet bytes: [u8; 3] = [1, 0, 2];\n\nlet bytes_head: [u8; 2] = <[u8; 2]>::try_from(&bytes[0..2]).unwrap();\nassert_eq!(1, u16::from_le_bytes(bytes_head));\n\nlet bytes_tail: [u8; 2] = bytes[1..3].try_into().unwrap();\nassert_eq!(512, u16::from_le_bytes(bytes_tail));
\n§type Error = TryFromSliceError
The type returned in the event of a conversion error.","TryFrom<&[T]>","iroh_docs::sync::PeerIdBytes"],["1.59.0 · source§impl<T, const N: usize> TryFrom<&mut [T]> for [T; N]where\n T: Copy,
Tries to create an array [T; N] by copying from a mutable slice &mut [T].\nSucceeds if slice.len() == N.
\n\nlet mut bytes: [u8; 3] = [1, 0, 2];\n\nlet bytes_head: [u8; 2] = <[u8; 2]>::try_from(&mut bytes[0..2]).unwrap();\nassert_eq!(1, u16::from_le_bytes(bytes_head));\n\nlet bytes_tail: [u8; 2] = (&mut bytes[1..3]).try_into().unwrap();\nassert_eq!(512, u16::from_le_bytes(bytes_tail));
\n§type Error = TryFromSliceError
The type returned in the event of a conversion error.","TryFrom<&mut [T]>","iroh_docs::sync::PeerIdBytes"],["§impl<T, A, const N: usize> TryFrom<Vec<T, A>> for [T; N]where\n A: Allocator,
§fn try_from(vec: Vec<T, A>) -> Result<[T; N], Vec<T, A>>
Gets the entire contents of the Vec<T> as an array,\nif its size exactly matches that of the requested array.
\n§Examples
\nassert_eq!(vec![1, 2, 3].try_into(), Ok([1, 2, 3]));\nassert_eq!(<Vec<i32>>::new().try_into(), Ok([]));
\nIf the length doesn’t match, the input comes back in Err:
\n\nlet r: Result<[i32; 4], _> = (0..10).collect::<Vec<_>>().try_into();\nassert_eq!(r, Err(vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9]));
\nIf you’re fine with just getting a prefix of the Vec<T>,\nyou can call .truncate(N) first.
\n\nlet mut v = String::from(\"hello world\").into_bytes();\nv.sort();\nv.truncate(2);\nlet [a, b]: [_; 2] = v.try_into().unwrap();\nassert_eq!(a, b' ');\nassert_eq!(b, b'd');
\n","TryFrom>","iroh_docs::sync::PeerIdBytes"],["1.48.0 · source§impl<T, A, const N: usize> TryFrom<Vec<T, A>> for [T; N]where\n A: Allocator,
source§fn try_from(vec: Vec<T, A>) -> Result<[T; N], Vec<T, A>>
Gets the entire contents of the Vec<T> as an array,\nif its size exactly matches that of the requested array.
\n§Examples
\nassert_eq!(vec![1, 2, 3].try_into(), Ok([1, 2, 3]));\nassert_eq!(<Vec<i32>>::new().try_into(), Ok([]));
\nIf the length doesn’t match, the input comes back in Err:
\n\nlet r: Result<[i32; 4], _> = (0..10).collect::<Vec<_>>().try_into();\nassert_eq!(r, Err(vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9]));
\nIf you’re fine with just getting a prefix of the Vec<T>,\nyou can call .truncate(N) first.
\n\nlet mut v = String::from(\"hello world\").into_bytes();\nv.sort();\nv.truncate(2);\nlet [a, b]: [_; 2] = v.try_into().unwrap();\nassert_eq!(a, b' ');\nassert_eq!(b, b'd');
\n","TryFrom>","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, T, E, const N: usize> TryJoin for [Fut; N]where\n Fut: IntoFuture<Output = Result<T, E>>,
§type Future = TryJoin<<Fut as IntoFuture>::IntoFuture, T, E, N>
Which kind of future are we turning this into?","TryJoin","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> Value for [T; N]where\n T: Value,
§type SelfType<'a> = [<T as Value>::SelfType<'a>; N]\nwhere\n [T; N]: 'a
SelfType<’a> must be the same type as Self with all lifetimes replaced with ’a§type AsBytes<'a> = Vec<u8>\nwhere\n [T; N]: 'a
§fn fixed_width() -> Option<usize>
Width of a fixed type, or None for variable width§fn from_bytes<'a>(data: &'a [u8]) -> [<T as Value>::SelfType<'a>; N]where\n [T; N]: 'a,
Deserializes data\nImplementations may return a view over data, or an owned type","Value","iroh_docs::sync::PeerIdBytes"],["","ValueOrd","iroh_docs::sync::PeerIdBytes"],["§impl<Z, const N: usize> Zeroize for [Z; N]where\n Z: Zeroize,
Impl [Zeroize] on arrays of types that impl [Zeroize].
\n","Zeroize","iroh_docs::sync::PeerIdBytes"],["","Zip","iroh_docs::sync::PeerIdBytes"],["source§impl<T, const N: usize> ConstParamTy for [T; N]where\n T: ConstParamTy,
","ConstParamTy","iroh_docs::sync::PeerIdBytes"],["1.58.0 · source§impl<T, const N: usize> Copy for [T; N]where\n T: Copy,
","Copy","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Eq for [T; N]where\n T: Eq,
","Eq","iroh_docs::sync::PeerIdBytes"],["source§impl<T, const N: usize> StructuralPartialEq for [T; N]
","StructuralPartialEq","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> Unaligned for [T; N]where\n T: Unaligned,
","Unaligned","iroh_docs::sync::PeerIdBytes"],["§impl<Z, const N: usize> ZeroizeOnDrop for [Z; N]where\n Z: ZeroizeOnDrop,
Impl [ZeroizeOnDrop] on arrays of types that impl [ZeroizeOnDrop].
\n","ZeroizeOnDrop","iroh_docs::sync::PeerIdBytes"]]
+"iroh_docs":[["source§impl<T, const N: usize> [T; N]
1.55.0 · sourcepub fn map<F, U>(self, f: F) -> [U; N]where\n F: FnMut(T) -> U,
Returns an array of the same size as self, with function f applied to each element\nin order.
\nIf you don’t necessarily need a new fixed-size array, consider using\nIterator::map instead.
\n§Note on performance and stack usage
\nUnfortunately, usages of this method are currently not always optimized\nas well as they could be. This mainly concerns large arrays, as mapping\nover small arrays seem to be optimized just fine. Also note that in\ndebug mode (i.e. without any optimizations), this method can use a lot\nof stack space (a few times the size of the array or more).
\nTherefore, in performance-critical code, try to avoid using this method\non large arrays or check the emitted code. Also try to avoid chained\nmaps (e.g. arr.map(...).map(...)).
\nIn many cases, you can instead use Iterator::map by calling .iter()\nor .into_iter() on your array. [T; N]::map is only necessary if you\nreally need a new array of the same size as the result. Rust’s lazy\niterators tend to get optimized very well.
\n§Examples
\nlet x = [1, 2, 3];\nlet y = x.map(|v| v + 1);\nassert_eq!(y, [2, 3, 4]);\n\nlet x = [1, 2, 3];\nlet mut temp = 0;\nlet y = x.map(|v| { temp += 1; v * temp });\nassert_eq!(y, [1, 4, 9]);\n\nlet x = [\"Ferris\", \"Bueller's\", \"Day\", \"Off\"];\nlet y = x.map(|v| v.len());\nassert_eq!(y, [6, 9, 3, 3]);
\nsourcepub fn try_map<F, R>(\n self,\n f: F\n) -> <<R as Try>::Residual as Residual<[<R as Try>::Output; N]>>::TryType
🔬This is a nightly-only experimental API. (array_try_map)
A fallible function f applied to each element on array self in order to\nreturn an array the same size as self or the first error encountered.
\nThe return type of this function depends on the return type of the closure.\nIf you return Result<T, E> from the closure, you’ll get a Result<[T; N], E>.\nIf you return Option<T> from the closure, you’ll get an Option<[T; N]>.
\n§Examples
\n#![feature(array_try_map)]\n\nlet a = [\"1\", \"2\", \"3\"];\nlet b = a.try_map(|v| v.parse::<u32>()).unwrap().map(|v| v + 1);\nassert_eq!(b, [2, 3, 4]);\n\nlet a = [\"1\", \"2a\", \"3\"];\nlet b = a.try_map(|v| v.parse::<u32>());\nassert!(b.is_err());\n\nuse std::num::NonZero;\n\nlet z = [1, 2, 0, 3, 4];\nassert_eq!(z.try_map(NonZero::new), None);\n\nlet a = [1, 2, 3];\nlet b = a.try_map(NonZero::new);\nlet c = b.map(|x| x.map(NonZero::get));\nassert_eq!(c, Some(a));
\n1.57.0 (const: 1.57.0) · sourcepub const fn as_slice(&self) -> &[T]
Returns a slice containing the entire array. Equivalent to &s[..].
\n1.57.0 · sourcepub fn as_mut_slice(&mut self) -> &mut [T]
Returns a mutable slice containing the entire array. Equivalent to\n&mut s[..].
\n1.77.0 · sourcepub fn each_ref(&self) -> [&T; N]
Borrows each element and returns an array of references with the same\nsize as self.
\n§Example
\nlet floats = [3.1, 2.7, -1.0];\nlet float_refs: [&f64; 3] = floats.each_ref();\nassert_eq!(float_refs, [&3.1, &2.7, &-1.0]);
\nThis method is particularly useful if combined with other methods, like\nmap. This way, you can avoid moving the original\narray if its elements are not Copy.
\n\nlet strings = [\"Ferris\".to_string(), \"♥\".to_string(), \"Rust\".to_string()];\nlet is_ascii = strings.each_ref().map(|s| s.is_ascii());\nassert_eq!(is_ascii, [true, false, true]);\n\n// We can still access the original array: it has not been moved.\nassert_eq!(strings.len(), 3);
\n1.77.0 · sourcepub fn each_mut(&mut self) -> [&mut T; N]
Borrows each element mutably and returns an array of mutable references\nwith the same size as self.
\n§Example
\n\nlet mut floats = [3.1, 2.7, -1.0];\nlet float_refs: [&mut f64; 3] = floats.each_mut();\n*float_refs[0] = 0.0;\nassert_eq!(float_refs, [&mut 0.0, &mut 2.7, &mut -1.0]);\nassert_eq!(floats, [0.0, 2.7, -1.0]);
\nsourcepub fn split_array_ref<const M: usize>(&self) -> (&[T; M], &[T])
🔬This is a nightly-only experimental API. (split_array)
Divides one array reference into two at an index.
\nThe first will contain all indices from [0, M) (excluding\nthe index M itself) and the second will contain all\nindices from [M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet v = [1, 2, 3, 4, 5, 6];\n\n{\n let (left, right) = v.split_array_ref::<0>();\n assert_eq!(left, &[]);\n assert_eq!(right, &[1, 2, 3, 4, 5, 6]);\n}\n\n{\n let (left, right) = v.split_array_ref::<2>();\n assert_eq!(left, &[1, 2]);\n assert_eq!(right, &[3, 4, 5, 6]);\n}\n\n{\n let (left, right) = v.split_array_ref::<6>();\n assert_eq!(left, &[1, 2, 3, 4, 5, 6]);\n assert_eq!(right, &[]);\n}
\nsourcepub fn split_array_mut<const M: usize>(&mut self) -> (&mut [T; M], &mut [T])
🔬This is a nightly-only experimental API. (split_array)
Divides one mutable array reference into two at an index.
\nThe first will contain all indices from [0, M) (excluding\nthe index M itself) and the second will contain all\nindices from [M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet mut v = [1, 0, 3, 0, 5, 6];\nlet (left, right) = v.split_array_mut::<2>();\nassert_eq!(left, &mut [1, 0][..]);\nassert_eq!(right, &mut [3, 0, 5, 6]);\nleft[1] = 2;\nright[1] = 4;\nassert_eq!(v, [1, 2, 3, 4, 5, 6]);
\nsourcepub fn rsplit_array_ref<const M: usize>(&self) -> (&[T], &[T; M])
🔬This is a nightly-only experimental API. (split_array)
Divides one array reference into two at an index from the end.
\nThe first will contain all indices from [0, N - M) (excluding\nthe index N - M itself) and the second will contain all\nindices from [N - M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet v = [1, 2, 3, 4, 5, 6];\n\n{\n let (left, right) = v.rsplit_array_ref::<0>();\n assert_eq!(left, &[1, 2, 3, 4, 5, 6]);\n assert_eq!(right, &[]);\n}\n\n{\n let (left, right) = v.rsplit_array_ref::<2>();\n assert_eq!(left, &[1, 2, 3, 4]);\n assert_eq!(right, &[5, 6]);\n}\n\n{\n let (left, right) = v.rsplit_array_ref::<6>();\n assert_eq!(left, &[]);\n assert_eq!(right, &[1, 2, 3, 4, 5, 6]);\n}
\nsourcepub fn rsplit_array_mut<const M: usize>(&mut self) -> (&mut [T], &mut [T; M])
🔬This is a nightly-only experimental API. (split_array)
Divides one mutable array reference into two at an index from the end.
\nThe first will contain all indices from [0, N - M) (excluding\nthe index N - M itself) and the second will contain all\nindices from [N - M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet mut v = [1, 0, 3, 0, 5, 6];\nlet (left, right) = v.rsplit_array_mut::<4>();\nassert_eq!(left, &mut [1, 0]);\nassert_eq!(right, &mut [3, 0, 5, 6][..]);\nleft[1] = 2;\nright[1] = 4;\nassert_eq!(v, [1, 2, 3, 4, 5, 6]);
\n",0,"iroh_docs::sync::PeerIdBytes"],["source§impl<const N: usize> [u8; N]
sourcepub const fn as_ascii(&self) -> Option<&[AsciiChar; N]>
🔬This is a nightly-only experimental API. (ascii_char)
Converts this array of bytes into a array of ASCII characters,\nor returns None if any of the characters is non-ASCII.
\n§Examples
\n#![feature(ascii_char)]\n#![feature(const_option)]\n\nconst HEX_DIGITS: [std::ascii::Char; 16] =\n *b\"0123456789abcdef\".as_ascii().unwrap();\n\nassert_eq!(HEX_DIGITS[1].as_str(), \"1\");\nassert_eq!(HEX_DIGITS[10].as_str(), \"a\");
\nsourcepub const unsafe fn as_ascii_unchecked(&self) -> &[AsciiChar; N]
🔬This is a nightly-only experimental API. (ascii_char)
Converts this array of bytes into a array of ASCII characters,\nwithout checking whether they’re valid.
\n§Safety
\nEvery byte in the array must be in 0..=127, or else this is UB.
\n",0,"iroh_docs::sync::PeerIdBytes"],["§impl<T> Array for [T; 32]where\n T: Default,
§fn as_slice_mut(&mut self) -> &mut [T]
Gives a unique slice over the whole thing. Read more","Array","iroh_docs::sync::PeerIdBytes"],["","Array","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> AsBytes for [T; N]where\n T: AsBytes,
§fn write_to_prefix(&self, bytes: &mut [u8]) -> Option<()>
","AsBytes","iroh_docs::sync::PeerIdBytes"],["","AsBytes","iroh_docs::sync::PeerIdBytes"],["","AsMut<[T]>","iroh_docs::sync::PeerIdBytes"],["","AsRef<[T]>","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> BitView for [T; N]where\n T: BitStore,
Note that overly-large arrays may cause the conversions to fail.
\n§fn view_bits<O>(&self) -> &BitSlice<T, O>where\n O: BitOrder,
Views a memory region as an immutable bit-slice.§fn try_view_bits<O>(&self) -> Result<&BitSlice<T, O>, BitSpanError<T>>where\n O: BitOrder,
Attempts to view a memory region as an immutable bit-slice. Read more§fn view_bits_mut<O>(&mut self) -> &mut BitSlice<T, O>where\n O: BitOrder,
Views a memory region as a mutable bit-slice.§fn try_view_bits_mut<O>(\n &mut self\n) -> Result<&mut BitSlice<T, O>, BitSpanError<T>>where\n O: BitOrder,
Attempts to view a memory region as a mutable bit-slice. Read more","BitView","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> BitViewSized for [T; N]where\n T: BitStore,
§fn as_raw_slice(&self) -> &[<[T; N] as BitView>::Store]
Views the type as a slice of its elements.§fn as_raw_mut_slice(&mut self) -> &mut [<[T; N] as BitView>::Store]
Views the type as a mutable slice of its elements.§fn into_bitarray<O>(self) -> BitArray<Self, O>where\n O: BitOrder,
Wraps self in a BitArray.","BitViewSized","iroh_docs::sync::PeerIdBytes"],["","Borrow<[T]>","iroh_docs::sync::PeerIdBytes"],["1.4.0 · source§impl<T, const N: usize> BorrowMut<[T]> for [T; N]
source§fn borrow_mut(&mut self) -> &mut [T]
Mutably borrows from an owned value. Read more","BorrowMut<[T]>","iroh_docs::sync::PeerIdBytes"],["","Chain","iroh_docs::sync::PeerIdBytes"],["","Clone","iroh_docs::sync::PeerIdBytes"],["","Debug","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize> Decode for [u8; N]
Decodes a byte array from byte[n] as described in RFC4251 § 5:
\n\nA byte represents an arbitrary 8-bit value (octet). Fixed length\ndata is sometimes represented as an array of bytes, written\nbyte[n], where n is the number of bytes in the array.
\n
\n","Decode","iroh_docs::sync::PeerIdBytes"],["§impl<'a, T, const N: usize> DecodeValue<'a> for [T; N]where\n T: Decode<'a>,
§fn decode_value<R>(reader: &mut R, header: Header) -> Result<[T; N], Error>where\n R: Reader<'a>,
Attempt to decode this message using the provided [Reader].","DecodeValue<'a>","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["source§impl<'de, T> Deserialize<'de> for [T; 32]where\n T: Deserialize<'de>,
source§fn deserialize<D>(\n deserializer: D\n) -> Result<[T; 32], <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more","Deserialize<'de>","iroh_docs::sync::PeerIdBytes"],["source§impl<'de, const N: usize> Deserialize<'de> for [u8; N]
source§fn deserialize<D>(\n deserializer: D\n) -> Result<[u8; N], <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
","Deserialize<'de>","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize> Encode for [u8; N]
Encodes [u8; N] into byte[n] as described in RFC4251 § 5:
\n\nA byte represents an arbitrary 8-bit value (octet). Fixed length\ndata is sometimes represented as an array of bytes, written\nbyte[n], where n is the number of bytes in the array.
\n
\n§fn encoded_len(&self) -> Result<usize, Error>
Get the length of this type encoded in bytes, prior to Base64 encoding.§fn encode(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value using the provided [Writer].§fn encoded_len_prefixed(&self) -> Result<usize, Error>
Return the length of this type after encoding when prepended with a\nuint32 length prefix.§fn encode_prefixed(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value, first prepending a uint32 length prefix\nset to [Encode::encoded_len].","Encode","iroh_docs::sync::PeerIdBytes"],["","EncodeLabelSet","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> EncodeValue for [T; N]where\n T: Encode,
","EncodeValue","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["§impl<'a> FindToken<&'a u8> for [u8; 32]
§fn find_token(&self, token: &u8) -> bool
Returns true if self contains the token","FindToken<&'a u8>","iroh_docs::sync::PeerIdBytes"],["§impl FindToken<u8> for [u8; 32]
§fn find_token(&self, token: u8) -> bool
Returns true if self contains the token","FindToken","iroh_docs::sync::PeerIdBytes"],["","FixedTag","iroh_docs::sync::PeerIdBytes"],["","From<&Signature>","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["§impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>>> for [T; 32]
","From, B0>, B0>, B0>, B0>, B0>>>","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["","From>","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["source§impl From<NamespaceId> for [u8; 32]
source§fn from(value: NamespaceId) -> Self
Converts to this type from the input type.","From","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["","From>","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> FromBytes for [T; N]where\n T: FromBytes,
§fn slice_from_prefix(bytes: &[u8], count: usize) -> Option<(&[Self], &[u8])>where\n Self: Sized,
Interprets the prefix of the given bytes as a &[Self] with length\nequal to count without copying. Read more§fn slice_from_suffix(bytes: &[u8], count: usize) -> Option<(&[u8], &[Self])>where\n Self: Sized,
Interprets the suffix of the given bytes as a &[Self] with length\nequal to count without copying. Read more§fn read_from_prefix(bytes: &[u8]) -> Option<Self>where\n Self: Sized,
","FromBytes","iroh_docs::sync::PeerIdBytes"],["","FromHex","iroh_docs::sync::PeerIdBytes"],["","FromZeroes","iroh_docs::sync::PeerIdBytes"],["","Hash","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Hash for [T; N]where\n T: Hash,
The hash of an array is the same as that of the corresponding slice,\nas required by the Borrow implementation.
\n\nuse std::hash::BuildHasher;\n\nlet b = std::hash::RandomState::new();\nlet a: [u8; 3] = [0xa8, 0x3c, 0x09];\nlet s: &[u8] = &[0xa8, 0x3c, 0x09];\nassert_eq!(b.hash_one(a), b.hash_one(s));
\n","Hash","iroh_docs::sync::PeerIdBytes"],["","Index","iroh_docs::sync::PeerIdBytes"],["","IndexMut","iroh_docs::sync::PeerIdBytes"],["","InputLength","iroh_docs::sync::PeerIdBytes"],["1.53.0 · source§impl<T, const N: usize> IntoIterator for [T; N]
source§fn into_iter(self) -> <[T; N] as IntoIterator>::IntoIter
Creates a consuming iterator, that is, one that moves each value out of\nthe array (from start to end). The array cannot be used after calling\nthis unless T implements Copy, so the whole array is copied.
\nArrays have special behavior when calling .into_iter() prior to the\n2021 edition – see the array Editions section for more information.
\n","IntoIterator","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize> IntoResponse for [u8; N]
§fn into_response(self) -> Response<Body>
Create a response.","IntoResponse","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, const N: usize> Join for [Fut; N]where\n Fut: IntoFuture,
§type Output = [<Fut as IntoFuture>::Output; N]
The resulting output type.§type Future = Join<<Fut as IntoFuture>::IntoFuture, N>
The Future implementation returned by this method.","Join","iroh_docs::sync::PeerIdBytes"],["","Key","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> MaxSize for [T; N]where\n T: MaxSize,
§const POSTCARD_MAX_SIZE: usize = _
The maximum possible size that the serialization of this\ntype can have, in bytes.","MaxSize","iroh_docs::sync::PeerIdBytes"],["","Merge","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Ord for [T; N]where\n T: Ord,
Implements comparison of arrays lexicographically.
\n1.21.0 · source§fn max(self, other: Self) -> Selfwhere\n Self: Sized,
Compares and returns the maximum of two values. Read more","Ord","iroh_docs::sync::PeerIdBytes"],["","PartialEq<&[U]>","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, U, const N: usize> PartialEq<&mut [U]> for [T; N]where\n T: PartialEq<U>,
","PartialEq<&mut [U]>","iroh_docs::sync::PeerIdBytes"],["","PartialEq<[U]>","iroh_docs::sync::PeerIdBytes"],["","PartialEq<[U; N]>","iroh_docs::sync::PeerIdBytes"],["","PartialEq","iroh_docs::sync::PeerIdBytes"],["§impl<A, B, const N: usize, const M: usize> PartialEq<Vec<A, N>> for [B; M]where\n A: PartialEq<B>,
","PartialEq>","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> PartialOrd for [T; N]where\n T: PartialOrd,
Implements comparison of arrays lexicographically.
\nsource§fn le(&self, other: &[T; N]) -> bool
This method tests less than or equal to (for self and other) and is used by the <=\noperator. Read more","PartialOrd","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, const N: usize> Race for [Fut; N]where\n Fut: IntoFuture,
§type Output = <Fut as IntoFuture>::Output
The resulting output type.§type Future = Race<<Fut as IntoFuture>::IntoFuture, N>
Which kind of future are we turning this into?","Race","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, T, E, const N: usize> RaceOk for [Fut; N]where\n Fut: IntoFuture<Output = Result<T, E>>,
§type Future = RaceOk<<Fut as IntoFuture>::IntoFuture, T, E, N>
Which kind of future are we turning this into?","RaceOk","iroh_docs::sync::PeerIdBytes"],["","Schema","iroh_docs::sync::PeerIdBytes"],["source§impl<T> Serialize for [T; 32]where\n T: 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","iroh_docs::sync::PeerIdBytes"],["source§impl<const N: usize> Serialize for [u8; N]
source§fn serialize<S>(\n &self,\n serializer: S\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where\n S: Serializer,
","Serialize","iroh_docs::sync::PeerIdBytes"],["1.51.0 · source§impl<T, const N: usize> SlicePattern for [T; N]
","SlicePattern","iroh_docs::sync::PeerIdBytes"],["1.34.0 · source§impl<T, const N: usize> TryFrom<&[T]> for [T; N]where\n T: Copy,
Tries to create an array [T; N] by copying from a slice &[T]. Succeeds if\nslice.len() == N.
\n\nlet bytes: [u8; 3] = [1, 0, 2];\n\nlet bytes_head: [u8; 2] = <[u8; 2]>::try_from(&bytes[0..2]).unwrap();\nassert_eq!(1, u16::from_le_bytes(bytes_head));\n\nlet bytes_tail: [u8; 2] = bytes[1..3].try_into().unwrap();\nassert_eq!(512, u16::from_le_bytes(bytes_tail));
\n§type Error = TryFromSliceError
The type returned in the event of a conversion error.","TryFrom<&[T]>","iroh_docs::sync::PeerIdBytes"],["1.59.0 · source§impl<T, const N: usize> TryFrom<&mut [T]> for [T; N]where\n T: Copy,
Tries to create an array [T; N] by copying from a mutable slice &mut [T].\nSucceeds if slice.len() == N.
\n\nlet mut bytes: [u8; 3] = [1, 0, 2];\n\nlet bytes_head: [u8; 2] = <[u8; 2]>::try_from(&mut bytes[0..2]).unwrap();\nassert_eq!(1, u16::from_le_bytes(bytes_head));\n\nlet bytes_tail: [u8; 2] = (&mut bytes[1..3]).try_into().unwrap();\nassert_eq!(512, u16::from_le_bytes(bytes_tail));
\n§type Error = TryFromSliceError
The type returned in the event of a conversion error.","TryFrom<&mut [T]>","iroh_docs::sync::PeerIdBytes"],["§impl<T, A, const N: usize> TryFrom<Vec<T, A>> for [T; N]where\n A: Allocator,
§fn try_from(vec: Vec<T, A>) -> Result<[T; N], Vec<T, A>>
Gets the entire contents of the Vec<T> as an array,\nif its size exactly matches that of the requested array.
\n§Examples
\nassert_eq!(vec![1, 2, 3].try_into(), Ok([1, 2, 3]));\nassert_eq!(<Vec<i32>>::new().try_into(), Ok([]));
\nIf the length doesn’t match, the input comes back in Err:
\n\nlet r: Result<[i32; 4], _> = (0..10).collect::<Vec<_>>().try_into();\nassert_eq!(r, Err(vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9]));
\nIf you’re fine with just getting a prefix of the Vec<T>,\nyou can call .truncate(N) first.
\n\nlet mut v = String::from(\"hello world\").into_bytes();\nv.sort();\nv.truncate(2);\nlet [a, b]: [_; 2] = v.try_into().unwrap();\nassert_eq!(a, b' ');\nassert_eq!(b, b'd');
\n","TryFrom>","iroh_docs::sync::PeerIdBytes"],["1.48.0 · source§impl<T, A, const N: usize> TryFrom<Vec<T, A>> for [T; N]where\n A: Allocator,
source§fn try_from(vec: Vec<T, A>) -> Result<[T; N], Vec<T, A>>
Gets the entire contents of the Vec<T> as an array,\nif its size exactly matches that of the requested array.
\n§Examples
\nassert_eq!(vec![1, 2, 3].try_into(), Ok([1, 2, 3]));\nassert_eq!(<Vec<i32>>::new().try_into(), Ok([]));
\nIf the length doesn’t match, the input comes back in Err:
\n\nlet r: Result<[i32; 4], _> = (0..10).collect::<Vec<_>>().try_into();\nassert_eq!(r, Err(vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9]));
\nIf you’re fine with just getting a prefix of the Vec<T>,\nyou can call .truncate(N) first.
\n\nlet mut v = String::from(\"hello world\").into_bytes();\nv.sort();\nv.truncate(2);\nlet [a, b]: [_; 2] = v.try_into().unwrap();\nassert_eq!(a, b' ');\nassert_eq!(b, b'd');
\n","TryFrom>","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, T, E, const N: usize> TryJoin for [Fut; N]where\n Fut: IntoFuture<Output = Result<T, E>>,
§type Future = TryJoin<<Fut as IntoFuture>::IntoFuture, T, E, N>
Which kind of future are we turning this into?","TryJoin","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> Value for [T; N]where\n T: Value,
§type SelfType<'a> = [<T as Value>::SelfType<'a>; N]\nwhere\n [T; N]: 'a
SelfType<’a> must be the same type as Self with all lifetimes replaced with ’a§type AsBytes<'a> = Vec<u8>\nwhere\n [T; N]: 'a
§fn fixed_width() -> Option<usize>
Width of a fixed type, or None for variable width§fn from_bytes<'a>(data: &'a [u8]) -> [<T as Value>::SelfType<'a>; N]where\n [T; N]: 'a,
Deserializes data\nImplementations may return a view over data, or an owned type","Value","iroh_docs::sync::PeerIdBytes"],["","ValueOrd","iroh_docs::sync::PeerIdBytes"],["§impl<Z, const N: usize> Zeroize for [Z; N]where\n Z: Zeroize,
Impl [Zeroize] on arrays of types that impl [Zeroize].
\n","Zeroize","iroh_docs::sync::PeerIdBytes"],["","Zip","iroh_docs::sync::PeerIdBytes"],["source§impl<T, const N: usize> ConstParamTy for [T; N]where\n T: ConstParamTy,
","ConstParamTy","iroh_docs::sync::PeerIdBytes"],["1.58.0 · source§impl<T, const N: usize> Copy for [T; N]where\n T: Copy,
","Copy","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Eq for [T; N]where\n T: Eq,
","Eq","iroh_docs::sync::PeerIdBytes"],["source§impl<T, const N: usize> StructuralPartialEq for [T; N]
","StructuralPartialEq","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> Unaligned for [T; N]where\n T: Unaligned,
","Unaligned","iroh_docs::sync::PeerIdBytes"],["§impl<Z, const N: usize> ZeroizeOnDrop for [Z; N]where\n Z: ZeroizeOnDrop,
Impl [ZeroizeOnDrop] on arrays of types that impl [ZeroizeOnDrop].
\n","ZeroizeOnDrop","iroh_docs::sync::PeerIdBytes"]]
};if (window.register_type_impls) {window.register_type_impls(type_impls);} else {window.pending_type_impls = type_impls;}})()
\ No newline at end of file
impl<T> Any for Twhere
diff --git a/pr/2595/docs/iroh_blobs/store/enum.ValidateProgress.html b/pr/2595/docs/iroh_blobs/store/enum.ValidateProgress.html
index 76a8f01e97..f4494f3a46 100644
--- a/pr/2595/docs/iroh_blobs/store/enum.ValidateProgress.html
+++ b/pr/2595/docs/iroh_blobs/store/enum.ValidateProgress.html
@@ -31,7 +31,7 @@
ranges: RangeSpec,
},
AllDone,
- Abort(RpcError),
+ Abort(RpcError),
}Expand description
Progress updates for the validate operation
Variants§
§Starting
started validating
Fields
§total: u64The total number of entries to validate
@@ -62,7 +62,7 @@ Otherwise it might be an url or something else to uniquely identify the entry.
§AllDone
We are done with the whole operation.
-§Abort(RpcError)
We got an error and need to abort.
+§Abort(RpcError)
We got an error and need to abort.
Trait Implementations§
source§impl Debug for ValidateProgress
source§impl<'de> Deserialize<'de> for ValidateProgress
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreAuto Trait Implementations§
§impl Freeze for ValidateProgress
§impl RefUnwindSafe for ValidateProgress
§impl Send for ValidateProgress
§impl Sync for ValidateProgress
§impl Unpin for ValidateProgress
§impl UnwindSafe for ValidateProgress
Blanket Implementations§
source§impl<T> Any for Twhere
diff --git a/pr/2595/docs/iroh_blobs/struct.Hash.html b/pr/2595/docs/iroh_blobs/struct.Hash.html
index 260e50d4b9..ba12d52876 100644
--- a/pr/2595/docs/iroh_blobs/struct.Hash.html
+++ b/pr/2595/docs/iroh_blobs/struct.Hash.html
@@ -1,36 +1,36 @@
-Hash in iroh_blobs - Rust Struct iroh_blobs::Hash
pub struct Hash(/* private fields */);
Expand description
Hash type used throughout.
-Implementations§
§impl Hash
pub const fn from_bytes(bytes: [u8; 32]) -> Hash
Create a Hash from its raw bytes representation.
-pub fn fmt_short(&self) -> String
Convert to a base32 string limited to the first 10 bytes for a friendly string
+
Hash in iroh_blobs - Rust Struct iroh_blobs::Hash
source · pub struct Hash(/* private fields */);
Expand description
Hash type used throughout.
+Implementations§
Trait Implementations§
Trait Implementations§
source§impl<'de> Deserialize<'de> for Hash
source§fn deserialize<D>(
deserializer: D
) -> Result<Hash, <D as Deserializer<'de>>::Error>where
- D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl FromIterator<Hash> for HashSeq
§impl Hash for Hash
§fn hash<__H>(&self, state: &mut __H)where
+ D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl FromIterator<Hash> for HashSeq
§impl MaxSize for Hash
§const POSTCARD_MAX_SIZE: usize = 32usize
The maximum possible size that the serialization of this
-type can have, in bytes.source§impl MaxSize for Hash
source§const POSTCARD_MAX_SIZE: usize = 32usize
The maximum possible size that the serialization of this
+type can have, in bytes.source§impl Ord for Hash
source§impl PartialEq for Hash
§impl PartialOrd for Hash
source§impl PartialOrd for Hash
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 <=
operator. Read moresource§impl Serialize for Hash
source§fn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
- S: Serializer,
Serialize this value into the given Serde serializer. Read more§impl Value for Hash
§type SelfType<'a> = Hash
SelfType<’a> must be the same type as Self with all lifetimes replaced with ’a§type AsBytes<'a> = &'a [u8; 32]
§fn fixed_width() -> Option<usize>
Width of a fixed type, or None for variable width§fn from_bytes<'a>(data: &'a [u8]) -> <Hash as Value>::SelfType<'a>where
+ S: Serializer,
Serialize this value into the given Serde serializer. Read moresource§impl Value for Hash
§type SelfType<'a> = Hash
SelfType<’a> must be the same type as Self with all lifetimes replaced with ’a§type AsBytes<'a> = &'a [u8; 32]
source§fn fixed_width() -> Option<usize>
Width of a fixed type, or None for variable width§impl Copy for Hash
§impl Eq for Hash
§impl StructuralPartialEq for Hash
Auto Trait Implementations§
§impl Freeze for Hash
§impl RefUnwindSafe for Hash
§impl Send for Hash
§impl Sync for Hash
§impl Unpin for Hash
§impl UnwindSafe for Hash
Blanket Implementations§
source§impl Copy for Hash
source§impl Eq for Hash
source§impl StructuralPartialEq for Hash
Auto Trait Implementations§
§impl Freeze for Hash
§impl RefUnwindSafe for Hash
§impl Send for Hash
§impl Sync for Hash
§impl Unpin for Hash
§impl UnwindSafe for Hash
Blanket Implementations§
§impl<A, T> AsBits<T> for A
§fn as_bits<O>(&self) -> &BitSlice<T, O>where
diff --git a/pr/2595/docs/iroh_blobs/struct.HashAndFormat.html b/pr/2595/docs/iroh_blobs/struct.HashAndFormat.html
index 8eb7ba64d5..421c7e1439 100644
--- a/pr/2595/docs/iroh_blobs/struct.HashAndFormat.html
+++ b/pr/2595/docs/iroh_blobs/struct.HashAndFormat.html
@@ -1,37 +1,37 @@
-HashAndFormat in iroh_blobs - Rust Struct iroh_blobs::HashAndFormat
pub struct HashAndFormat {
+HashAndFormat in iroh_blobs - Rust Struct iroh_blobs::HashAndFormat
source · pub struct HashAndFormat {
pub hash: Hash,
pub format: BlobFormat,
}
Expand description
A hash and format pair
Fields§
§hash: HashThe hash
§format: BlobFormatThe format
-Implementations§
§impl HashAndFormat
pub fn new(hash: Hash, format: BlobFormat) -> HashAndFormat
Create a new hash and format pair.
-pub fn raw(hash: Hash) -> HashAndFormat
Create a new hash and format pair, using the default (raw) format.
-pub fn hash_seq(hash: Hash) -> HashAndFormat
Create a new hash and format pair, using the collection format.
-Trait Implementations§
§impl Clone for HashAndFormat
§fn clone(&self) -> HashAndFormat
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more§impl Debug for HashAndFormat
§impl<'de> Deserialize<'de> for HashAndFormat
§fn deserialize<D>(
+
Implementations§
source§impl HashAndFormat
sourcepub fn new(hash: Hash, format: BlobFormat) -> HashAndFormat
Create a new hash and format pair.
+sourcepub fn raw(hash: Hash) -> HashAndFormat
Create a new hash and format pair, using the default (raw) format.
+sourcepub fn hash_seq(hash: Hash) -> HashAndFormat
Create a new hash and format pair, using the collection format.
+Trait Implementations§
source§impl Clone for HashAndFormat
source§fn clone(&self) -> HashAndFormat
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moresource§impl Debug for HashAndFormat
source§impl<'de> Deserialize<'de> for HashAndFormat
source§fn deserialize<D>(
deserializer: D
) -> Result<HashAndFormat, <D as Deserializer<'de>>::Error>where
- D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more§impl Display for HashAndFormat
source§impl From<DownloadKind> for HashAndFormat
source§fn from(value: DownloadKind) -> Self
Converts to this type from the input type.source§impl From<HashAndFormat> for DownloadKind
source§fn from(value: HashAndFormat) -> Self
Converts to this type from the input type.§impl FromStr for HashAndFormat
§impl Hash for HashAndFormat
§fn hash<__H>(&self, state: &mut __H)where
+ D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl Display for HashAndFormat
source§impl From<DownloadKind> for HashAndFormat
source§fn from(value: DownloadKind) -> Self
Converts to this type from the input type.source§impl From<HashAndFormat> for DownloadKind
source§fn from(value: HashAndFormat) -> Self
Converts to this type from the input type.source§impl FromStr for HashAndFormat
source§impl Hash for HashAndFormat
§impl MaxSize for HashAndFormat
§const POSTCARD_MAX_SIZE: usize = 33usize
The maximum possible size that the serialization of this
-type can have, in bytes.§impl Ord for HashAndFormat
source§impl MaxSize for HashAndFormat
source§const POSTCARD_MAX_SIZE: usize = 33usize
The maximum possible size that the serialization of this
+type can have, in bytes.source§impl Ord for HashAndFormat
source§fn cmp(&self, other: &HashAndFormat) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more§impl PartialEq for HashAndFormat
§fn eq(&self, other: &HashAndFormat) -> bool
Restrict a value to a certain interval. Read moresource§impl PartialEq for HashAndFormat
source§fn eq(&self, other: &HashAndFormat) -> bool
This method tests for self and other values to be equal, and is used
by ==.§impl PartialOrd for HashAndFormat
§fn partial_cmp(&self, other: &HashAndFormat) -> Option<Ordering>
source§impl PartialOrd for HashAndFormat
source§fn partial_cmp(&self, other: &HashAndFormat) -> Option<Ordering>
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 <=
operator. Read moresource§impl Serialize for HashAndFormat
source§fn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
- S: Serializer,
Serialize this value into the given Serde serializer. Read more§impl Value for HashAndFormat
§type SelfType<'a> = HashAndFormat
SelfType<’a> must be the same type as Self with all lifetimes replaced with ’a§type AsBytes<'a> = [u8; 33]
§fn fixed_width() -> Option<usize>
Width of a fixed type, or None for variable width§fn from_bytes<'a>(data: &'a [u8]) -> <HashAndFormat as Value>::SelfType<'a>where
+ S: Serializer,
Serialize this value into the given Serde serializer. Read moresource§impl Value for HashAndFormat
§type SelfType<'a> = HashAndFormat
SelfType<’a> must be the same type as Self with all lifetimes replaced with ’a§type AsBytes<'a> = [u8; 33]
source§fn fixed_width() -> Option<usize>
Width of a fixed type, or None for variable widthsource§fn from_bytes<'a>(data: &'a [u8]) -> <HashAndFormat as Value>::SelfType<'a>where
HashAndFormat: 'a,
Deserializes data
-Implementations may return a view over data, or an owned typesource§fn as_bytes<'a, 'b>(
value: &'a <HashAndFormat as Value>::SelfType<'b>
) -> <HashAndFormat as Value>::AsBytes<'a>where
'b: 'a,
- HashAndFormat: 'a + 'b,
Serialize the value to a slice§impl Copy for HashAndFormat
§impl Eq for HashAndFormat
§impl StructuralPartialEq for HashAndFormat
Auto Trait Implementations§
§impl Freeze for HashAndFormat
§impl RefUnwindSafe for HashAndFormat
§impl Send for HashAndFormat
§impl Sync for HashAndFormat
§impl Unpin for HashAndFormat
§impl UnwindSafe for HashAndFormat
Blanket Implementations§
source§impl<T> Any for Twhere
+ HashAndFormat: 'a + 'b,
Serialize the value to a slicesource§impl Copy for HashAndFormat
source§impl Eq for HashAndFormat
source§impl StructuralPartialEq for HashAndFormat
Auto Trait Implementations§
§impl Freeze for HashAndFormat
§impl RefUnwindSafe for HashAndFormat
§impl Send for HashAndFormat
§impl Sync for HashAndFormat
§impl Unpin for HashAndFormat
§impl UnwindSafe for HashAndFormat
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
diff --git a/pr/2595/docs/iroh_docs/actor/struct.SyncHandle.html b/pr/2595/docs/iroh_docs/actor/struct.SyncHandle.html
index cfd29c2ce8..6c70a0ff39 100644
--- a/pr/2595/docs/iroh_docs/actor/struct.SyncHandle.html
+++ b/pr/2595/docs/iroh_docs/actor/struct.SyncHandle.html
@@ -26,7 +26,7 @@ waiting for the actor to finish happens in an async context, and therefore that
namespace: NamespaceId,
author: AuthorId,
key: Bytes,
- hash: Hash,
+ hash: Hash,
len: u64
) -> Result<()>sourcepub async fn delete_prefix(
&self,
diff --git a/pr/2595/docs/iroh_docs/engine/enum.LiveEvent.html b/pr/2595/docs/iroh_docs/engine/enum.LiveEvent.html
index ceb8545b50..f0d33bcb21 100644
--- a/pr/2595/docs/iroh_docs/engine/enum.LiveEvent.html
+++ b/pr/2595/docs/iroh_docs/engine/enum.LiveEvent.html
@@ -3,34 +3,34 @@
entry: Entry,
},
InsertRemote {
- from: PublicKey,
+ from: PublicKey,
entry: Entry,
content_status: ContentStatus,
},
ContentReady {
- hash: Hash,
+ hash: Hash,
},
PendingContentReady,
- NeighborUp(PublicKey),
- NeighborDown(PublicKey),
+ NeighborUp(PublicKey),
+ NeighborDown(PublicKey),
SyncFinished(SyncEvent),
}Expand description
Events informing about actions of the live sync progress.
Variants§
§InsertLocal
A local insertion.
§InsertRemote
Received a remote insert.
-Fields
§from: PublicKeyThe peer that sent us the entry.
+Fields
§content_status: ContentStatusIf the content is available at the local node
§ContentReady
The content of an entry was downloaded and is now available at the local node
-Fields
§hash: HashThe content hash of the newly available entry content
+§PendingContentReady
All pending content is now ready.
This event signals that all queued content downloads from the last sync run have either
completed or failed.
It will only be emitted after a Self::SyncFinished event, never before.
Receiving this event does not guarantee that all content in the document is available. If
blobs failed to download, this event will still be emitted after all operations completed.
-§NeighborUp(PublicKey)
We have a new neighbor in the swarm.
-§NeighborDown(PublicKey)
We lost a neighbor in the swarm.
+§NeighborUp(PublicKey)
We have a new neighbor in the swarm.
+§NeighborDown(PublicKey)
We lost a neighbor in the swarm.
§SyncFinished(SyncEvent)
A set-reconciliation sync finished.
Trait Implementations§
source§impl<'de> Deserialize<'de> for LiveEvent
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl PartialEq for LiveEvent
source§fn eq(&self, other: &LiveEvent) -> bool
This method tests for self and other values to be equal, and is used
diff --git a/pr/2595/docs/iroh_docs/engine/fn.entry_to_content_status.html b/pr/2595/docs/iroh_docs/engine/fn.entry_to_content_status.html
index 459a6719d2..3b39df6428 100644
--- a/pr/2595/docs/iroh_docs/engine/fn.entry_to_content_status.html
+++ b/pr/2595/docs/iroh_docs/engine/fn.entry_to_content_status.html
@@ -1,2 +1,2 @@
-entry_to_content_status in iroh_docs::engine - Rust Function iroh_docs::engine::entry_to_content_status
source · pub fn entry_to_content_status(entry: Result<EntryStatus>) -> ContentStatus
Expand description
Converts an [EntryStatus] into a [‘ContentStatus’].
+entry_to_content_status in iroh_docs::engine - Rust Function iroh_docs::engine::entry_to_content_status
source · pub fn entry_to_content_status(entry: Result<EntryStatus>) -> ContentStatus
Expand description
Converts an EntryStatus into a [‘ContentStatus’].
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_docs/engine/index.html b/pr/2595/docs/iroh_docs/engine/index.html
index 5f78e23386..622ab4b871 100644
--- a/pr/2595/docs/iroh_docs/engine/index.html
+++ b/pr/2595/docs/iroh_docs/engine/index.html
@@ -1,4 +1,4 @@
iroh_docs::engine - Rust Expand description
Handlers and actors to for live syncing replicas.
crate::Replica is also called documents here.
Structs§
- Persistent default author for a docs engine.
- The sync engine coordinates actors that manage open documents, set-reconciliation syncs with
-peers and a gossip swarm for each syncing document.
- Event emitted when a sync operation completes
Enums§
- Where to persist the default author.
- Events informing about actions of the live sync progress.
- Why we performed a sync exchange
- Why we started a sync request
Functions§
- Converts an [
EntryStatus] into a [‘ContentStatus’].
\ No newline at end of file
+peers and a gossip swarm for each syncing document.Event emitted when a sync operation completes Enums§
- Where to persist the default author.
- Events informing about actions of the live sync progress.
- Why we performed a sync exchange
- Why we started a sync request
Functions§
- Converts an
EntryStatus into a [‘ContentStatus’].
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_docs/engine/struct.Engine.html b/pr/2595/docs/iroh_docs/engine/struct.Engine.html
index 1b88a96726..46cd25179e 100644
--- a/pr/2595/docs/iroh_docs/engine/struct.Engine.html
+++ b/pr/2595/docs/iroh_docs/engine/struct.Engine.html
@@ -8,12 +8,12 @@ peers and a gossip swarm for each syncing document.
Fields§
§endpoint: EndpointEndpoint used by the engine.
§sync: SyncHandleHandle to the actor thread.
The persistent default author for this engine.
-Implementations§
source§impl Engine
Implementations§
source§impl Engine
sourcepub async fn spawn<B: Store>(
endpoint: Endpoint,
- gossip: Gossip,
+ gossip: Gossip,
replica_store: Store,
bao_store: B,
- downloader: Downloader,
+ downloader: Downloader,
default_author_storage: DefaultAuthorStorage
) -> Result<Self>
Start the sync engine.
This will spawn two tokio tasks for the live sync coordination and gossip actors, and a
@@ -21,7 +21,7 @@ thread for the sourcepub async fn start_sync(
&self,
namespace: NamespaceId,
- peers: Vec<NodeAddr>
+ peers: Vec<NodeAddr>
) -> Result<()>
Start to sync a document.
If peers is non-empty, it will both do an initial set-reconciliation sync with each peer,
and join an iroh-gossip swarm with these peers to receive and broadcast document updates.
diff --git a/pr/2595/docs/iroh_docs/engine/struct.SyncEvent.html b/pr/2595/docs/iroh_docs/engine/struct.SyncEvent.html
index 49ba954022..d7eb730d81 100644
--- a/pr/2595/docs/iroh_docs/engine/struct.SyncEvent.html
+++ b/pr/2595/docs/iroh_docs/engine/struct.SyncEvent.html
@@ -1,11 +1,11 @@
SyncEvent in iroh_docs::engine - Rust pub struct SyncEvent {
- pub peer: PublicKey,
+ pub peer: PublicKey,
pub origin: Origin,
pub finished: SystemTime,
pub started: SystemTime,
pub result: Result<SyncDetails, String>,
}
Expand description
Event emitted when a sync operation completes
-Fields§
§peer: PublicKeyPeer we synced with
+Fields§
§peer: PublicKeyPeer we synced with
§origin: OriginOrigin of the sync exchange
§finished: SystemTimeTimestamp when the sync started
§started: SystemTimeTimestamp when the sync finished
diff --git a/pr/2595/docs/iroh_docs/index.html b/pr/2595/docs/iroh_docs/index.html
index a37d30e2a6..41c792c5e5 100644
--- a/pr/2595/docs/iroh_docs/index.html
+++ b/pr/2595/docs/iroh_docs/index.html
@@ -1,7 +1,7 @@
iroh_docs - Rust Expand description
Multi-dimensional key-value documents with an efficient synchronization protocol
The crate operates on Replicas. A replica contains an unlimited number of
Entries. Each entry is identified by a key, its author, and the replica’s
-namespace. Its value is the 32-byte BLAKE3 hash
+namespace. Its value is the 32-byte BLAKE3 hash
of the entry’s content data, the size of this content data, and a timestamp.
The content data itself is not stored or transferred through a replica.
All entries in a replica are signed with two keypairs:
diff --git a/pr/2595/docs/iroh_docs/net/enum.AcceptError.html b/pr/2595/docs/iroh_docs/net/enum.AcceptError.html
index 87e9a07ad3..cf11b5b695 100644
--- a/pr/2595/docs/iroh_docs/net/enum.AcceptError.html
+++ b/pr/2595/docs/iroh_docs/net/enum.AcceptError.html
@@ -3,31 +3,31 @@
error: Error,
},
Open {
- peer: PublicKey,
+ peer: PublicKey,
error: Error,
},
Abort {
- peer: PublicKey,
+ peer: PublicKey,
namespace: NamespaceId,
reason: AbortReason,
},
Sync {
- peer: PublicKey,
+ peer: PublicKey,
namespace: Option<NamespaceId>,
error: Error,
},
Close {
- peer: PublicKey,
+ peer: PublicKey,
namespace: Option<NamespaceId>,
error: Error,
},
}Expand description
Errors that may occur on handling incoming sync connections.
Variants§
§Connect
Failed to establish connection
§Open
Failed to open replica
-§Abort
We aborted the sync request.
-§Sync
Failed to run sync
-§Close
Failed to close
-Implementations§
source§impl AcceptError
Implementations§
Trait Implementations§
source§impl Debug for AcceptError
source§impl Display for AcceptError
source§impl Error for AcceptError
source§fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more1.0.0 · source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()Auto Trait Implementations§
§impl Freeze for AcceptError
§impl RefUnwindSafe for AcceptError
§impl Send for AcceptError
§impl Sync for AcceptError
§impl Unpin for AcceptError
§impl UnwindSafe for AcceptError
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
diff --git a/pr/2595/docs/iroh_docs/net/fn.connect_and_sync.html b/pr/2595/docs/iroh_docs/net/fn.connect_and_sync.html
index 1ee6909d53..7bec313309 100644
--- a/pr/2595/docs/iroh_docs/net/fn.connect_and_sync.html
+++ b/pr/2595/docs/iroh_docs/net/fn.connect_and_sync.html
@@ -2,6 +2,6 @@
endpoint: &Endpoint,
sync: &SyncHandle,
namespace: NamespaceId,
- peer: NodeAddr
+ peer: NodeAddr
) -> Result<SyncFinished, ConnectError>Expand description
Connect to a peer and sync a replica
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_docs/net/fn.handle_connection.html b/pr/2595/docs/iroh_docs/net/fn.handle_connection.html
index 347a0c22bf..e96816b362 100644
--- a/pr/2595/docs/iroh_docs/net/fn.handle_connection.html
+++ b/pr/2595/docs/iroh_docs/net/fn.handle_connection.html
@@ -3,6 +3,6 @@
connecting: Connecting,
accept_cb: F
) -> Result<SyncFinished, AcceptError>where
- F: Fn(NamespaceId, PublicKey) -> Fut,
+ F: Fn(NamespaceId, PublicKey) -> Fut,
Fut: Future<Output = AcceptOutcome>,Expand description
Handle an iroh-docs connection and sync all shared documents in the replica store.
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_docs/net/struct.SyncFinished.html b/pr/2595/docs/iroh_docs/net/struct.SyncFinished.html
index 74ab2f6632..dcd549e6fc 100644
--- a/pr/2595/docs/iroh_docs/net/struct.SyncFinished.html
+++ b/pr/2595/docs/iroh_docs/net/struct.SyncFinished.html
@@ -1,11 +1,11 @@
SyncFinished in iroh_docs::net - Rust Struct iroh_docs::net::SyncFinished
source · pub struct SyncFinished {
pub namespace: NamespaceId,
- pub peer: PublicKey,
+ pub peer: PublicKey,
pub outcome: SyncOutcome,
pub timings: Timings,
}
Expand description
Details of a finished sync operation.
Fields§
§namespace: NamespaceIdThe namespace that was synced.
-§peer: PublicKeyThe peer we syned with.
+§peer: PublicKeyThe peer we syned with.
§outcome: SyncOutcomeThe outcome of the sync operation
§timings: TimingsThe time this operation took
Trait Implementations§
source§impl Clone for SyncFinished
source§fn clone(&self) -> SyncFinished
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moreAuto Trait Implementations§
§impl Freeze for SyncFinished
§impl RefUnwindSafe for SyncFinished
§impl Send for SyncFinished
§impl Sync for SyncFinished
§impl Unpin for SyncFinished
§impl UnwindSafe for SyncFinished
Blanket Implementations§
source§impl<T> Any for Twhere
diff --git a/pr/2595/docs/iroh_docs/store/fs/struct.ContentHashesIterator.html b/pr/2595/docs/iroh_docs/store/fs/struct.ContentHashesIterator.html
index 8bebf68ec6..df1fc8865f 100644
--- a/pr/2595/docs/iroh_docs/store/fs/struct.ContentHashesIterator.html
+++ b/pr/2595/docs/iroh_docs/store/fs/struct.ContentHashesIterator.html
@@ -6,7 +6,7 @@ It needs a copy of a redb::ReadOnlyTable to be self-contained.
Implementations§
Trait Implementations§
source§impl Debug for ContentHashesIterator
Trait Implementations§
source§impl Debug for ContentHashesIterator
source§impl Iterator for ContentHashesIterator
source§fn next(&mut self) -> Option<Self::Item>
Advances the iterator and returns the next value. Read moresource§fn next_chunk<const N: usize>(
&mut self
) -> Result<[Self::Item; N], IntoIter<Self::Item, N>>where
Self: Sized,
🔬This is a nightly-only experimental API. (iter_next_chunk)Advances the iterator and returns an array containing the next N values. Read more1.0.0 · source§fn size_hint(&self) -> (usize, Option<usize>)
Returns the bounds on the remaining length of the iterator. Read more1.0.0 · source§fn count(self) -> usizewhere
diff --git a/pr/2595/docs/iroh_docs/struct.AuthorId.html b/pr/2595/docs/iroh_docs/struct.AuthorId.html
index 7dfa3dea5b..02221b0eb6 100644
--- a/pr/2595/docs/iroh_docs/struct.AuthorId.html
+++ b/pr/2595/docs/iroh_docs/struct.AuthorId.html
@@ -156,6 +156,6 @@ letters are used (e.g. F9B4CA)
Into<Dispatch>, source§fn with_current_subscriber(self) -> WithDispatch<Self>
source§impl<T> DeserializeOwned for Twhere
- T: for<'de> Deserialize<'de>,
§impl<T> PeerIdentity for Twhere
+ T: for<'de> Deserialize<'de>,
source§impl<T> PeerIdentity for T
source§impl<T> RuleType for T
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_docs/struct.AuthorPublicKey.html b/pr/2595/docs/iroh_docs/struct.AuthorPublicKey.html
index 8e72b11c8a..7a83ce68e4 100644
--- a/pr/2595/docs/iroh_docs/struct.AuthorPublicKey.html
+++ b/pr/2595/docs/iroh_docs/struct.AuthorPublicKey.html
@@ -148,6 +148,6 @@ builds. Into<Dispatch>,source§fn with_current_subscriber(self) -> WithDispatch<Self>
source§impl<T> DeserializeOwned for Twhere
- T: for<'de> Deserialize<'de>,
§impl<T> PeerIdentity for Twhere
+ T: for<'de> Deserialize<'de>,
source§impl<T> PeerIdentity for T
source§impl<T> RuleType for T
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_docs/struct.DocTicket.html b/pr/2595/docs/iroh_docs/struct.DocTicket.html
index d53a93c4c4..fd1bb5eb02 100644
--- a/pr/2595/docs/iroh_docs/struct.DocTicket.html
+++ b/pr/2595/docs/iroh_docs/struct.DocTicket.html
@@ -1,13 +1,13 @@
DocTicket in iroh_docs - Rust pub struct DocTicket {
pub capability: Capability,
- pub nodes: Vec<NodeAddr>,
+ pub nodes: Vec<NodeAddr>,
}
Expand description
Contains both a key (either secret or public) to a document, and a list of peers to join.
Fields§
§capability: Capabilityeither a public or private key
-§nodes: Vec<NodeAddr>A list of nodes to contact.
-Implementations§
source§impl DocTicket
sourcepub fn new(capability: Capability, peers: Vec<NodeAddr>) -> Self
Create a new doc ticket
+§nodes: Vec<NodeAddr>A list of nodes to contact.
+Implementations§
Trait Implementations§
source§impl<'de> Deserialize<'de> for DocTicket
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
- __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreAuto Trait Implementations§
§impl Freeze for DocTicket
§impl RefUnwindSafe for DocTicket
§impl Send for DocTicket
§impl Sync for DocTicket
§impl Unpin for DocTicket
§impl UnwindSafe for DocTicket
Blanket Implementations§
source§impl<T> Any for Twhere
+ __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreAuto Trait Implementations§
§impl Freeze for DocTicket
§impl RefUnwindSafe for DocTicket
§impl Send for DocTicket
§impl Sync for DocTicket
§impl Unpin for DocTicket
§impl UnwindSafe for DocTicket
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
diff --git a/pr/2595/docs/iroh_docs/struct.NamespaceId.html b/pr/2595/docs/iroh_docs/struct.NamespaceId.html
index 433d51afc6..f9acda8e94 100644
--- a/pr/2595/docs/iroh_docs/struct.NamespaceId.html
+++ b/pr/2595/docs/iroh_docs/struct.NamespaceId.html
@@ -156,6 +156,6 @@ letters are used (e.g. F9B4CA)
Into<Dispatch>, source§fn with_current_subscriber(self) -> WithDispatch<Self>
source§impl<T> DeserializeOwned for Twhere
- T: for<'de> Deserialize<'de>,
§impl<T> PeerIdentity for Twhere
+ T: for<'de> Deserialize<'de>,
source§impl<T> PeerIdentity for T
source§impl<T> RuleType for T
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_docs/struct.NamespacePublicKey.html b/pr/2595/docs/iroh_docs/struct.NamespacePublicKey.html
index 350dea9049..72b75ed510 100644
--- a/pr/2595/docs/iroh_docs/struct.NamespacePublicKey.html
+++ b/pr/2595/docs/iroh_docs/struct.NamespacePublicKey.html
@@ -147,6 +147,6 @@ builds.Into<Dispatch>,source§fn with_current_subscriber(self) -> WithDispatch<Self>
source§impl<T> DeserializeOwned for Twhere
- T: for<'de> Deserialize<'de>,
§impl<T> PeerIdentity for Twhere
+ T: for<'de> Deserialize<'de>,
source§impl<T> PeerIdentity for T
source§impl<T> RuleType for T
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_docs/sync/struct.Entry.html b/pr/2595/docs/iroh_docs/sync/struct.Entry.html
index 55bf06044f..055a4b6f54 100644
--- a/pr/2595/docs/iroh_docs/sync/struct.Entry.html
+++ b/pr/2595/docs/iroh_docs/sync/struct.Entry.html
@@ -1,6 +1,6 @@
Entry in iroh_docs::sync - Rust pub struct Entry { /* private fields */ }
Expand description
A single entry in a Replica
An entry is identified by a key, its Author, and the Replica’s
-NamespaceSecret. Its value is the 32-byte BLAKE3 hash
+NamespaceSecret. Its value is the 32-byte BLAKE3 hash
of the entry’s content data, the size of this content data, and a timestamp.
Implementations§
source§impl Entry
sourcepub fn new(id: RecordIdentifier, record: Record) -> Self
Create a new entry
sourcepub fn new_empty(id: RecordIdentifier) -> Self
Create a new empty entry with the current timestamp.
@@ -15,7 +15,7 @@ of the entry’s content data, the size of this content data, and a timestamp.
sourcepub fn sign(self, namespace: &NamespaceSecret, author: &Author) -> SignedEntry
Sign this entry with a NamespaceSecret and Author.
Methods from Deref<Target = Record>§
sourcepub fn content_len(&self) -> u64
Get the length of the data addressed by this record’s content hash.
-sourcepub fn content_hash(&self) -> Hash
Get the [struct@Hash] of the content data of this record.
+sourcepub fn content_hash(&self) -> Hash
Get the Hash of the content data of this record.
Trait Implementations§
source§impl<'de> Deserialize<'de> for Entry
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl From<SignedEntry> for Entry
source§fn from(value: SignedEntry) -> Self
Converts to this type from the input type.source§impl Ord for Entry
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
diff --git a/pr/2595/docs/iroh_docs/sync/struct.Record.html b/pr/2595/docs/iroh_docs/sync/struct.Record.html
index 94479a973e..f06cccab52 100644
--- a/pr/2595/docs/iroh_docs/sync/struct.Record.html
+++ b/pr/2595/docs/iroh_docs/sync/struct.Record.html
@@ -1,11 +1,11 @@
Record in iroh_docs::sync - Rust pub struct Record { /* private fields */ }
Expand description
The data part of an entry in a Replica.
-Implementations§
source§impl Record
Implementations§
source§impl Record
sourcepub fn empty_current() -> Self
Create a tombstone record with the timestamp set to now.
sourcepub fn new_current(hash: Hash, len: u64) -> Self
Create a new Record with the timestamp set to now.
+sourcepub fn new_current(hash: Hash, len: u64) -> Self
Create a new Record with the timestamp set to now.
sourcepub fn content_len(&self) -> u64
Get the length of the data addressed by this record’s content hash.
-sourcepub fn content_hash(&self) -> Hash
Get the [struct@Hash] of the content data of this record.
+sourcepub fn content_hash(&self) -> Hash
Get the Hash of the content data of this record.
Trait Implementations§
source§impl<'de> Deserialize<'de> for Record
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl Ord for Record
Ordering for entry values.
diff --git a/pr/2595/docs/iroh_docs/sync/struct.Replica.html b/pr/2595/docs/iroh_docs/sync/struct.Replica.html
index 23a9798651..c4e161f3c3 100644
--- a/pr/2595/docs/iroh_docs/sync/struct.Replica.html
+++ b/pr/2595/docs/iroh_docs/sync/struct.Replica.html
@@ -5,7 +5,7 @@
&mut self,
key: impl AsRef<[u8]>,
author: &Author,
- hash: Hash,
+ hash: Hash,
len: u64
) -> Result<usize, InsertError>Insert a new record at the given key.
The entry will by signed by the provided author.
@@ -35,7 +35,7 @@ or an error if the entry failed to validate or if a store operation failed.
key: impl AsRef<[u8]>,
author: &Author,
data: impl AsRef<[u8]>
-) -> Result<Hash, InsertError>Hashes the given data and inserts it.
+) -> Result<Hash, InsertError>Hashes the given data and inserts it.
This does not store the content, just the record of it.
Returns the calculated hash.
sourcepub fn record_id(
diff --git a/pr/2595/docs/iroh_docs/sync/struct.SignedEntry.html b/pr/2595/docs/iroh_docs/sync/struct.SignedEntry.html
index 21644eacb1..9ef5e98134 100644
--- a/pr/2595/docs/iroh_docs/sync/struct.SignedEntry.html
+++ b/pr/2595/docs/iroh_docs/sync/struct.SignedEntry.html
@@ -14,7 +14,7 @@
sourcepub fn signature(&self) -> &EntrySignature
Get the signature.
sourcepub fn validate_empty(&self) -> Result<(), ValidationFailure>
Validate that the entry has the empty hash if the length is 0, or a non-zero length.
sourcepub fn content_hash(&self) -> Hash
Get the content [struct@Hash] of the entry.
+sourcepub fn content_hash(&self) -> Hash
Get the content Hash of the entry.
sourcepub fn content_len(&self) -> u64
Get the content length of the entry.
Get the author bytes of this entry.
Methods from Deref<Target = Record>§
sourcepub fn content_len(&self) -> u64
Get the length of the data addressed by this record’s content hash.
-sourcepub fn content_hash(&self) -> Hash
Get the [struct@Hash] of the content data of this record.
+sourcepub fn content_hash(&self) -> Hash
Get the Hash of the content data of this record.
Trait Implementations§
source§impl Clone for SignedEntry
source§fn clone(&self) -> SignedEntry
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moresource§impl Debug for SignedEntry
source§impl Deref for SignedEntry
source§impl<'de> Deserialize<'de> for SignedEntry
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl From<SignedEntry> for Entry
source§fn from(value: SignedEntry) -> Self
Converts to this type from the input type.source§impl Ord for SignedEntry
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
diff --git a/pr/2595/docs/iroh_docs/sync/type.ContentStatusCallback.html b/pr/2595/docs/iroh_docs/sync/type.ContentStatusCallback.html
index 46d5a5a49c..84ffdbe8ee 100644
--- a/pr/2595/docs/iroh_docs/sync/type.ContentStatusCallback.html
+++ b/pr/2595/docs/iroh_docs/sync/type.ContentStatusCallback.html
@@ -1,2 +1,2 @@
-ContentStatusCallback in iroh_docs::sync - Rust Type Alias iroh_docs::sync::ContentStatusCallback
source · pub type ContentStatusCallback = Arc<dyn Fn(Hash) -> ContentStatus + Send + Sync + 'static>;
Expand description
Callback that may be set on a replica to determine the availability status for a content hash.
+ContentStatusCallback in iroh_docs::sync - Rust Type Alias iroh_docs::sync::ContentStatusCallback
source · pub type ContentStatusCallback = Arc<dyn Fn(Hash) -> ContentStatus + Send + Sync + 'static>;
Expand description
Callback that may be set on a replica to determine the availability status for a content hash.
Aliased Type§
struct ContentStatusCallback { /* private fields */ }
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_net/discovery/dns/index.html b/pr/2595/docs/iroh_net/discovery/dns/index.html
index 5a80538422..a752b49d78 100644
--- a/pr/2595/docs/iroh_net/discovery/dns/index.html
+++ b/pr/2595/docs/iroh_net/discovery/dns/index.html
@@ -1,2 +1,2 @@
-iroh_net::discovery::dns - Rust Expand description
DNS node discovery for iroh-net
+iroh_net::discovery::dns - Rust Expand description
DNS node discovery for iroh-net
Structs§
- DNS node discovery
Constants§
- The n0 testing DNS node origin, for production.
- The n0 testing DNS node origin, for testing.
- Testing DNS node origin, must run server from
crate::test_utils::DnsPkarrServer.
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_net/discovery/dns/struct.DnsDiscovery.html b/pr/2595/docs/iroh_net/discovery/dns/struct.DnsDiscovery.html
index 3e7d5d71cc..7628fb45a9 100644
--- a/pr/2595/docs/iroh_net/discovery/dns/struct.DnsDiscovery.html
+++ b/pr/2595/docs/iroh_net/discovery/dns/struct.DnsDiscovery.html
@@ -28,7 +28,7 @@ custom discovery mechanism.
For testing it is also possible to use the N0_DNS_NODE_ORIGIN_STAGING domain
with DnsDiscovery::new. This would then use a hosted discovery service again,
but for testing purposes.
-Trait Implementations§
Trait Implementations§
source§impl Debug for DnsDiscovery
source§impl Discovery for DnsDiscovery
source§fn resolve(
&self,
ep: Endpoint,
node_id: NodeId
diff --git a/pr/2595/docs/iroh_net/discovery/trait.Discovery.html b/pr/2595/docs/iroh_net/discovery/trait.Discovery.html
index a53a618708..d3832a56b5 100644
--- a/pr/2595/docs/iroh_net/discovery/trait.Discovery.html
+++ b/pr/2595/docs/iroh_net/discovery/trait.Discovery.html
@@ -29,4 +29,4 @@ These tasks will be run on the runtime of the Option<BoxStream<Result<DiscoveryItem>>>
Implementors§
source§impl Discovery for DnsDiscovery
source§impl Discovery for LocalSwarmDiscovery
source§impl Discovery for PkarrPublisher
source§impl Discovery for PkarrResolver
source§impl Discovery for ConcurrentDiscovery
\ No newline at end of file
+
Implementors§
source§impl Discovery for DnsDiscovery
source§impl Discovery for LocalSwarmDiscovery
source§impl Discovery for PkarrPublisher
source§impl Discovery for PkarrResolver
source§impl Discovery for ConcurrentDiscovery
\ No newline at end of file
diff --git a/pr/2595/docs/src/iroh_net/discovery/dns.rs.html b/pr/2595/docs/src/iroh_net/discovery/dns.rs.html
index dd1a279fb3..1d32545ed3 100644
--- a/pr/2595/docs/src/iroh_net/discovery/dns.rs.html
+++ b/pr/2595/docs/src/iroh_net/discovery/dns.rs.html
@@ -97,6 +97,10 @@
97
98
99
+100
+101
+102
+103
//! DNS node discovery for iroh-net
use anyhow::Result;
@@ -182,6 +186,10 @@
fn resolve(&self, ep: Endpoint, node_id: NodeId) -> Option<BoxStream<Result<DiscoveryItem>>> {
let resolver = ep.dns_resolver().clone();
let origin_domain = self.origin_domain.clone();
+ #[cfg(any(test, feature = "test-utils"))]
+ if origin_domain.contains(&TEST_DNS_NODE_ORIGIN.to_string()) {
+ panic!("wait. THIS IS ILLEGAL!");
+ }
let fut = async move {
let node_addr = resolver
.lookup_by_id_staggered(&node_id, &origin_domain, DNS_STAGGERING_MS)
diff --git a/pr/2595/docs/trait.impl/iroh_base/ticket/trait.Ticket.js b/pr/2595/docs/trait.impl/iroh_base/ticket/trait.Ticket.js
index 12fa1e3ee5..5d209fabd2 100644
--- a/pr/2595/docs/trait.impl/iroh_base/ticket/trait.Ticket.js
+++ b/pr/2595/docs/trait.impl/iroh_base/ticket/trait.Ticket.js
@@ -1,5 +1,5 @@
(function() {var implementors = {
"iroh":[],
"iroh_base":[],
-"iroh_docs":[["impl Ticket for DocTicket"]]
+"iroh_docs":[["impl Ticket for DocTicket"]]
};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
diff --git a/pr/2595/docs/type.impl/std/primitive.array.js b/pr/2595/docs/type.impl/std/primitive.array.js
index 588a8b53a3..3006964922 100644
--- a/pr/2595/docs/type.impl/std/primitive.array.js
+++ b/pr/2595/docs/type.impl/std/primitive.array.js
@@ -1,4 +1,4 @@
(function() {var type_impls = {
"iroh":[["source§impl<T, const N: usize> [T; N]
1.55.0 · sourcepub fn map<F, U>(self, f: F) -> [U; N]where\n F: FnMut(T) -> U,
Returns an array of the same size as self, with function f applied to each element\nin order.
\nIf you don’t necessarily need a new fixed-size array, consider using\nIterator::map instead.
\n§Note on performance and stack usage
\nUnfortunately, usages of this method are currently not always optimized\nas well as they could be. This mainly concerns large arrays, as mapping\nover small arrays seem to be optimized just fine. Also note that in\ndebug mode (i.e. without any optimizations), this method can use a lot\nof stack space (a few times the size of the array or more).
\nTherefore, in performance-critical code, try to avoid using this method\non large arrays or check the emitted code. Also try to avoid chained\nmaps (e.g. arr.map(...).map(...)).
\nIn many cases, you can instead use Iterator::map by calling .iter()\nor .into_iter() on your array. [T; N]::map is only necessary if you\nreally need a new array of the same size as the result. Rust’s lazy\niterators tend to get optimized very well.
\n§Examples
\nlet x = [1, 2, 3];\nlet y = x.map(|v| v + 1);\nassert_eq!(y, [2, 3, 4]);\n\nlet x = [1, 2, 3];\nlet mut temp = 0;\nlet y = x.map(|v| { temp += 1; v * temp });\nassert_eq!(y, [1, 4, 9]);\n\nlet x = [\"Ferris\", \"Bueller's\", \"Day\", \"Off\"];\nlet y = x.map(|v| v.len());\nassert_eq!(y, [6, 9, 3, 3]);
\nsourcepub fn try_map<F, R>(\n self,\n f: F\n) -> <<R as Try>::Residual as Residual<[<R as Try>::Output; N]>>::TryType
🔬This is a nightly-only experimental API. (array_try_map)
A fallible function f applied to each element on array self in order to\nreturn an array the same size as self or the first error encountered.
\nThe return type of this function depends on the return type of the closure.\nIf you return Result<T, E> from the closure, you’ll get a Result<[T; N], E>.\nIf you return Option<T> from the closure, you’ll get an Option<[T; N]>.
\n§Examples
\n#![feature(array_try_map)]\n\nlet a = [\"1\", \"2\", \"3\"];\nlet b = a.try_map(|v| v.parse::<u32>()).unwrap().map(|v| v + 1);\nassert_eq!(b, [2, 3, 4]);\n\nlet a = [\"1\", \"2a\", \"3\"];\nlet b = a.try_map(|v| v.parse::<u32>());\nassert!(b.is_err());\n\nuse std::num::NonZero;\n\nlet z = [1, 2, 0, 3, 4];\nassert_eq!(z.try_map(NonZero::new), None);\n\nlet a = [1, 2, 3];\nlet b = a.try_map(NonZero::new);\nlet c = b.map(|x| x.map(NonZero::get));\nassert_eq!(c, Some(a));
\n1.57.0 (const: 1.57.0) · sourcepub const fn as_slice(&self) -> &[T]
Returns a slice containing the entire array. Equivalent to &s[..].
\n1.57.0 · sourcepub fn as_mut_slice(&mut self) -> &mut [T]
Returns a mutable slice containing the entire array. Equivalent to\n&mut s[..].
\n1.77.0 · sourcepub fn each_ref(&self) -> [&T; N]
Borrows each element and returns an array of references with the same\nsize as self.
\n§Example
\nlet floats = [3.1, 2.7, -1.0];\nlet float_refs: [&f64; 3] = floats.each_ref();\nassert_eq!(float_refs, [&3.1, &2.7, &-1.0]);
\nThis method is particularly useful if combined with other methods, like\nmap. This way, you can avoid moving the original\narray if its elements are not Copy.
\n\nlet strings = [\"Ferris\".to_string(), \"♥\".to_string(), \"Rust\".to_string()];\nlet is_ascii = strings.each_ref().map(|s| s.is_ascii());\nassert_eq!(is_ascii, [true, false, true]);\n\n// We can still access the original array: it has not been moved.\nassert_eq!(strings.len(), 3);
\n1.77.0 · sourcepub fn each_mut(&mut self) -> [&mut T; N]
Borrows each element mutably and returns an array of mutable references\nwith the same size as self.
\n§Example
\n\nlet mut floats = [3.1, 2.7, -1.0];\nlet float_refs: [&mut f64; 3] = floats.each_mut();\n*float_refs[0] = 0.0;\nassert_eq!(float_refs, [&mut 0.0, &mut 2.7, &mut -1.0]);\nassert_eq!(floats, [0.0, 2.7, -1.0]);
\nsourcepub fn split_array_ref<const M: usize>(&self) -> (&[T; M], &[T])
🔬This is a nightly-only experimental API. (split_array)
Divides one array reference into two at an index.
\nThe first will contain all indices from [0, M) (excluding\nthe index M itself) and the second will contain all\nindices from [M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet v = [1, 2, 3, 4, 5, 6];\n\n{\n let (left, right) = v.split_array_ref::<0>();\n assert_eq!(left, &[]);\n assert_eq!(right, &[1, 2, 3, 4, 5, 6]);\n}\n\n{\n let (left, right) = v.split_array_ref::<2>();\n assert_eq!(left, &[1, 2]);\n assert_eq!(right, &[3, 4, 5, 6]);\n}\n\n{\n let (left, right) = v.split_array_ref::<6>();\n assert_eq!(left, &[1, 2, 3, 4, 5, 6]);\n assert_eq!(right, &[]);\n}
\nsourcepub fn split_array_mut<const M: usize>(&mut self) -> (&mut [T; M], &mut [T])
🔬This is a nightly-only experimental API. (split_array)
Divides one mutable array reference into two at an index.
\nThe first will contain all indices from [0, M) (excluding\nthe index M itself) and the second will contain all\nindices from [M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet mut v = [1, 0, 3, 0, 5, 6];\nlet (left, right) = v.split_array_mut::<2>();\nassert_eq!(left, &mut [1, 0][..]);\nassert_eq!(right, &mut [3, 0, 5, 6]);\nleft[1] = 2;\nright[1] = 4;\nassert_eq!(v, [1, 2, 3, 4, 5, 6]);
\nsourcepub fn rsplit_array_ref<const M: usize>(&self) -> (&[T], &[T; M])
🔬This is a nightly-only experimental API. (split_array)
Divides one array reference into two at an index from the end.
\nThe first will contain all indices from [0, N - M) (excluding\nthe index N - M itself) and the second will contain all\nindices from [N - M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet v = [1, 2, 3, 4, 5, 6];\n\n{\n let (left, right) = v.rsplit_array_ref::<0>();\n assert_eq!(left, &[1, 2, 3, 4, 5, 6]);\n assert_eq!(right, &[]);\n}\n\n{\n let (left, right) = v.rsplit_array_ref::<2>();\n assert_eq!(left, &[1, 2, 3, 4]);\n assert_eq!(right, &[5, 6]);\n}\n\n{\n let (left, right) = v.rsplit_array_ref::<6>();\n assert_eq!(left, &[]);\n assert_eq!(right, &[1, 2, 3, 4, 5, 6]);\n}
\nsourcepub fn rsplit_array_mut<const M: usize>(&mut self) -> (&mut [T], &mut [T; M])
🔬This is a nightly-only experimental API. (split_array)
Divides one mutable array reference into two at an index from the end.
\nThe first will contain all indices from [0, N - M) (excluding\nthe index N - M itself) and the second will contain all\nindices from [N - M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet mut v = [1, 0, 3, 0, 5, 6];\nlet (left, right) = v.rsplit_array_mut::<4>();\nassert_eq!(left, &mut [1, 0]);\nassert_eq!(right, &mut [3, 0, 5, 6][..]);\nleft[1] = 2;\nright[1] = 4;\nassert_eq!(v, [1, 2, 3, 4, 5, 6]);
\n",0,"iroh::docs::PeerIdBytes"],["source§impl<const N: usize> [u8; N]
sourcepub const fn as_ascii(&self) -> Option<&[AsciiChar; N]>
🔬This is a nightly-only experimental API. (ascii_char)
Converts this array of bytes into a array of ASCII characters,\nor returns None if any of the characters is non-ASCII.
\n§Examples
\n#![feature(ascii_char)]\n#![feature(const_option)]\n\nconst HEX_DIGITS: [std::ascii::Char; 16] =\n *b\"0123456789abcdef\".as_ascii().unwrap();\n\nassert_eq!(HEX_DIGITS[1].as_str(), \"1\");\nassert_eq!(HEX_DIGITS[10].as_str(), \"a\");
\nsourcepub const unsafe fn as_ascii_unchecked(&self) -> &[AsciiChar; N]
🔬This is a nightly-only experimental API. (ascii_char)
Converts this array of bytes into a array of ASCII characters,\nwithout checking whether they’re valid.
\n§Safety
\nEvery byte in the array must be in 0..=127, or else this is UB.
\n",0,"iroh::docs::PeerIdBytes"],["§impl<T> Array for [T; 32]where\n T: Default,
§fn as_slice_mut(&mut self) -> &mut [T]
Gives a unique slice over the whole thing. Read more","Array","iroh::docs::PeerIdBytes"],["","Array","iroh::docs::PeerIdBytes"],["§impl<const N: usize, T> AsBytes for [T; N]where\n T: AsBytes,
§fn write_to_prefix(&self, bytes: &mut [u8]) -> Option<()>
","AsBytes","iroh::docs::PeerIdBytes"],["","AsBytes","iroh::docs::PeerIdBytes"],["","AsMut<[T]>","iroh::docs::PeerIdBytes"],["","AsRef<[T]>","iroh::docs::PeerIdBytes"],["§impl<T, const N: usize> BitView for [T; N]where\n T: BitStore,
Note that overly-large arrays may cause the conversions to fail.
\n§fn view_bits<O>(&self) -> &BitSlice<T, O>where\n O: BitOrder,
Views a memory region as an immutable bit-slice.§fn try_view_bits<O>(&self) -> Result<&BitSlice<T, O>, BitSpanError<T>>where\n O: BitOrder,
Attempts to view a memory region as an immutable bit-slice. Read more§fn view_bits_mut<O>(&mut self) -> &mut BitSlice<T, O>where\n O: BitOrder,
Views a memory region as a mutable bit-slice.§fn try_view_bits_mut<O>(\n &mut self\n) -> Result<&mut BitSlice<T, O>, BitSpanError<T>>where\n O: BitOrder,
Attempts to view a memory region as a mutable bit-slice. Read more","BitView","iroh::docs::PeerIdBytes"],["§impl<T, const N: usize> BitViewSized for [T; N]where\n T: BitStore,
§fn as_raw_slice(&self) -> &[<[T; N] as BitView>::Store]
Views the type as a slice of its elements.§fn as_raw_mut_slice(&mut self) -> &mut [<[T; N] as BitView>::Store]
Views the type as a mutable slice of its elements.§fn into_bitarray<O>(self) -> BitArray<Self, O>where\n O: BitOrder,
Wraps self in a BitArray.","BitViewSized","iroh::docs::PeerIdBytes"],["","Borrow<[T]>","iroh::docs::PeerIdBytes"],["1.4.0 · source§impl<T, const N: usize> BorrowMut<[T]> for [T; N]
source§fn borrow_mut(&mut self) -> &mut [T]
Mutably borrows from an owned value. Read more","BorrowMut<[T]>","iroh::docs::PeerIdBytes"],["","Chain","iroh::docs::PeerIdBytes"],["","Clone","iroh::docs::PeerIdBytes"],["","Debug","iroh::docs::PeerIdBytes"],["§impl<const N: usize> Decode for [u8; N]
Decodes a byte array from byte[n] as described in RFC4251 § 5:
\n\nA byte represents an arbitrary 8-bit value (octet). Fixed length\ndata is sometimes represented as an array of bytes, written\nbyte[n], where n is the number of bytes in the array.
\n
\n","Decode","iroh::docs::PeerIdBytes"],["§impl<'a, T, const N: usize> DecodeValue<'a> for [T; N]where\n T: Decode<'a>,
§fn decode_value<R>(reader: &mut R, header: Header) -> Result<[T; N], Error>where\n R: Reader<'a>,
Attempt to decode this message using the provided [Reader].","DecodeValue<'a>","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["source§impl<'de, T> Deserialize<'de> for [T; 32]where\n T: Deserialize<'de>,
source§fn deserialize<D>(\n deserializer: D\n) -> Result<[T; 32], <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more","Deserialize<'de>","iroh::docs::PeerIdBytes"],["source§impl<'de, const N: usize> Deserialize<'de> for [u8; N]
source§fn deserialize<D>(\n deserializer: D\n) -> Result<[u8; N], <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
","Deserialize<'de>","iroh::docs::PeerIdBytes"],["§impl<const N: usize> Encode for [u8; N]
Encodes [u8; N] into byte[n] as described in RFC4251 § 5:
\n\nA byte represents an arbitrary 8-bit value (octet). Fixed length\ndata is sometimes represented as an array of bytes, written\nbyte[n], where n is the number of bytes in the array.
\n
\n§fn encoded_len(&self) -> Result<usize, Error>
Get the length of this type encoded in bytes, prior to Base64 encoding.§fn encode(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value using the provided [Writer].§fn encoded_len_prefixed(&self) -> Result<usize, Error>
Return the length of this type after encoding when prepended with a\nuint32 length prefix.§fn encode_prefixed(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value, first prepending a uint32 length prefix\nset to [Encode::encoded_len].","Encode","iroh::docs::PeerIdBytes"],["","EncodeLabelSet","iroh::docs::PeerIdBytes"],["§impl<T, const N: usize> EncodeValue for [T; N]where\n T: Encode,
","EncodeValue","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["§impl<'a> FindToken<&'a u8> for [u8; 32]
§fn find_token(&self, token: &u8) -> bool
Returns true if self contains the token","FindToken<&'a u8>","iroh::docs::PeerIdBytes"],["§impl FindToken<u8> for [u8; 32]
§fn find_token(&self, token: u8) -> bool
Returns true if self contains the token","FindToken","iroh::docs::PeerIdBytes"],["","FixedTag","iroh::docs::PeerIdBytes"],["","From<&Signature>","iroh::docs::PeerIdBytes"],["","From","iroh::docs::PeerIdBytes"],["§impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>>> for [T; 32]
","From, B0>, B0>, B0>, B0>, B0>>>","iroh::docs::PeerIdBytes"],["","From","iroh::docs::PeerIdBytes"],["","From","iroh::docs::PeerIdBytes"],["","From>","iroh::docs::PeerIdBytes"],["","From","iroh::docs::PeerIdBytes"],["","From","iroh::docs::PeerIdBytes"],["","From","iroh::docs::PeerIdBytes"],["","From>","iroh::docs::PeerIdBytes"],["§impl<const N: usize, T> FromBytes for [T; N]where\n T: FromBytes,
§fn slice_from_prefix(bytes: &[u8], count: usize) -> Option<(&[Self], &[u8])>where\n Self: Sized,
Interprets the prefix of the given bytes as a &[Self] with length\nequal to count without copying. Read more§fn slice_from_suffix(bytes: &[u8], count: usize) -> Option<(&[u8], &[Self])>where\n Self: Sized,
Interprets the suffix of the given bytes as a &[Self] with length\nequal to count without copying. Read more§fn read_from_prefix(bytes: &[u8]) -> Option<Self>where\n Self: Sized,
","FromBytes","iroh::docs::PeerIdBytes"],["","FromHex","iroh::docs::PeerIdBytes"],["","FromZeroes","iroh::docs::PeerIdBytes"],["","Hash","iroh::docs::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Hash for [T; N]where\n T: Hash,
The hash of an array is the same as that of the corresponding slice,\nas required by the Borrow implementation.
\n\nuse std::hash::BuildHasher;\n\nlet b = std::hash::RandomState::new();\nlet a: [u8; 3] = [0xa8, 0x3c, 0x09];\nlet s: &[u8] = &[0xa8, 0x3c, 0x09];\nassert_eq!(b.hash_one(a), b.hash_one(s));
\n","Hash","iroh::docs::PeerIdBytes"],["","Index","iroh::docs::PeerIdBytes"],["","IndexMut","iroh::docs::PeerIdBytes"],["","InputLength","iroh::docs::PeerIdBytes"],["1.53.0 · source§impl<T, const N: usize> IntoIterator for [T; N]
source§fn into_iter(self) -> <[T; N] as IntoIterator>::IntoIter
Creates a consuming iterator, that is, one that moves each value out of\nthe array (from start to end). The array cannot be used after calling\nthis unless T implements Copy, so the whole array is copied.
\nArrays have special behavior when calling .into_iter() prior to the\n2021 edition – see the array Editions section for more information.
\n","IntoIterator","iroh::docs::PeerIdBytes"],["§impl<const N: usize> IntoResponse for [u8; N]
§fn into_response(self) -> Response<Body>
Create a response.","IntoResponse","iroh::docs::PeerIdBytes"],["§impl<Fut, const N: usize> Join for [Fut; N]where\n Fut: IntoFuture,
§type Output = [<Fut as IntoFuture>::Output; N]
The resulting output type.§type Future = Join<<Fut as IntoFuture>::IntoFuture, N>
The Future implementation returned by this method.","Join","iroh::docs::PeerIdBytes"],["","Key","iroh::docs::PeerIdBytes"],["§impl<T, const N: usize> MaxSize for [T; N]where\n T: MaxSize,
§const POSTCARD_MAX_SIZE: usize = _
The maximum possible size that the serialization of this\ntype can have, in bytes.","MaxSize","iroh::docs::PeerIdBytes"],["","Merge","iroh::docs::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Ord for [T; N]where\n T: Ord,
Implements comparison of arrays lexicographically.
\n1.21.0 · source§fn max(self, other: Self) -> Selfwhere\n Self: Sized,
Compares and returns the maximum of two values. Read more","Ord","iroh::docs::PeerIdBytes"],["","PartialEq<&[U]>","iroh::docs::PeerIdBytes"],["1.0.0 · source§impl<T, U, const N: usize> PartialEq<&mut [U]> for [T; N]where\n T: PartialEq<U>,
","PartialEq<&mut [U]>","iroh::docs::PeerIdBytes"],["","PartialEq<[U]>","iroh::docs::PeerIdBytes"],["","PartialEq<[U; N]>","iroh::docs::PeerIdBytes"],["","PartialEq","iroh::docs::PeerIdBytes"],["§impl<A, B, const N: usize, const M: usize> PartialEq<Vec<A, N>> for [B; M]where\n A: PartialEq<B>,
","PartialEq>","iroh::docs::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> PartialOrd for [T; N]where\n T: PartialOrd,
Implements comparison of arrays lexicographically.
\nsource§fn le(&self, other: &[T; N]) -> bool
This method tests less than or equal to (for self and other) and is used by the <=\noperator. Read more","PartialOrd","iroh::docs::PeerIdBytes"],["§impl<Fut, const N: usize> Race for [Fut; N]where\n Fut: IntoFuture,
§type Output = <Fut as IntoFuture>::Output
The resulting output type.§type Future = Race<<Fut as IntoFuture>::IntoFuture, N>
Which kind of future are we turning this into?","Race","iroh::docs::PeerIdBytes"],["§impl<Fut, T, E, const N: usize> RaceOk for [Fut; N]where\n Fut: IntoFuture<Output = Result<T, E>>,
§type Future = RaceOk<<Fut as IntoFuture>::IntoFuture, T, E, N>
Which kind of future are we turning this into?","RaceOk","iroh::docs::PeerIdBytes"],["","Schema","iroh::docs::PeerIdBytes"],["source§impl<T> Serialize for [T; 32]where\n T: 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","iroh::docs::PeerIdBytes"],["source§impl<const N: usize> Serialize for [u8; N]
source§fn serialize<S>(\n &self,\n serializer: S\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where\n S: Serializer,
","Serialize","iroh::docs::PeerIdBytes"],["1.51.0 · source§impl<T, const N: usize> SlicePattern for [T; N]
","SlicePattern","iroh::docs::PeerIdBytes"],["1.34.0 · source§impl<T, const N: usize> TryFrom<&[T]> for [T; N]where\n T: Copy,
Tries to create an array [T; N] by copying from a slice &[T]. Succeeds if\nslice.len() == N.
\n\nlet bytes: [u8; 3] = [1, 0, 2];\n\nlet bytes_head: [u8; 2] = <[u8; 2]>::try_from(&bytes[0..2]).unwrap();\nassert_eq!(1, u16::from_le_bytes(bytes_head));\n\nlet bytes_tail: [u8; 2] = bytes[1..3].try_into().unwrap();\nassert_eq!(512, u16::from_le_bytes(bytes_tail));
\n§type Error = TryFromSliceError
The type returned in the event of a conversion error.","TryFrom<&[T]>","iroh::docs::PeerIdBytes"],["1.59.0 · source§impl<T, const N: usize> TryFrom<&mut [T]> for [T; N]where\n T: Copy,
Tries to create an array [T; N] by copying from a mutable slice &mut [T].\nSucceeds if slice.len() == N.
\n\nlet mut bytes: [u8; 3] = [1, 0, 2];\n\nlet bytes_head: [u8; 2] = <[u8; 2]>::try_from(&mut bytes[0..2]).unwrap();\nassert_eq!(1, u16::from_le_bytes(bytes_head));\n\nlet bytes_tail: [u8; 2] = (&mut bytes[1..3]).try_into().unwrap();\nassert_eq!(512, u16::from_le_bytes(bytes_tail));
\n§type Error = TryFromSliceError
The type returned in the event of a conversion error.","TryFrom<&mut [T]>","iroh::docs::PeerIdBytes"],["§impl<T, A, const N: usize> TryFrom<Vec<T, A>> for [T; N]where\n A: Allocator,
§fn try_from(vec: Vec<T, A>) -> Result<[T; N], Vec<T, A>>
Gets the entire contents of the Vec<T> as an array,\nif its size exactly matches that of the requested array.
\n§Examples
\nassert_eq!(vec![1, 2, 3].try_into(), Ok([1, 2, 3]));\nassert_eq!(<Vec<i32>>::new().try_into(), Ok([]));
\nIf the length doesn’t match, the input comes back in Err:
\n\nlet r: Result<[i32; 4], _> = (0..10).collect::<Vec<_>>().try_into();\nassert_eq!(r, Err(vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9]));
\nIf you’re fine with just getting a prefix of the Vec<T>,\nyou can call .truncate(N) first.
\n\nlet mut v = String::from(\"hello world\").into_bytes();\nv.sort();\nv.truncate(2);\nlet [a, b]: [_; 2] = v.try_into().unwrap();\nassert_eq!(a, b' ');\nassert_eq!(b, b'd');
\n","TryFrom>","iroh::docs::PeerIdBytes"],["1.48.0 · source§impl<T, A, const N: usize> TryFrom<Vec<T, A>> for [T; N]where\n A: Allocator,
source§fn try_from(vec: Vec<T, A>) -> Result<[T; N], Vec<T, A>>
Gets the entire contents of the Vec<T> as an array,\nif its size exactly matches that of the requested array.
\n§Examples
\nassert_eq!(vec![1, 2, 3].try_into(), Ok([1, 2, 3]));\nassert_eq!(<Vec<i32>>::new().try_into(), Ok([]));
\nIf the length doesn’t match, the input comes back in Err:
\n\nlet r: Result<[i32; 4], _> = (0..10).collect::<Vec<_>>().try_into();\nassert_eq!(r, Err(vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9]));
\nIf you’re fine with just getting a prefix of the Vec<T>,\nyou can call .truncate(N) first.
\n\nlet mut v = String::from(\"hello world\").into_bytes();\nv.sort();\nv.truncate(2);\nlet [a, b]: [_; 2] = v.try_into().unwrap();\nassert_eq!(a, b' ');\nassert_eq!(b, b'd');
\n","TryFrom>","iroh::docs::PeerIdBytes"],["§impl<Fut, T, E, const N: usize> TryJoin for [Fut; N]where\n Fut: IntoFuture<Output = Result<T, E>>,
§type Future = TryJoin<<Fut as IntoFuture>::IntoFuture, T, E, N>
Which kind of future are we turning this into?","TryJoin","iroh::docs::PeerIdBytes"],["§impl<const N: usize, T> Value for [T; N]where\n T: Value,
§type SelfType<'a> = [<T as Value>::SelfType<'a>; N]\nwhere\n [T; N]: 'a
SelfType<’a> must be the same type as Self with all lifetimes replaced with ’a§type AsBytes<'a> = Vec<u8>\nwhere\n [T; N]: 'a
§fn fixed_width() -> Option<usize>
Width of a fixed type, or None for variable width§fn from_bytes<'a>(data: &'a [u8]) -> [<T as Value>::SelfType<'a>; N]where\n [T; N]: 'a,
Deserializes data\nImplementations may return a view over data, or an owned type","Value","iroh::docs::PeerIdBytes"],["","ValueOrd","iroh::docs::PeerIdBytes"],["§impl<Z, const N: usize> Zeroize for [Z; N]where\n Z: Zeroize,
Impl [Zeroize] on arrays of types that impl [Zeroize].
\n","Zeroize","iroh::docs::PeerIdBytes"],["","Zip","iroh::docs::PeerIdBytes"],["source§impl<T, const N: usize> ConstParamTy for [T; N]where\n T: ConstParamTy,
","ConstParamTy","iroh::docs::PeerIdBytes"],["1.58.0 · source§impl<T, const N: usize> Copy for [T; N]where\n T: Copy,
","Copy","iroh::docs::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Eq for [T; N]where\n T: Eq,
","Eq","iroh::docs::PeerIdBytes"],["source§impl<T, const N: usize> StructuralPartialEq for [T; N]
","StructuralPartialEq","iroh::docs::PeerIdBytes"],["§impl<const N: usize, T> Unaligned for [T; N]where\n T: Unaligned,
","Unaligned","iroh::docs::PeerIdBytes"],["§impl<Z, const N: usize> ZeroizeOnDrop for [Z; N]where\n Z: ZeroizeOnDrop,
Impl [ZeroizeOnDrop] on arrays of types that impl [ZeroizeOnDrop].
\n","ZeroizeOnDrop","iroh::docs::PeerIdBytes"]],
-"iroh_docs":[["source§impl<T, const N: usize> [T; N]
1.55.0 · sourcepub fn map<F, U>(self, f: F) -> [U; N]where\n F: FnMut(T) -> U,
Returns an array of the same size as self, with function f applied to each element\nin order.
\nIf you don’t necessarily need a new fixed-size array, consider using\nIterator::map instead.
\n§Note on performance and stack usage
\nUnfortunately, usages of this method are currently not always optimized\nas well as they could be. This mainly concerns large arrays, as mapping\nover small arrays seem to be optimized just fine. Also note that in\ndebug mode (i.e. without any optimizations), this method can use a lot\nof stack space (a few times the size of the array or more).
\nTherefore, in performance-critical code, try to avoid using this method\non large arrays or check the emitted code. Also try to avoid chained\nmaps (e.g. arr.map(...).map(...)).
\nIn many cases, you can instead use Iterator::map by calling .iter()\nor .into_iter() on your array. [T; N]::map is only necessary if you\nreally need a new array of the same size as the result. Rust’s lazy\niterators tend to get optimized very well.
\n§Examples
\nlet x = [1, 2, 3];\nlet y = x.map(|v| v + 1);\nassert_eq!(y, [2, 3, 4]);\n\nlet x = [1, 2, 3];\nlet mut temp = 0;\nlet y = x.map(|v| { temp += 1; v * temp });\nassert_eq!(y, [1, 4, 9]);\n\nlet x = [\"Ferris\", \"Bueller's\", \"Day\", \"Off\"];\nlet y = x.map(|v| v.len());\nassert_eq!(y, [6, 9, 3, 3]);
\nsourcepub fn try_map<F, R>(\n self,\n f: F\n) -> <<R as Try>::Residual as Residual<[<R as Try>::Output; N]>>::TryType
🔬This is a nightly-only experimental API. (array_try_map)
A fallible function f applied to each element on array self in order to\nreturn an array the same size as self or the first error encountered.
\nThe return type of this function depends on the return type of the closure.\nIf you return Result<T, E> from the closure, you’ll get a Result<[T; N], E>.\nIf you return Option<T> from the closure, you’ll get an Option<[T; N]>.
\n§Examples
\n#![feature(array_try_map)]\n\nlet a = [\"1\", \"2\", \"3\"];\nlet b = a.try_map(|v| v.parse::<u32>()).unwrap().map(|v| v + 1);\nassert_eq!(b, [2, 3, 4]);\n\nlet a = [\"1\", \"2a\", \"3\"];\nlet b = a.try_map(|v| v.parse::<u32>());\nassert!(b.is_err());\n\nuse std::num::NonZero;\n\nlet z = [1, 2, 0, 3, 4];\nassert_eq!(z.try_map(NonZero::new), None);\n\nlet a = [1, 2, 3];\nlet b = a.try_map(NonZero::new);\nlet c = b.map(|x| x.map(NonZero::get));\nassert_eq!(c, Some(a));
\n1.57.0 (const: 1.57.0) · sourcepub const fn as_slice(&self) -> &[T]
Returns a slice containing the entire array. Equivalent to &s[..].
\n1.57.0 · sourcepub fn as_mut_slice(&mut self) -> &mut [T]
Returns a mutable slice containing the entire array. Equivalent to\n&mut s[..].
\n1.77.0 · sourcepub fn each_ref(&self) -> [&T; N]
Borrows each element and returns an array of references with the same\nsize as self.
\n§Example
\nlet floats = [3.1, 2.7, -1.0];\nlet float_refs: [&f64; 3] = floats.each_ref();\nassert_eq!(float_refs, [&3.1, &2.7, &-1.0]);
\nThis method is particularly useful if combined with other methods, like\nmap. This way, you can avoid moving the original\narray if its elements are not Copy.
\n\nlet strings = [\"Ferris\".to_string(), \"♥\".to_string(), \"Rust\".to_string()];\nlet is_ascii = strings.each_ref().map(|s| s.is_ascii());\nassert_eq!(is_ascii, [true, false, true]);\n\n// We can still access the original array: it has not been moved.\nassert_eq!(strings.len(), 3);
\n1.77.0 · sourcepub fn each_mut(&mut self) -> [&mut T; N]
Borrows each element mutably and returns an array of mutable references\nwith the same size as self.
\n§Example
\n\nlet mut floats = [3.1, 2.7, -1.0];\nlet float_refs: [&mut f64; 3] = floats.each_mut();\n*float_refs[0] = 0.0;\nassert_eq!(float_refs, [&mut 0.0, &mut 2.7, &mut -1.0]);\nassert_eq!(floats, [0.0, 2.7, -1.0]);
\nsourcepub fn split_array_ref<const M: usize>(&self) -> (&[T; M], &[T])
🔬This is a nightly-only experimental API. (split_array)
Divides one array reference into two at an index.
\nThe first will contain all indices from [0, M) (excluding\nthe index M itself) and the second will contain all\nindices from [M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet v = [1, 2, 3, 4, 5, 6];\n\n{\n let (left, right) = v.split_array_ref::<0>();\n assert_eq!(left, &[]);\n assert_eq!(right, &[1, 2, 3, 4, 5, 6]);\n}\n\n{\n let (left, right) = v.split_array_ref::<2>();\n assert_eq!(left, &[1, 2]);\n assert_eq!(right, &[3, 4, 5, 6]);\n}\n\n{\n let (left, right) = v.split_array_ref::<6>();\n assert_eq!(left, &[1, 2, 3, 4, 5, 6]);\n assert_eq!(right, &[]);\n}
\nsourcepub fn split_array_mut<const M: usize>(&mut self) -> (&mut [T; M], &mut [T])
🔬This is a nightly-only experimental API. (split_array)
Divides one mutable array reference into two at an index.
\nThe first will contain all indices from [0, M) (excluding\nthe index M itself) and the second will contain all\nindices from [M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet mut v = [1, 0, 3, 0, 5, 6];\nlet (left, right) = v.split_array_mut::<2>();\nassert_eq!(left, &mut [1, 0][..]);\nassert_eq!(right, &mut [3, 0, 5, 6]);\nleft[1] = 2;\nright[1] = 4;\nassert_eq!(v, [1, 2, 3, 4, 5, 6]);
\nsourcepub fn rsplit_array_ref<const M: usize>(&self) -> (&[T], &[T; M])
🔬This is a nightly-only experimental API. (split_array)
Divides one array reference into two at an index from the end.
\nThe first will contain all indices from [0, N - M) (excluding\nthe index N - M itself) and the second will contain all\nindices from [N - M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet v = [1, 2, 3, 4, 5, 6];\n\n{\n let (left, right) = v.rsplit_array_ref::<0>();\n assert_eq!(left, &[1, 2, 3, 4, 5, 6]);\n assert_eq!(right, &[]);\n}\n\n{\n let (left, right) = v.rsplit_array_ref::<2>();\n assert_eq!(left, &[1, 2, 3, 4]);\n assert_eq!(right, &[5, 6]);\n}\n\n{\n let (left, right) = v.rsplit_array_ref::<6>();\n assert_eq!(left, &[]);\n assert_eq!(right, &[1, 2, 3, 4, 5, 6]);\n}
\nsourcepub fn rsplit_array_mut<const M: usize>(&mut self) -> (&mut [T], &mut [T; M])
🔬This is a nightly-only experimental API. (split_array)
Divides one mutable array reference into two at an index from the end.
\nThe first will contain all indices from [0, N - M) (excluding\nthe index N - M itself) and the second will contain all\nindices from [N - M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet mut v = [1, 0, 3, 0, 5, 6];\nlet (left, right) = v.rsplit_array_mut::<4>();\nassert_eq!(left, &mut [1, 0]);\nassert_eq!(right, &mut [3, 0, 5, 6][..]);\nleft[1] = 2;\nright[1] = 4;\nassert_eq!(v, [1, 2, 3, 4, 5, 6]);
\n",0,"iroh_docs::sync::PeerIdBytes"],["source§impl<const N: usize> [u8; N]
sourcepub const fn as_ascii(&self) -> Option<&[AsciiChar; N]>
🔬This is a nightly-only experimental API. (ascii_char)
Converts this array of bytes into a array of ASCII characters,\nor returns None if any of the characters is non-ASCII.
\n§Examples
\n#![feature(ascii_char)]\n#![feature(const_option)]\n\nconst HEX_DIGITS: [std::ascii::Char; 16] =\n *b\"0123456789abcdef\".as_ascii().unwrap();\n\nassert_eq!(HEX_DIGITS[1].as_str(), \"1\");\nassert_eq!(HEX_DIGITS[10].as_str(), \"a\");
\nsourcepub const unsafe fn as_ascii_unchecked(&self) -> &[AsciiChar; N]
🔬This is a nightly-only experimental API. (ascii_char)
Converts this array of bytes into a array of ASCII characters,\nwithout checking whether they’re valid.
\n§Safety
\nEvery byte in the array must be in 0..=127, or else this is UB.
\n",0,"iroh_docs::sync::PeerIdBytes"],["§impl<T> Array for [T; 32]where\n T: Default,
§fn as_slice_mut(&mut self) -> &mut [T]
Gives a unique slice over the whole thing. Read more","Array","iroh_docs::sync::PeerIdBytes"],["","Array","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> AsBytes for [T; N]where\n T: AsBytes,
§fn write_to_prefix(&self, bytes: &mut [u8]) -> Option<()>
","AsBytes","iroh_docs::sync::PeerIdBytes"],["","AsBytes","iroh_docs::sync::PeerIdBytes"],["","AsMut<[T]>","iroh_docs::sync::PeerIdBytes"],["","AsRef<[T]>","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> BitView for [T; N]where\n T: BitStore,
Note that overly-large arrays may cause the conversions to fail.
\n§fn view_bits<O>(&self) -> &BitSlice<T, O>where\n O: BitOrder,
Views a memory region as an immutable bit-slice.§fn try_view_bits<O>(&self) -> Result<&BitSlice<T, O>, BitSpanError<T>>where\n O: BitOrder,
Attempts to view a memory region as an immutable bit-slice. Read more§fn view_bits_mut<O>(&mut self) -> &mut BitSlice<T, O>where\n O: BitOrder,
Views a memory region as a mutable bit-slice.§fn try_view_bits_mut<O>(\n &mut self\n) -> Result<&mut BitSlice<T, O>, BitSpanError<T>>where\n O: BitOrder,
Attempts to view a memory region as a mutable bit-slice. Read more","BitView","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> BitViewSized for [T; N]where\n T: BitStore,
§fn as_raw_slice(&self) -> &[<[T; N] as BitView>::Store]
Views the type as a slice of its elements.§fn as_raw_mut_slice(&mut self) -> &mut [<[T; N] as BitView>::Store]
Views the type as a mutable slice of its elements.§fn into_bitarray<O>(self) -> BitArray<Self, O>where\n O: BitOrder,
Wraps self in a BitArray.","BitViewSized","iroh_docs::sync::PeerIdBytes"],["","Borrow<[T]>","iroh_docs::sync::PeerIdBytes"],["1.4.0 · source§impl<T, const N: usize> BorrowMut<[T]> for [T; N]
source§fn borrow_mut(&mut self) -> &mut [T]
Mutably borrows from an owned value. Read more","BorrowMut<[T]>","iroh_docs::sync::PeerIdBytes"],["","Chain","iroh_docs::sync::PeerIdBytes"],["","Clone","iroh_docs::sync::PeerIdBytes"],["","Debug","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize> Decode for [u8; N]
Decodes a byte array from byte[n] as described in RFC4251 § 5:
\n\nA byte represents an arbitrary 8-bit value (octet). Fixed length\ndata is sometimes represented as an array of bytes, written\nbyte[n], where n is the number of bytes in the array.
\n
\n","Decode","iroh_docs::sync::PeerIdBytes"],["§impl<'a, T, const N: usize> DecodeValue<'a> for [T; N]where\n T: Decode<'a>,
§fn decode_value<R>(reader: &mut R, header: Header) -> Result<[T; N], Error>where\n R: Reader<'a>,
Attempt to decode this message using the provided [Reader].","DecodeValue<'a>","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["source§impl<'de, T> Deserialize<'de> for [T; 32]where\n T: Deserialize<'de>,
source§fn deserialize<D>(\n deserializer: D\n) -> Result<[T; 32], <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more","Deserialize<'de>","iroh_docs::sync::PeerIdBytes"],["source§impl<'de, const N: usize> Deserialize<'de> for [u8; N]
source§fn deserialize<D>(\n deserializer: D\n) -> Result<[u8; N], <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
","Deserialize<'de>","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize> Encode for [u8; N]
Encodes [u8; N] into byte[n] as described in RFC4251 § 5:
\n\nA byte represents an arbitrary 8-bit value (octet). Fixed length\ndata is sometimes represented as an array of bytes, written\nbyte[n], where n is the number of bytes in the array.
\n
\n§fn encoded_len(&self) -> Result<usize, Error>
Get the length of this type encoded in bytes, prior to Base64 encoding.§fn encode(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value using the provided [Writer].§fn encoded_len_prefixed(&self) -> Result<usize, Error>
Return the length of this type after encoding when prepended with a\nuint32 length prefix.§fn encode_prefixed(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value, first prepending a uint32 length prefix\nset to [Encode::encoded_len].","Encode","iroh_docs::sync::PeerIdBytes"],["","EncodeLabelSet","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> EncodeValue for [T; N]where\n T: Encode,
","EncodeValue","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["§impl<'a> FindToken<&'a u8> for [u8; 32]
§fn find_token(&self, token: &u8) -> bool
Returns true if self contains the token","FindToken<&'a u8>","iroh_docs::sync::PeerIdBytes"],["§impl FindToken<u8> for [u8; 32]
§fn find_token(&self, token: u8) -> bool
Returns true if self contains the token","FindToken","iroh_docs::sync::PeerIdBytes"],["","FixedTag","iroh_docs::sync::PeerIdBytes"],["","From<&Signature>","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["§impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>>> for [T; 32]
","From, B0>, B0>, B0>, B0>, B0>>>","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["","From>","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["source§impl From<NamespaceId> for [u8; 32]
source§fn from(value: NamespaceId) -> Self
Converts to this type from the input type.","From","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["","From>","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> FromBytes for [T; N]where\n T: FromBytes,
§fn slice_from_prefix(bytes: &[u8], count: usize) -> Option<(&[Self], &[u8])>where\n Self: Sized,
Interprets the prefix of the given bytes as a &[Self] with length\nequal to count without copying. Read more§fn slice_from_suffix(bytes: &[u8], count: usize) -> Option<(&[u8], &[Self])>where\n Self: Sized,
Interprets the suffix of the given bytes as a &[Self] with length\nequal to count without copying. Read more§fn read_from_prefix(bytes: &[u8]) -> Option<Self>where\n Self: Sized,
","FromBytes","iroh_docs::sync::PeerIdBytes"],["","FromHex","iroh_docs::sync::PeerIdBytes"],["","FromZeroes","iroh_docs::sync::PeerIdBytes"],["","Hash","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Hash for [T; N]where\n T: Hash,
The hash of an array is the same as that of the corresponding slice,\nas required by the Borrow implementation.
\n\nuse std::hash::BuildHasher;\n\nlet b = std::hash::RandomState::new();\nlet a: [u8; 3] = [0xa8, 0x3c, 0x09];\nlet s: &[u8] = &[0xa8, 0x3c, 0x09];\nassert_eq!(b.hash_one(a), b.hash_one(s));
\n","Hash","iroh_docs::sync::PeerIdBytes"],["","Index","iroh_docs::sync::PeerIdBytes"],["","IndexMut","iroh_docs::sync::PeerIdBytes"],["","InputLength","iroh_docs::sync::PeerIdBytes"],["1.53.0 · source§impl<T, const N: usize> IntoIterator for [T; N]
source§fn into_iter(self) -> <[T; N] as IntoIterator>::IntoIter
Creates a consuming iterator, that is, one that moves each value out of\nthe array (from start to end). The array cannot be used after calling\nthis unless T implements Copy, so the whole array is copied.
\nArrays have special behavior when calling .into_iter() prior to the\n2021 edition – see the array Editions section for more information.
\n","IntoIterator","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize> IntoResponse for [u8; N]
§fn into_response(self) -> Response<Body>
Create a response.","IntoResponse","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, const N: usize> Join for [Fut; N]where\n Fut: IntoFuture,
§type Output = [<Fut as IntoFuture>::Output; N]
The resulting output type.§type Future = Join<<Fut as IntoFuture>::IntoFuture, N>
The Future implementation returned by this method.","Join","iroh_docs::sync::PeerIdBytes"],["","Key","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> MaxSize for [T; N]where\n T: MaxSize,
§const POSTCARD_MAX_SIZE: usize = _
The maximum possible size that the serialization of this\ntype can have, in bytes.","MaxSize","iroh_docs::sync::PeerIdBytes"],["","Merge","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Ord for [T; N]where\n T: Ord,
Implements comparison of arrays lexicographically.
\n1.21.0 · source§fn max(self, other: Self) -> Selfwhere\n Self: Sized,
Compares and returns the maximum of two values. Read more","Ord","iroh_docs::sync::PeerIdBytes"],["","PartialEq<&[U]>","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, U, const N: usize> PartialEq<&mut [U]> for [T; N]where\n T: PartialEq<U>,
","PartialEq<&mut [U]>","iroh_docs::sync::PeerIdBytes"],["","PartialEq<[U]>","iroh_docs::sync::PeerIdBytes"],["","PartialEq<[U; N]>","iroh_docs::sync::PeerIdBytes"],["","PartialEq","iroh_docs::sync::PeerIdBytes"],["§impl<A, B, const N: usize, const M: usize> PartialEq<Vec<A, N>> for [B; M]where\n A: PartialEq<B>,
","PartialEq>","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> PartialOrd for [T; N]where\n T: PartialOrd,
Implements comparison of arrays lexicographically.
\nsource§fn le(&self, other: &[T; N]) -> bool
This method tests less than or equal to (for self and other) and is used by the <=\noperator. Read more","PartialOrd","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, const N: usize> Race for [Fut; N]where\n Fut: IntoFuture,
§type Output = <Fut as IntoFuture>::Output
The resulting output type.§type Future = Race<<Fut as IntoFuture>::IntoFuture, N>
Which kind of future are we turning this into?","Race","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, T, E, const N: usize> RaceOk for [Fut; N]where\n Fut: IntoFuture<Output = Result<T, E>>,
§type Future = RaceOk<<Fut as IntoFuture>::IntoFuture, T, E, N>
Which kind of future are we turning this into?","RaceOk","iroh_docs::sync::PeerIdBytes"],["","Schema","iroh_docs::sync::PeerIdBytes"],["source§impl<T> Serialize for [T; 32]where\n T: 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","iroh_docs::sync::PeerIdBytes"],["source§impl<const N: usize> Serialize for [u8; N]
source§fn serialize<S>(\n &self,\n serializer: S\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where\n S: Serializer,
","Serialize","iroh_docs::sync::PeerIdBytes"],["1.51.0 · source§impl<T, const N: usize> SlicePattern for [T; N]
","SlicePattern","iroh_docs::sync::PeerIdBytes"],["1.34.0 · source§impl<T, const N: usize> TryFrom<&[T]> for [T; N]where\n T: Copy,
Tries to create an array [T; N] by copying from a slice &[T]. Succeeds if\nslice.len() == N.
\n\nlet bytes: [u8; 3] = [1, 0, 2];\n\nlet bytes_head: [u8; 2] = <[u8; 2]>::try_from(&bytes[0..2]).unwrap();\nassert_eq!(1, u16::from_le_bytes(bytes_head));\n\nlet bytes_tail: [u8; 2] = bytes[1..3].try_into().unwrap();\nassert_eq!(512, u16::from_le_bytes(bytes_tail));
\n§type Error = TryFromSliceError
The type returned in the event of a conversion error.","TryFrom<&[T]>","iroh_docs::sync::PeerIdBytes"],["1.59.0 · source§impl<T, const N: usize> TryFrom<&mut [T]> for [T; N]where\n T: Copy,
Tries to create an array [T; N] by copying from a mutable slice &mut [T].\nSucceeds if slice.len() == N.
\n\nlet mut bytes: [u8; 3] = [1, 0, 2];\n\nlet bytes_head: [u8; 2] = <[u8; 2]>::try_from(&mut bytes[0..2]).unwrap();\nassert_eq!(1, u16::from_le_bytes(bytes_head));\n\nlet bytes_tail: [u8; 2] = (&mut bytes[1..3]).try_into().unwrap();\nassert_eq!(512, u16::from_le_bytes(bytes_tail));
\n§type Error = TryFromSliceError
The type returned in the event of a conversion error.","TryFrom<&mut [T]>","iroh_docs::sync::PeerIdBytes"],["§impl<T, A, const N: usize> TryFrom<Vec<T, A>> for [T; N]where\n A: Allocator,
§fn try_from(vec: Vec<T, A>) -> Result<[T; N], Vec<T, A>>
Gets the entire contents of the Vec<T> as an array,\nif its size exactly matches that of the requested array.
\n§Examples
\nassert_eq!(vec![1, 2, 3].try_into(), Ok([1, 2, 3]));\nassert_eq!(<Vec<i32>>::new().try_into(), Ok([]));
\nIf the length doesn’t match, the input comes back in Err:
\n\nlet r: Result<[i32; 4], _> = (0..10).collect::<Vec<_>>().try_into();\nassert_eq!(r, Err(vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9]));
\nIf you’re fine with just getting a prefix of the Vec<T>,\nyou can call .truncate(N) first.
\n\nlet mut v = String::from(\"hello world\").into_bytes();\nv.sort();\nv.truncate(2);\nlet [a, b]: [_; 2] = v.try_into().unwrap();\nassert_eq!(a, b' ');\nassert_eq!(b, b'd');
\n","TryFrom>","iroh_docs::sync::PeerIdBytes"],["1.48.0 · source§impl<T, A, const N: usize> TryFrom<Vec<T, A>> for [T; N]where\n A: Allocator,
source§fn try_from(vec: Vec<T, A>) -> Result<[T; N], Vec<T, A>>
Gets the entire contents of the Vec<T> as an array,\nif its size exactly matches that of the requested array.
\n§Examples
\nassert_eq!(vec![1, 2, 3].try_into(), Ok([1, 2, 3]));\nassert_eq!(<Vec<i32>>::new().try_into(), Ok([]));
\nIf the length doesn’t match, the input comes back in Err:
\n\nlet r: Result<[i32; 4], _> = (0..10).collect::<Vec<_>>().try_into();\nassert_eq!(r, Err(vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9]));
\nIf you’re fine with just getting a prefix of the Vec<T>,\nyou can call .truncate(N) first.
\n\nlet mut v = String::from(\"hello world\").into_bytes();\nv.sort();\nv.truncate(2);\nlet [a, b]: [_; 2] = v.try_into().unwrap();\nassert_eq!(a, b' ');\nassert_eq!(b, b'd');
\n","TryFrom>","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, T, E, const N: usize> TryJoin for [Fut; N]where\n Fut: IntoFuture<Output = Result<T, E>>,
§type Future = TryJoin<<Fut as IntoFuture>::IntoFuture, T, E, N>
Which kind of future are we turning this into?","TryJoin","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> Value for [T; N]where\n T: Value,
§type SelfType<'a> = [<T as Value>::SelfType<'a>; N]\nwhere\n [T; N]: 'a
SelfType<’a> must be the same type as Self with all lifetimes replaced with ’a§type AsBytes<'a> = Vec<u8>\nwhere\n [T; N]: 'a
§fn fixed_width() -> Option<usize>
Width of a fixed type, or None for variable width§fn from_bytes<'a>(data: &'a [u8]) -> [<T as Value>::SelfType<'a>; N]where\n [T; N]: 'a,
Deserializes data\nImplementations may return a view over data, or an owned type","Value","iroh_docs::sync::PeerIdBytes"],["","ValueOrd","iroh_docs::sync::PeerIdBytes"],["§impl<Z, const N: usize> Zeroize for [Z; N]where\n Z: Zeroize,
Impl [Zeroize] on arrays of types that impl [Zeroize].
\n","Zeroize","iroh_docs::sync::PeerIdBytes"],["","Zip","iroh_docs::sync::PeerIdBytes"],["source§impl<T, const N: usize> ConstParamTy for [T; N]where\n T: ConstParamTy,
","ConstParamTy","iroh_docs::sync::PeerIdBytes"],["1.58.0 · source§impl<T, const N: usize> Copy for [T; N]where\n T: Copy,
","Copy","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Eq for [T; N]where\n T: Eq,
","Eq","iroh_docs::sync::PeerIdBytes"],["source§impl<T, const N: usize> StructuralPartialEq for [T; N]
","StructuralPartialEq","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> Unaligned for [T; N]where\n T: Unaligned,
","Unaligned","iroh_docs::sync::PeerIdBytes"],["§impl<Z, const N: usize> ZeroizeOnDrop for [Z; N]where\n Z: ZeroizeOnDrop,
Impl [ZeroizeOnDrop] on arrays of types that impl [ZeroizeOnDrop].
\n","ZeroizeOnDrop","iroh_docs::sync::PeerIdBytes"]]
+"iroh_docs":[["source§impl<T, const N: usize> [T; N]
1.55.0 · sourcepub fn map<F, U>(self, f: F) -> [U; N]where\n F: FnMut(T) -> U,
Returns an array of the same size as self, with function f applied to each element\nin order.
\nIf you don’t necessarily need a new fixed-size array, consider using\nIterator::map instead.
\n§Note on performance and stack usage
\nUnfortunately, usages of this method are currently not always optimized\nas well as they could be. This mainly concerns large arrays, as mapping\nover small arrays seem to be optimized just fine. Also note that in\ndebug mode (i.e. without any optimizations), this method can use a lot\nof stack space (a few times the size of the array or more).
\nTherefore, in performance-critical code, try to avoid using this method\non large arrays or check the emitted code. Also try to avoid chained\nmaps (e.g. arr.map(...).map(...)).
\nIn many cases, you can instead use Iterator::map by calling .iter()\nor .into_iter() on your array. [T; N]::map is only necessary if you\nreally need a new array of the same size as the result. Rust’s lazy\niterators tend to get optimized very well.
\n§Examples
\nlet x = [1, 2, 3];\nlet y = x.map(|v| v + 1);\nassert_eq!(y, [2, 3, 4]);\n\nlet x = [1, 2, 3];\nlet mut temp = 0;\nlet y = x.map(|v| { temp += 1; v * temp });\nassert_eq!(y, [1, 4, 9]);\n\nlet x = [\"Ferris\", \"Bueller's\", \"Day\", \"Off\"];\nlet y = x.map(|v| v.len());\nassert_eq!(y, [6, 9, 3, 3]);
\nsourcepub fn try_map<F, R>(\n self,\n f: F\n) -> <<R as Try>::Residual as Residual<[<R as Try>::Output; N]>>::TryType
🔬This is a nightly-only experimental API. (array_try_map)
A fallible function f applied to each element on array self in order to\nreturn an array the same size as self or the first error encountered.
\nThe return type of this function depends on the return type of the closure.\nIf you return Result<T, E> from the closure, you’ll get a Result<[T; N], E>.\nIf you return Option<T> from the closure, you’ll get an Option<[T; N]>.
\n§Examples
\n#![feature(array_try_map)]\n\nlet a = [\"1\", \"2\", \"3\"];\nlet b = a.try_map(|v| v.parse::<u32>()).unwrap().map(|v| v + 1);\nassert_eq!(b, [2, 3, 4]);\n\nlet a = [\"1\", \"2a\", \"3\"];\nlet b = a.try_map(|v| v.parse::<u32>());\nassert!(b.is_err());\n\nuse std::num::NonZero;\n\nlet z = [1, 2, 0, 3, 4];\nassert_eq!(z.try_map(NonZero::new), None);\n\nlet a = [1, 2, 3];\nlet b = a.try_map(NonZero::new);\nlet c = b.map(|x| x.map(NonZero::get));\nassert_eq!(c, Some(a));
\n1.57.0 (const: 1.57.0) · sourcepub const fn as_slice(&self) -> &[T]
Returns a slice containing the entire array. Equivalent to &s[..].
\n1.57.0 · sourcepub fn as_mut_slice(&mut self) -> &mut [T]
Returns a mutable slice containing the entire array. Equivalent to\n&mut s[..].
\n1.77.0 · sourcepub fn each_ref(&self) -> [&T; N]
Borrows each element and returns an array of references with the same\nsize as self.
\n§Example
\nlet floats = [3.1, 2.7, -1.0];\nlet float_refs: [&f64; 3] = floats.each_ref();\nassert_eq!(float_refs, [&3.1, &2.7, &-1.0]);
\nThis method is particularly useful if combined with other methods, like\nmap. This way, you can avoid moving the original\narray if its elements are not Copy.
\n\nlet strings = [\"Ferris\".to_string(), \"♥\".to_string(), \"Rust\".to_string()];\nlet is_ascii = strings.each_ref().map(|s| s.is_ascii());\nassert_eq!(is_ascii, [true, false, true]);\n\n// We can still access the original array: it has not been moved.\nassert_eq!(strings.len(), 3);
\n1.77.0 · sourcepub fn each_mut(&mut self) -> [&mut T; N]
Borrows each element mutably and returns an array of mutable references\nwith the same size as self.
\n§Example
\n\nlet mut floats = [3.1, 2.7, -1.0];\nlet float_refs: [&mut f64; 3] = floats.each_mut();\n*float_refs[0] = 0.0;\nassert_eq!(float_refs, [&mut 0.0, &mut 2.7, &mut -1.0]);\nassert_eq!(floats, [0.0, 2.7, -1.0]);
\nsourcepub fn split_array_ref<const M: usize>(&self) -> (&[T; M], &[T])
🔬This is a nightly-only experimental API. (split_array)
Divides one array reference into two at an index.
\nThe first will contain all indices from [0, M) (excluding\nthe index M itself) and the second will contain all\nindices from [M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet v = [1, 2, 3, 4, 5, 6];\n\n{\n let (left, right) = v.split_array_ref::<0>();\n assert_eq!(left, &[]);\n assert_eq!(right, &[1, 2, 3, 4, 5, 6]);\n}\n\n{\n let (left, right) = v.split_array_ref::<2>();\n assert_eq!(left, &[1, 2]);\n assert_eq!(right, &[3, 4, 5, 6]);\n}\n\n{\n let (left, right) = v.split_array_ref::<6>();\n assert_eq!(left, &[1, 2, 3, 4, 5, 6]);\n assert_eq!(right, &[]);\n}
\nsourcepub fn split_array_mut<const M: usize>(&mut self) -> (&mut [T; M], &mut [T])
🔬This is a nightly-only experimental API. (split_array)
Divides one mutable array reference into two at an index.
\nThe first will contain all indices from [0, M) (excluding\nthe index M itself) and the second will contain all\nindices from [M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet mut v = [1, 0, 3, 0, 5, 6];\nlet (left, right) = v.split_array_mut::<2>();\nassert_eq!(left, &mut [1, 0][..]);\nassert_eq!(right, &mut [3, 0, 5, 6]);\nleft[1] = 2;\nright[1] = 4;\nassert_eq!(v, [1, 2, 3, 4, 5, 6]);
\nsourcepub fn rsplit_array_ref<const M: usize>(&self) -> (&[T], &[T; M])
🔬This is a nightly-only experimental API. (split_array)
Divides one array reference into two at an index from the end.
\nThe first will contain all indices from [0, N - M) (excluding\nthe index N - M itself) and the second will contain all\nindices from [N - M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet v = [1, 2, 3, 4, 5, 6];\n\n{\n let (left, right) = v.rsplit_array_ref::<0>();\n assert_eq!(left, &[1, 2, 3, 4, 5, 6]);\n assert_eq!(right, &[]);\n}\n\n{\n let (left, right) = v.rsplit_array_ref::<2>();\n assert_eq!(left, &[1, 2, 3, 4]);\n assert_eq!(right, &[5, 6]);\n}\n\n{\n let (left, right) = v.rsplit_array_ref::<6>();\n assert_eq!(left, &[]);\n assert_eq!(right, &[1, 2, 3, 4, 5, 6]);\n}
\nsourcepub fn rsplit_array_mut<const M: usize>(&mut self) -> (&mut [T], &mut [T; M])
🔬This is a nightly-only experimental API. (split_array)
Divides one mutable array reference into two at an index from the end.
\nThe first will contain all indices from [0, N - M) (excluding\nthe index N - M itself) and the second will contain all\nindices from [N - M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet mut v = [1, 0, 3, 0, 5, 6];\nlet (left, right) = v.rsplit_array_mut::<4>();\nassert_eq!(left, &mut [1, 0]);\nassert_eq!(right, &mut [3, 0, 5, 6][..]);\nleft[1] = 2;\nright[1] = 4;\nassert_eq!(v, [1, 2, 3, 4, 5, 6]);
\n",0,"iroh_docs::sync::PeerIdBytes"],["source§impl<const N: usize> [u8; N]
sourcepub const fn as_ascii(&self) -> Option<&[AsciiChar; N]>
🔬This is a nightly-only experimental API. (ascii_char)
Converts this array of bytes into a array of ASCII characters,\nor returns None if any of the characters is non-ASCII.
\n§Examples
\n#![feature(ascii_char)]\n#![feature(const_option)]\n\nconst HEX_DIGITS: [std::ascii::Char; 16] =\n *b\"0123456789abcdef\".as_ascii().unwrap();\n\nassert_eq!(HEX_DIGITS[1].as_str(), \"1\");\nassert_eq!(HEX_DIGITS[10].as_str(), \"a\");
\nsourcepub const unsafe fn as_ascii_unchecked(&self) -> &[AsciiChar; N]
🔬This is a nightly-only experimental API. (ascii_char)
Converts this array of bytes into a array of ASCII characters,\nwithout checking whether they’re valid.
\n§Safety
\nEvery byte in the array must be in 0..=127, or else this is UB.
\n",0,"iroh_docs::sync::PeerIdBytes"],["§impl<T> Array for [T; 32]where\n T: Default,
§fn as_slice_mut(&mut self) -> &mut [T]
Gives a unique slice over the whole thing. Read more","Array","iroh_docs::sync::PeerIdBytes"],["","Array","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> AsBytes for [T; N]where\n T: AsBytes,
§fn write_to_prefix(&self, bytes: &mut [u8]) -> Option<()>
","AsBytes","iroh_docs::sync::PeerIdBytes"],["","AsBytes","iroh_docs::sync::PeerIdBytes"],["","AsMut<[T]>","iroh_docs::sync::PeerIdBytes"],["","AsRef<[T]>","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> BitView for [T; N]where\n T: BitStore,
Note that overly-large arrays may cause the conversions to fail.
\n§fn view_bits<O>(&self) -> &BitSlice<T, O>where\n O: BitOrder,
Views a memory region as an immutable bit-slice.§fn try_view_bits<O>(&self) -> Result<&BitSlice<T, O>, BitSpanError<T>>where\n O: BitOrder,
Attempts to view a memory region as an immutable bit-slice. Read more§fn view_bits_mut<O>(&mut self) -> &mut BitSlice<T, O>where\n O: BitOrder,
Views a memory region as a mutable bit-slice.§fn try_view_bits_mut<O>(\n &mut self\n) -> Result<&mut BitSlice<T, O>, BitSpanError<T>>where\n O: BitOrder,
Attempts to view a memory region as a mutable bit-slice. Read more","BitView","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> BitViewSized for [T; N]where\n T: BitStore,
§fn as_raw_slice(&self) -> &[<[T; N] as BitView>::Store]
Views the type as a slice of its elements.§fn as_raw_mut_slice(&mut self) -> &mut [<[T; N] as BitView>::Store]
Views the type as a mutable slice of its elements.§fn into_bitarray<O>(self) -> BitArray<Self, O>where\n O: BitOrder,
Wraps self in a BitArray.","BitViewSized","iroh_docs::sync::PeerIdBytes"],["","Borrow<[T]>","iroh_docs::sync::PeerIdBytes"],["1.4.0 · source§impl<T, const N: usize> BorrowMut<[T]> for [T; N]
source§fn borrow_mut(&mut self) -> &mut [T]
Mutably borrows from an owned value. Read more","BorrowMut<[T]>","iroh_docs::sync::PeerIdBytes"],["","Chain","iroh_docs::sync::PeerIdBytes"],["","Clone","iroh_docs::sync::PeerIdBytes"],["","Debug","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize> Decode for [u8; N]
Decodes a byte array from byte[n] as described in RFC4251 § 5:
\n\nA byte represents an arbitrary 8-bit value (octet). Fixed length\ndata is sometimes represented as an array of bytes, written\nbyte[n], where n is the number of bytes in the array.
\n
\n","Decode","iroh_docs::sync::PeerIdBytes"],["§impl<'a, T, const N: usize> DecodeValue<'a> for [T; N]where\n T: Decode<'a>,
§fn decode_value<R>(reader: &mut R, header: Header) -> Result<[T; N], Error>where\n R: Reader<'a>,
Attempt to decode this message using the provided [Reader].","DecodeValue<'a>","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["source§impl<'de, T> Deserialize<'de> for [T; 32]where\n T: Deserialize<'de>,
source§fn deserialize<D>(\n deserializer: D\n) -> Result<[T; 32], <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more","Deserialize<'de>","iroh_docs::sync::PeerIdBytes"],["source§impl<'de, const N: usize> Deserialize<'de> for [u8; N]
source§fn deserialize<D>(\n deserializer: D\n) -> Result<[u8; N], <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
","Deserialize<'de>","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize> Encode for [u8; N]
Encodes [u8; N] into byte[n] as described in RFC4251 § 5:
\n\nA byte represents an arbitrary 8-bit value (octet). Fixed length\ndata is sometimes represented as an array of bytes, written\nbyte[n], where n is the number of bytes in the array.
\n
\n§fn encoded_len(&self) -> Result<usize, Error>
Get the length of this type encoded in bytes, prior to Base64 encoding.§fn encode(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value using the provided [Writer].§fn encoded_len_prefixed(&self) -> Result<usize, Error>
Return the length of this type after encoding when prepended with a\nuint32 length prefix.§fn encode_prefixed(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value, first prepending a uint32 length prefix\nset to [Encode::encoded_len].","Encode","iroh_docs::sync::PeerIdBytes"],["","EncodeLabelSet","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> EncodeValue for [T; N]where\n T: Encode,
","EncodeValue","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["§impl<'a> FindToken<&'a u8> for [u8; 32]
§fn find_token(&self, token: &u8) -> bool
Returns true if self contains the token","FindToken<&'a u8>","iroh_docs::sync::PeerIdBytes"],["§impl FindToken<u8> for [u8; 32]
§fn find_token(&self, token: u8) -> bool
Returns true if self contains the token","FindToken","iroh_docs::sync::PeerIdBytes"],["","FixedTag","iroh_docs::sync::PeerIdBytes"],["","From<&Signature>","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["§impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>>> for [T; 32]
","From, B0>, B0>, B0>, B0>, B0>>>","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["","From>","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["source§impl From<NamespaceId> for [u8; 32]
source§fn from(value: NamespaceId) -> Self
Converts to this type from the input type.","From","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["","From>","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> FromBytes for [T; N]where\n T: FromBytes,
§fn slice_from_prefix(bytes: &[u8], count: usize) -> Option<(&[Self], &[u8])>where\n Self: Sized,
Interprets the prefix of the given bytes as a &[Self] with length\nequal to count without copying. Read more§fn slice_from_suffix(bytes: &[u8], count: usize) -> Option<(&[u8], &[Self])>where\n Self: Sized,
Interprets the suffix of the given bytes as a &[Self] with length\nequal to count without copying. Read more§fn read_from_prefix(bytes: &[u8]) -> Option<Self>where\n Self: Sized,
","FromBytes","iroh_docs::sync::PeerIdBytes"],["","FromHex","iroh_docs::sync::PeerIdBytes"],["","FromZeroes","iroh_docs::sync::PeerIdBytes"],["","Hash","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Hash for [T; N]where\n T: Hash,
The hash of an array is the same as that of the corresponding slice,\nas required by the Borrow implementation.
\n\nuse std::hash::BuildHasher;\n\nlet b = std::hash::RandomState::new();\nlet a: [u8; 3] = [0xa8, 0x3c, 0x09];\nlet s: &[u8] = &[0xa8, 0x3c, 0x09];\nassert_eq!(b.hash_one(a), b.hash_one(s));
\n","Hash","iroh_docs::sync::PeerIdBytes"],["","Index","iroh_docs::sync::PeerIdBytes"],["","IndexMut","iroh_docs::sync::PeerIdBytes"],["","InputLength","iroh_docs::sync::PeerIdBytes"],["1.53.0 · source§impl<T, const N: usize> IntoIterator for [T; N]
source§fn into_iter(self) -> <[T; N] as IntoIterator>::IntoIter
Creates a consuming iterator, that is, one that moves each value out of\nthe array (from start to end). The array cannot be used after calling\nthis unless T implements Copy, so the whole array is copied.
\nArrays have special behavior when calling .into_iter() prior to the\n2021 edition – see the array Editions section for more information.
\n","IntoIterator","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize> IntoResponse for [u8; N]
§fn into_response(self) -> Response<Body>
Create a response.","IntoResponse","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, const N: usize> Join for [Fut; N]where\n Fut: IntoFuture,
§type Output = [<Fut as IntoFuture>::Output; N]
The resulting output type.§type Future = Join<<Fut as IntoFuture>::IntoFuture, N>
The Future implementation returned by this method.","Join","iroh_docs::sync::PeerIdBytes"],["","Key","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> MaxSize for [T; N]where\n T: MaxSize,
§const POSTCARD_MAX_SIZE: usize = _
The maximum possible size that the serialization of this\ntype can have, in bytes.","MaxSize","iroh_docs::sync::PeerIdBytes"],["","Merge","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Ord for [T; N]where\n T: Ord,
Implements comparison of arrays lexicographically.
\n1.21.0 · source§fn max(self, other: Self) -> Selfwhere\n Self: Sized,
Compares and returns the maximum of two values. Read more","Ord","iroh_docs::sync::PeerIdBytes"],["","PartialEq<&[U]>","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, U, const N: usize> PartialEq<&mut [U]> for [T; N]where\n T: PartialEq<U>,
","PartialEq<&mut [U]>","iroh_docs::sync::PeerIdBytes"],["","PartialEq<[U]>","iroh_docs::sync::PeerIdBytes"],["","PartialEq<[U; N]>","iroh_docs::sync::PeerIdBytes"],["","PartialEq","iroh_docs::sync::PeerIdBytes"],["§impl<A, B, const N: usize, const M: usize> PartialEq<Vec<A, N>> for [B; M]where\n A: PartialEq<B>,
","PartialEq>","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> PartialOrd for [T; N]where\n T: PartialOrd,
Implements comparison of arrays lexicographically.
\nsource§fn le(&self, other: &[T; N]) -> bool
This method tests less than or equal to (for self and other) and is used by the <=\noperator. Read more","PartialOrd","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, const N: usize> Race for [Fut; N]where\n Fut: IntoFuture,
§type Output = <Fut as IntoFuture>::Output
The resulting output type.§type Future = Race<<Fut as IntoFuture>::IntoFuture, N>
Which kind of future are we turning this into?","Race","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, T, E, const N: usize> RaceOk for [Fut; N]where\n Fut: IntoFuture<Output = Result<T, E>>,
§type Future = RaceOk<<Fut as IntoFuture>::IntoFuture, T, E, N>
Which kind of future are we turning this into?","RaceOk","iroh_docs::sync::PeerIdBytes"],["","Schema","iroh_docs::sync::PeerIdBytes"],["source§impl<T> Serialize for [T; 32]where\n T: 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","iroh_docs::sync::PeerIdBytes"],["source§impl<const N: usize> Serialize for [u8; N]
source§fn serialize<S>(\n &self,\n serializer: S\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where\n S: Serializer,
","Serialize","iroh_docs::sync::PeerIdBytes"],["1.51.0 · source§impl<T, const N: usize> SlicePattern for [T; N]
","SlicePattern","iroh_docs::sync::PeerIdBytes"],["1.34.0 · source§impl<T, const N: usize> TryFrom<&[T]> for [T; N]where\n T: Copy,
Tries to create an array [T; N] by copying from a slice &[T]. Succeeds if\nslice.len() == N.
\n\nlet bytes: [u8; 3] = [1, 0, 2];\n\nlet bytes_head: [u8; 2] = <[u8; 2]>::try_from(&bytes[0..2]).unwrap();\nassert_eq!(1, u16::from_le_bytes(bytes_head));\n\nlet bytes_tail: [u8; 2] = bytes[1..3].try_into().unwrap();\nassert_eq!(512, u16::from_le_bytes(bytes_tail));
\n§type Error = TryFromSliceError
The type returned in the event of a conversion error.","TryFrom<&[T]>","iroh_docs::sync::PeerIdBytes"],["1.59.0 · source§impl<T, const N: usize> TryFrom<&mut [T]> for [T; N]where\n T: Copy,
Tries to create an array [T; N] by copying from a mutable slice &mut [T].\nSucceeds if slice.len() == N.
\n\nlet mut bytes: [u8; 3] = [1, 0, 2];\n\nlet bytes_head: [u8; 2] = <[u8; 2]>::try_from(&mut bytes[0..2]).unwrap();\nassert_eq!(1, u16::from_le_bytes(bytes_head));\n\nlet bytes_tail: [u8; 2] = (&mut bytes[1..3]).try_into().unwrap();\nassert_eq!(512, u16::from_le_bytes(bytes_tail));
\n§type Error = TryFromSliceError
The type returned in the event of a conversion error.","TryFrom<&mut [T]>","iroh_docs::sync::PeerIdBytes"],["§impl<T, A, const N: usize> TryFrom<Vec<T, A>> for [T; N]where\n A: Allocator,
§fn try_from(vec: Vec<T, A>) -> Result<[T; N], Vec<T, A>>
Gets the entire contents of the Vec<T> as an array,\nif its size exactly matches that of the requested array.
\n§Examples
\nassert_eq!(vec![1, 2, 3].try_into(), Ok([1, 2, 3]));\nassert_eq!(<Vec<i32>>::new().try_into(), Ok([]));
\nIf the length doesn’t match, the input comes back in Err:
\n\nlet r: Result<[i32; 4], _> = (0..10).collect::<Vec<_>>().try_into();\nassert_eq!(r, Err(vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9]));
\nIf you’re fine with just getting a prefix of the Vec<T>,\nyou can call .truncate(N) first.
\n\nlet mut v = String::from(\"hello world\").into_bytes();\nv.sort();\nv.truncate(2);\nlet [a, b]: [_; 2] = v.try_into().unwrap();\nassert_eq!(a, b' ');\nassert_eq!(b, b'd');
\n","TryFrom>","iroh_docs::sync::PeerIdBytes"],["1.48.0 · source§impl<T, A, const N: usize> TryFrom<Vec<T, A>> for [T; N]where\n A: Allocator,
source§fn try_from(vec: Vec<T, A>) -> Result<[T; N], Vec<T, A>>
Gets the entire contents of the Vec<T> as an array,\nif its size exactly matches that of the requested array.
\n§Examples
\nassert_eq!(vec![1, 2, 3].try_into(), Ok([1, 2, 3]));\nassert_eq!(<Vec<i32>>::new().try_into(), Ok([]));
\nIf the length doesn’t match, the input comes back in Err:
\n\nlet r: Result<[i32; 4], _> = (0..10).collect::<Vec<_>>().try_into();\nassert_eq!(r, Err(vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9]));
\nIf you’re fine with just getting a prefix of the Vec<T>,\nyou can call .truncate(N) first.
\n\nlet mut v = String::from(\"hello world\").into_bytes();\nv.sort();\nv.truncate(2);\nlet [a, b]: [_; 2] = v.try_into().unwrap();\nassert_eq!(a, b' ');\nassert_eq!(b, b'd');
\n","TryFrom>","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, T, E, const N: usize> TryJoin for [Fut; N]where\n Fut: IntoFuture<Output = Result<T, E>>,
§type Future = TryJoin<<Fut as IntoFuture>::IntoFuture, T, E, N>
Which kind of future are we turning this into?","TryJoin","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> Value for [T; N]where\n T: Value,
§type SelfType<'a> = [<T as Value>::SelfType<'a>; N]\nwhere\n [T; N]: 'a
SelfType<’a> must be the same type as Self with all lifetimes replaced with ’a§type AsBytes<'a> = Vec<u8>\nwhere\n [T; N]: 'a
§fn fixed_width() -> Option<usize>
Width of a fixed type, or None for variable width§fn from_bytes<'a>(data: &'a [u8]) -> [<T as Value>::SelfType<'a>; N]where\n [T; N]: 'a,
Deserializes data\nImplementations may return a view over data, or an owned type","Value","iroh_docs::sync::PeerIdBytes"],["","ValueOrd","iroh_docs::sync::PeerIdBytes"],["§impl<Z, const N: usize> Zeroize for [Z; N]where\n Z: Zeroize,
Impl [Zeroize] on arrays of types that impl [Zeroize].
\n","Zeroize","iroh_docs::sync::PeerIdBytes"],["","Zip","iroh_docs::sync::PeerIdBytes"],["source§impl<T, const N: usize> ConstParamTy for [T; N]where\n T: ConstParamTy,
","ConstParamTy","iroh_docs::sync::PeerIdBytes"],["1.58.0 · source§impl<T, const N: usize> Copy for [T; N]where\n T: Copy,
","Copy","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Eq for [T; N]where\n T: Eq,
","Eq","iroh_docs::sync::PeerIdBytes"],["source§impl<T, const N: usize> StructuralPartialEq for [T; N]
","StructuralPartialEq","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> Unaligned for [T; N]where\n T: Unaligned,
","Unaligned","iroh_docs::sync::PeerIdBytes"],["§impl<Z, const N: usize> ZeroizeOnDrop for [Z; N]where\n Z: ZeroizeOnDrop,
Impl [ZeroizeOnDrop] on arrays of types that impl [ZeroizeOnDrop].
\n","ZeroizeOnDrop","iroh_docs::sync::PeerIdBytes"]]
};if (window.register_type_impls) {window.register_type_impls(type_impls);} else {window.pending_type_impls = type_impls;}})()
\ No newline at end of file
Expand description
Progress updates for the validate operation
Variants§
Starting
started validating
Fields
total: u64The total number of entries to validate
@@ -62,7 +62,7 @@ Otherwise it might be an url or something else to uniquely identify the entry.AllDone
We are done with the whole operation.
-Abort(RpcError)
We got an error and need to abort.
+Abort(RpcError)
We got an error and need to abort.
Trait Implementations§
source§impl Debug for ValidateProgress
impl Debug for ValidateProgress
source§impl<'de> Deserialize<'de> for ValidateProgress
impl<'de> Deserialize<'de> for ValidateProgress
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for ValidateProgress
impl RefUnwindSafe for ValidateProgress
impl Send for ValidateProgress
impl Sync for ValidateProgress
impl Unpin for ValidateProgress
impl UnwindSafe for ValidateProgress
Blanket Implementations§
source§impl<T> Any for Twhere
diff --git a/pr/2595/docs/iroh_blobs/struct.Hash.html b/pr/2595/docs/iroh_blobs/struct.Hash.html
index 260e50d4b9..ba12d52876 100644
--- a/pr/2595/docs/iroh_blobs/struct.Hash.html
+++ b/pr/2595/docs/iroh_blobs/struct.Hash.html
@@ -1,36 +1,36 @@
-Hash in iroh_blobs - Rust Struct iroh_blobs::Hash
pub struct Hash(/* private fields */);
Expand description
Hash type used throughout.
-Implementations§
§impl Hash
pub const fn from_bytes(bytes: [u8; 32]) -> Hash
Create a Hash from its raw bytes representation.
-pub fn fmt_short(&self) -> String
Convert to a base32 string limited to the first 10 bytes for a friendly string
+
Hash in iroh_blobs - Rust Struct iroh_blobs::Hash
source · pub struct Hash(/* private fields */);
Expand description
Hash type used throughout.
+Implementations§
Trait Implementations§
Trait Implementations§
source§impl<'de> Deserialize<'de> for Hash
source§fn deserialize<D>(
deserializer: D
) -> Result<Hash, <D as Deserializer<'de>>::Error>where
- D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl FromIterator<Hash> for HashSeq
§impl Hash for Hash
§fn hash<__H>(&self, state: &mut __H)where
+ D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl FromIterator<Hash> for HashSeq
§impl MaxSize for Hash
§const POSTCARD_MAX_SIZE: usize = 32usize
The maximum possible size that the serialization of this
-type can have, in bytes.source§impl MaxSize for Hash
source§const POSTCARD_MAX_SIZE: usize = 32usize
The maximum possible size that the serialization of this
+type can have, in bytes.source§impl Ord for Hash
source§impl PartialEq for Hash
§impl PartialOrd for Hash
source§impl PartialOrd for Hash
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 <=
operator. Read moresource§impl Serialize for Hash
source§fn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
- S: Serializer,
Serialize this value into the given Serde serializer. Read more§impl Value for Hash
§type SelfType<'a> = Hash
SelfType<’a> must be the same type as Self with all lifetimes replaced with ’a§type AsBytes<'a> = &'a [u8; 32]
§fn fixed_width() -> Option<usize>
Width of a fixed type, or None for variable width§fn from_bytes<'a>(data: &'a [u8]) -> <Hash as Value>::SelfType<'a>where
+ S: Serializer,
Serialize this value into the given Serde serializer. Read moresource§impl Value for Hash
§type SelfType<'a> = Hash
SelfType<’a> must be the same type as Self with all lifetimes replaced with ’a§type AsBytes<'a> = &'a [u8; 32]
source§fn fixed_width() -> Option<usize>
Width of a fixed type, or None for variable width§impl Copy for Hash
§impl Eq for Hash
§impl StructuralPartialEq for Hash
Auto Trait Implementations§
§impl Freeze for Hash
§impl RefUnwindSafe for Hash
§impl Send for Hash
§impl Sync for Hash
§impl Unpin for Hash
§impl UnwindSafe for Hash
Blanket Implementations§
source§impl Copy for Hash
source§impl Eq for Hash
source§impl StructuralPartialEq for Hash
Auto Trait Implementations§
§impl Freeze for Hash
§impl RefUnwindSafe for Hash
§impl Send for Hash
§impl Sync for Hash
§impl Unpin for Hash
§impl UnwindSafe for Hash
Blanket Implementations§
§impl<A, T> AsBits<T> for A
§fn as_bits<O>(&self) -> &BitSlice<T, O>where
diff --git a/pr/2595/docs/iroh_blobs/struct.HashAndFormat.html b/pr/2595/docs/iroh_blobs/struct.HashAndFormat.html
index 8eb7ba64d5..421c7e1439 100644
--- a/pr/2595/docs/iroh_blobs/struct.HashAndFormat.html
+++ b/pr/2595/docs/iroh_blobs/struct.HashAndFormat.html
@@ -1,37 +1,37 @@
-HashAndFormat in iroh_blobs - Rust Struct iroh_blobs::HashAndFormat
pub struct HashAndFormat {
+HashAndFormat in iroh_blobs - Rust Struct iroh_blobs::HashAndFormat
source · pub struct HashAndFormat {
pub hash: Hash,
pub format: BlobFormat,
}
Expand description
A hash and format pair
Fields§
§hash: HashThe hash
§format: BlobFormatThe format
-Implementations§
§impl HashAndFormat
pub fn new(hash: Hash, format: BlobFormat) -> HashAndFormat
Create a new hash and format pair.
-pub fn raw(hash: Hash) -> HashAndFormat
Create a new hash and format pair, using the default (raw) format.
-pub fn hash_seq(hash: Hash) -> HashAndFormat
Create a new hash and format pair, using the collection format.
-Trait Implementations§
§impl Clone for HashAndFormat
§fn clone(&self) -> HashAndFormat
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more§impl Debug for HashAndFormat
§impl<'de> Deserialize<'de> for HashAndFormat
§fn deserialize<D>(
+
Implementations§
source§impl HashAndFormat
sourcepub fn new(hash: Hash, format: BlobFormat) -> HashAndFormat
Create a new hash and format pair.
+sourcepub fn raw(hash: Hash) -> HashAndFormat
Create a new hash and format pair, using the default (raw) format.
+sourcepub fn hash_seq(hash: Hash) -> HashAndFormat
Create a new hash and format pair, using the collection format.
+Trait Implementations§
source§impl Clone for HashAndFormat
source§fn clone(&self) -> HashAndFormat
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moresource§impl Debug for HashAndFormat
source§impl<'de> Deserialize<'de> for HashAndFormat
source§fn deserialize<D>(
deserializer: D
) -> Result<HashAndFormat, <D as Deserializer<'de>>::Error>where
- D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more§impl Display for HashAndFormat
source§impl From<DownloadKind> for HashAndFormat
source§fn from(value: DownloadKind) -> Self
Converts to this type from the input type.source§impl From<HashAndFormat> for DownloadKind
source§fn from(value: HashAndFormat) -> Self
Converts to this type from the input type.§impl FromStr for HashAndFormat
§impl Hash for HashAndFormat
§fn hash<__H>(&self, state: &mut __H)where
+ D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl Display for HashAndFormat
source§impl From<DownloadKind> for HashAndFormat
source§fn from(value: DownloadKind) -> Self
Converts to this type from the input type.source§impl From<HashAndFormat> for DownloadKind
source§fn from(value: HashAndFormat) -> Self
Converts to this type from the input type.source§impl FromStr for HashAndFormat
source§impl Hash for HashAndFormat
§impl MaxSize for HashAndFormat
§const POSTCARD_MAX_SIZE: usize = 33usize
The maximum possible size that the serialization of this
-type can have, in bytes.§impl Ord for HashAndFormat
source§impl MaxSize for HashAndFormat
source§const POSTCARD_MAX_SIZE: usize = 33usize
The maximum possible size that the serialization of this
+type can have, in bytes.source§impl Ord for HashAndFormat
source§fn cmp(&self, other: &HashAndFormat) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more§impl PartialEq for HashAndFormat
§fn eq(&self, other: &HashAndFormat) -> bool
Restrict a value to a certain interval. Read moresource§impl PartialEq for HashAndFormat
source§fn eq(&self, other: &HashAndFormat) -> bool
This method tests for self and other values to be equal, and is used
by ==.§impl PartialOrd for HashAndFormat
§fn partial_cmp(&self, other: &HashAndFormat) -> Option<Ordering>
source§impl PartialOrd for HashAndFormat
source§fn partial_cmp(&self, other: &HashAndFormat) -> Option<Ordering>
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 <=
operator. Read moresource§impl Serialize for HashAndFormat
source§fn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
- S: Serializer,
Serialize this value into the given Serde serializer. Read more§impl Value for HashAndFormat
§type SelfType<'a> = HashAndFormat
SelfType<’a> must be the same type as Self with all lifetimes replaced with ’a§type AsBytes<'a> = [u8; 33]
§fn fixed_width() -> Option<usize>
Width of a fixed type, or None for variable width§fn from_bytes<'a>(data: &'a [u8]) -> <HashAndFormat as Value>::SelfType<'a>where
+ S: Serializer,
Serialize this value into the given Serde serializer. Read moresource§impl Value for HashAndFormat
§type SelfType<'a> = HashAndFormat
SelfType<’a> must be the same type as Self with all lifetimes replaced with ’a§type AsBytes<'a> = [u8; 33]
source§fn fixed_width() -> Option<usize>
Width of a fixed type, or None for variable widthsource§fn from_bytes<'a>(data: &'a [u8]) -> <HashAndFormat as Value>::SelfType<'a>where
HashAndFormat: 'a,
Deserializes data
-Implementations may return a view over data, or an owned typesource§fn as_bytes<'a, 'b>(
value: &'a <HashAndFormat as Value>::SelfType<'b>
) -> <HashAndFormat as Value>::AsBytes<'a>where
'b: 'a,
- HashAndFormat: 'a + 'b,
Serialize the value to a slice§impl Copy for HashAndFormat
§impl Eq for HashAndFormat
§impl StructuralPartialEq for HashAndFormat
Auto Trait Implementations§
§impl Freeze for HashAndFormat
§impl RefUnwindSafe for HashAndFormat
§impl Send for HashAndFormat
§impl Sync for HashAndFormat
§impl Unpin for HashAndFormat
§impl UnwindSafe for HashAndFormat
Blanket Implementations§
source§impl<T> Any for Twhere
+ HashAndFormat: 'a + 'b,
Serialize the value to a slicesource§impl Copy for HashAndFormat
source§impl Eq for HashAndFormat
source§impl StructuralPartialEq for HashAndFormat
Auto Trait Implementations§
§impl Freeze for HashAndFormat
§impl RefUnwindSafe for HashAndFormat
§impl Send for HashAndFormat
§impl Sync for HashAndFormat
§impl Unpin for HashAndFormat
§impl UnwindSafe for HashAndFormat
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
diff --git a/pr/2595/docs/iroh_docs/actor/struct.SyncHandle.html b/pr/2595/docs/iroh_docs/actor/struct.SyncHandle.html
index cfd29c2ce8..6c70a0ff39 100644
--- a/pr/2595/docs/iroh_docs/actor/struct.SyncHandle.html
+++ b/pr/2595/docs/iroh_docs/actor/struct.SyncHandle.html
@@ -26,7 +26,7 @@ waiting for the actor to finish happens in an async context, and therefore that
namespace: NamespaceId,
author: AuthorId,
key: Bytes,
- hash: Hash,
+ hash: Hash,
len: u64
) -> Result<()>sourcepub async fn delete_prefix(
&self,
diff --git a/pr/2595/docs/iroh_docs/engine/enum.LiveEvent.html b/pr/2595/docs/iroh_docs/engine/enum.LiveEvent.html
index ceb8545b50..f0d33bcb21 100644
--- a/pr/2595/docs/iroh_docs/engine/enum.LiveEvent.html
+++ b/pr/2595/docs/iroh_docs/engine/enum.LiveEvent.html
@@ -3,34 +3,34 @@
entry: Entry,
},
InsertRemote {
- from: PublicKey,
+ from: PublicKey,
entry: Entry,
content_status: ContentStatus,
},
ContentReady {
- hash: Hash,
+ hash: Hash,
},
PendingContentReady,
- NeighborUp(PublicKey),
- NeighborDown(PublicKey),
+ NeighborUp(PublicKey),
+ NeighborDown(PublicKey),
SyncFinished(SyncEvent),
}Expand description
Events informing about actions of the live sync progress.
Variants§
§InsertLocal
A local insertion.
§InsertRemote
Received a remote insert.
-Fields
§from: PublicKeyThe peer that sent us the entry.
+Fields
§content_status: ContentStatusIf the content is available at the local node
§ContentReady
The content of an entry was downloaded and is now available at the local node
-Fields
§hash: HashThe content hash of the newly available entry content
+§PendingContentReady
All pending content is now ready.
This event signals that all queued content downloads from the last sync run have either
completed or failed.
It will only be emitted after a Self::SyncFinished event, never before.
Receiving this event does not guarantee that all content in the document is available. If
blobs failed to download, this event will still be emitted after all operations completed.
-§NeighborUp(PublicKey)
We have a new neighbor in the swarm.
-§NeighborDown(PublicKey)
We lost a neighbor in the swarm.
+§NeighborUp(PublicKey)
We have a new neighbor in the swarm.
+§NeighborDown(PublicKey)
We lost a neighbor in the swarm.
§SyncFinished(SyncEvent)
A set-reconciliation sync finished.
Trait Implementations§
source§impl<'de> Deserialize<'de> for LiveEvent
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl PartialEq for LiveEvent
source§fn eq(&self, other: &LiveEvent) -> bool
This method tests for self and other values to be equal, and is used
diff --git a/pr/2595/docs/iroh_docs/engine/fn.entry_to_content_status.html b/pr/2595/docs/iroh_docs/engine/fn.entry_to_content_status.html
index 459a6719d2..3b39df6428 100644
--- a/pr/2595/docs/iroh_docs/engine/fn.entry_to_content_status.html
+++ b/pr/2595/docs/iroh_docs/engine/fn.entry_to_content_status.html
@@ -1,2 +1,2 @@
-entry_to_content_status in iroh_docs::engine - Rust Function iroh_docs::engine::entry_to_content_status
source · pub fn entry_to_content_status(entry: Result<EntryStatus>) -> ContentStatus
Expand description
Converts an [EntryStatus] into a [‘ContentStatus’].
+entry_to_content_status in iroh_docs::engine - Rust Function iroh_docs::engine::entry_to_content_status
source · pub fn entry_to_content_status(entry: Result<EntryStatus>) -> ContentStatus
Expand description
Converts an EntryStatus into a [‘ContentStatus’].
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_docs/engine/index.html b/pr/2595/docs/iroh_docs/engine/index.html
index 5f78e23386..622ab4b871 100644
--- a/pr/2595/docs/iroh_docs/engine/index.html
+++ b/pr/2595/docs/iroh_docs/engine/index.html
@@ -1,4 +1,4 @@
iroh_docs::engine - Rust Expand description
Handlers and actors to for live syncing replicas.
crate::Replica is also called documents here.
Structs§
- Persistent default author for a docs engine.
- The sync engine coordinates actors that manage open documents, set-reconciliation syncs with
-peers and a gossip swarm for each syncing document.
- Event emitted when a sync operation completes
Enums§
- Where to persist the default author.
- Events informing about actions of the live sync progress.
- Why we performed a sync exchange
- Why we started a sync request
Functions§
- Converts an [
EntryStatus] into a [‘ContentStatus’].
\ No newline at end of file
+peers and a gossip swarm for each syncing document.Event emitted when a sync operation completes Enums§
- Where to persist the default author.
- Events informing about actions of the live sync progress.
- Why we performed a sync exchange
- Why we started a sync request
Functions§
- Converts an
EntryStatus into a [‘ContentStatus’].
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_docs/engine/struct.Engine.html b/pr/2595/docs/iroh_docs/engine/struct.Engine.html
index 1b88a96726..46cd25179e 100644
--- a/pr/2595/docs/iroh_docs/engine/struct.Engine.html
+++ b/pr/2595/docs/iroh_docs/engine/struct.Engine.html
@@ -8,12 +8,12 @@ peers and a gossip swarm for each syncing document.
Fields§
§endpoint: EndpointEndpoint used by the engine.
§sync: SyncHandleHandle to the actor thread.
The persistent default author for this engine.
-Implementations§
source§impl Engine
Implementations§
source§impl Engine
sourcepub async fn spawn<B: Store>(
endpoint: Endpoint,
- gossip: Gossip,
+ gossip: Gossip,
replica_store: Store,
bao_store: B,
- downloader: Downloader,
+ downloader: Downloader,
default_author_storage: DefaultAuthorStorage
) -> Result<Self>
Start the sync engine.
This will spawn two tokio tasks for the live sync coordination and gossip actors, and a
@@ -21,7 +21,7 @@ thread for the sourcepub async fn start_sync(
&self,
namespace: NamespaceId,
- peers: Vec<NodeAddr>
+ peers: Vec<NodeAddr>
) -> Result<()>
Start to sync a document.
If peers is non-empty, it will both do an initial set-reconciliation sync with each peer,
and join an iroh-gossip swarm with these peers to receive and broadcast document updates.
diff --git a/pr/2595/docs/iroh_docs/engine/struct.SyncEvent.html b/pr/2595/docs/iroh_docs/engine/struct.SyncEvent.html
index 49ba954022..d7eb730d81 100644
--- a/pr/2595/docs/iroh_docs/engine/struct.SyncEvent.html
+++ b/pr/2595/docs/iroh_docs/engine/struct.SyncEvent.html
@@ -1,11 +1,11 @@
SyncEvent in iroh_docs::engine - Rust pub struct SyncEvent {
- pub peer: PublicKey,
+ pub peer: PublicKey,
pub origin: Origin,
pub finished: SystemTime,
pub started: SystemTime,
pub result: Result<SyncDetails, String>,
}
Expand description
Event emitted when a sync operation completes
-Fields§
§peer: PublicKeyPeer we synced with
+Fields§
§peer: PublicKeyPeer we synced with
§origin: OriginOrigin of the sync exchange
§finished: SystemTimeTimestamp when the sync started
§started: SystemTimeTimestamp when the sync finished
diff --git a/pr/2595/docs/iroh_docs/index.html b/pr/2595/docs/iroh_docs/index.html
index a37d30e2a6..41c792c5e5 100644
--- a/pr/2595/docs/iroh_docs/index.html
+++ b/pr/2595/docs/iroh_docs/index.html
@@ -1,7 +1,7 @@
iroh_docs - Rust Expand description
Multi-dimensional key-value documents with an efficient synchronization protocol
The crate operates on Replicas. A replica contains an unlimited number of
Entries. Each entry is identified by a key, its author, and the replica’s
-namespace. Its value is the 32-byte BLAKE3 hash
+namespace. Its value is the 32-byte BLAKE3 hash
of the entry’s content data, the size of this content data, and a timestamp.
The content data itself is not stored or transferred through a replica.
All entries in a replica are signed with two keypairs:
diff --git a/pr/2595/docs/iroh_docs/net/enum.AcceptError.html b/pr/2595/docs/iroh_docs/net/enum.AcceptError.html
index 87e9a07ad3..cf11b5b695 100644
--- a/pr/2595/docs/iroh_docs/net/enum.AcceptError.html
+++ b/pr/2595/docs/iroh_docs/net/enum.AcceptError.html
@@ -3,31 +3,31 @@
error: Error,
},
Open {
- peer: PublicKey,
+ peer: PublicKey,
error: Error,
},
Abort {
- peer: PublicKey,
+ peer: PublicKey,
namespace: NamespaceId,
reason: AbortReason,
},
Sync {
- peer: PublicKey,
+ peer: PublicKey,
namespace: Option<NamespaceId>,
error: Error,
},
Close {
- peer: PublicKey,
+ peer: PublicKey,
namespace: Option<NamespaceId>,
error: Error,
},
}Expand description
Errors that may occur on handling incoming sync connections.
Variants§
§Connect
Failed to establish connection
§Open
Failed to open replica
-§Abort
We aborted the sync request.
-§Sync
Failed to run sync
-§Close
Failed to close
-Implementations§
source§impl AcceptError
Implementations§
Trait Implementations§
source§impl Debug for AcceptError
source§impl Display for AcceptError
source§impl Error for AcceptError
source§fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more1.0.0 · source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()Auto Trait Implementations§
§impl Freeze for AcceptError
§impl RefUnwindSafe for AcceptError
§impl Send for AcceptError
§impl Sync for AcceptError
§impl Unpin for AcceptError
§impl UnwindSafe for AcceptError
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
diff --git a/pr/2595/docs/iroh_docs/net/fn.connect_and_sync.html b/pr/2595/docs/iroh_docs/net/fn.connect_and_sync.html
index 1ee6909d53..7bec313309 100644
--- a/pr/2595/docs/iroh_docs/net/fn.connect_and_sync.html
+++ b/pr/2595/docs/iroh_docs/net/fn.connect_and_sync.html
@@ -2,6 +2,6 @@
endpoint: &Endpoint,
sync: &SyncHandle,
namespace: NamespaceId,
- peer: NodeAddr
+ peer: NodeAddr
) -> Result<SyncFinished, ConnectError>Expand description
Connect to a peer and sync a replica
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_docs/net/fn.handle_connection.html b/pr/2595/docs/iroh_docs/net/fn.handle_connection.html
index 347a0c22bf..e96816b362 100644
--- a/pr/2595/docs/iroh_docs/net/fn.handle_connection.html
+++ b/pr/2595/docs/iroh_docs/net/fn.handle_connection.html
@@ -3,6 +3,6 @@
connecting: Connecting,
accept_cb: F
) -> Result<SyncFinished, AcceptError>where
- F: Fn(NamespaceId, PublicKey) -> Fut,
+ F: Fn(NamespaceId, PublicKey) -> Fut,
Fut: Future<Output = AcceptOutcome>,Expand description
Handle an iroh-docs connection and sync all shared documents in the replica store.
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_docs/net/struct.SyncFinished.html b/pr/2595/docs/iroh_docs/net/struct.SyncFinished.html
index 74ab2f6632..dcd549e6fc 100644
--- a/pr/2595/docs/iroh_docs/net/struct.SyncFinished.html
+++ b/pr/2595/docs/iroh_docs/net/struct.SyncFinished.html
@@ -1,11 +1,11 @@
SyncFinished in iroh_docs::net - Rust Struct iroh_docs::net::SyncFinished
source · pub struct SyncFinished {
pub namespace: NamespaceId,
- pub peer: PublicKey,
+ pub peer: PublicKey,
pub outcome: SyncOutcome,
pub timings: Timings,
}
Expand description
Details of a finished sync operation.
Fields§
§namespace: NamespaceIdThe namespace that was synced.
-§peer: PublicKeyThe peer we syned with.
+§peer: PublicKeyThe peer we syned with.
§outcome: SyncOutcomeThe outcome of the sync operation
§timings: TimingsThe time this operation took
Trait Implementations§
source§impl Clone for SyncFinished
source§fn clone(&self) -> SyncFinished
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moreAuto Trait Implementations§
§impl Freeze for SyncFinished
§impl RefUnwindSafe for SyncFinished
§impl Send for SyncFinished
§impl Sync for SyncFinished
§impl Unpin for SyncFinished
§impl UnwindSafe for SyncFinished
Blanket Implementations§
source§impl<T> Any for Twhere
diff --git a/pr/2595/docs/iroh_docs/store/fs/struct.ContentHashesIterator.html b/pr/2595/docs/iroh_docs/store/fs/struct.ContentHashesIterator.html
index 8bebf68ec6..df1fc8865f 100644
--- a/pr/2595/docs/iroh_docs/store/fs/struct.ContentHashesIterator.html
+++ b/pr/2595/docs/iroh_docs/store/fs/struct.ContentHashesIterator.html
@@ -6,7 +6,7 @@ It needs a copy of a redb::ReadOnlyTable to be self-contained.
Implementations§
Trait Implementations§
source§impl Debug for ContentHashesIterator
Trait Implementations§
source§impl Debug for ContentHashesIterator
source§impl Iterator for ContentHashesIterator
source§fn next(&mut self) -> Option<Self::Item>
Advances the iterator and returns the next value. Read moresource§fn next_chunk<const N: usize>(
&mut self
) -> Result<[Self::Item; N], IntoIter<Self::Item, N>>where
Self: Sized,
🔬This is a nightly-only experimental API. (iter_next_chunk)Advances the iterator and returns an array containing the next N values. Read more1.0.0 · source§fn size_hint(&self) -> (usize, Option<usize>)
Returns the bounds on the remaining length of the iterator. Read more1.0.0 · source§fn count(self) -> usizewhere
diff --git a/pr/2595/docs/iroh_docs/struct.AuthorId.html b/pr/2595/docs/iroh_docs/struct.AuthorId.html
index 7dfa3dea5b..02221b0eb6 100644
--- a/pr/2595/docs/iroh_docs/struct.AuthorId.html
+++ b/pr/2595/docs/iroh_docs/struct.AuthorId.html
@@ -156,6 +156,6 @@ letters are used (e.g. F9B4CA)
Into<Dispatch>, source§fn with_current_subscriber(self) -> WithDispatch<Self>
source§impl<T> DeserializeOwned for Twhere
- T: for<'de> Deserialize<'de>,
§impl<T> PeerIdentity for Twhere
+ T: for<'de> Deserialize<'de>,
source§impl<T> PeerIdentity for T
source§impl<T> RuleType for T
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_docs/struct.AuthorPublicKey.html b/pr/2595/docs/iroh_docs/struct.AuthorPublicKey.html
index 8e72b11c8a..7a83ce68e4 100644
--- a/pr/2595/docs/iroh_docs/struct.AuthorPublicKey.html
+++ b/pr/2595/docs/iroh_docs/struct.AuthorPublicKey.html
@@ -148,6 +148,6 @@ builds. Into<Dispatch>,source§fn with_current_subscriber(self) -> WithDispatch<Self>
source§impl<T> DeserializeOwned for Twhere
- T: for<'de> Deserialize<'de>,
§impl<T> PeerIdentity for Twhere
+ T: for<'de> Deserialize<'de>,
source§impl<T> PeerIdentity for T
source§impl<T> RuleType for T
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_docs/struct.DocTicket.html b/pr/2595/docs/iroh_docs/struct.DocTicket.html
index d53a93c4c4..fd1bb5eb02 100644
--- a/pr/2595/docs/iroh_docs/struct.DocTicket.html
+++ b/pr/2595/docs/iroh_docs/struct.DocTicket.html
@@ -1,13 +1,13 @@
DocTicket in iroh_docs - Rust pub struct DocTicket {
pub capability: Capability,
- pub nodes: Vec<NodeAddr>,
+ pub nodes: Vec<NodeAddr>,
}
Expand description
Contains both a key (either secret or public) to a document, and a list of peers to join.
Fields§
§capability: Capabilityeither a public or private key
-§nodes: Vec<NodeAddr>A list of nodes to contact.
-Implementations§
source§impl DocTicket
sourcepub fn new(capability: Capability, peers: Vec<NodeAddr>) -> Self
Create a new doc ticket
+§nodes: Vec<NodeAddr>A list of nodes to contact.
+Implementations§
Trait Implementations§
source§impl<'de> Deserialize<'de> for DocTicket
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
- __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreAuto Trait Implementations§
§impl Freeze for DocTicket
§impl RefUnwindSafe for DocTicket
§impl Send for DocTicket
§impl Sync for DocTicket
§impl Unpin for DocTicket
§impl UnwindSafe for DocTicket
Blanket Implementations§
source§impl<T> Any for Twhere
+ __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreAuto Trait Implementations§
§impl Freeze for DocTicket
§impl RefUnwindSafe for DocTicket
§impl Send for DocTicket
§impl Sync for DocTicket
§impl Unpin for DocTicket
§impl UnwindSafe for DocTicket
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
diff --git a/pr/2595/docs/iroh_docs/struct.NamespaceId.html b/pr/2595/docs/iroh_docs/struct.NamespaceId.html
index 433d51afc6..f9acda8e94 100644
--- a/pr/2595/docs/iroh_docs/struct.NamespaceId.html
+++ b/pr/2595/docs/iroh_docs/struct.NamespaceId.html
@@ -156,6 +156,6 @@ letters are used (e.g. F9B4CA)
Into<Dispatch>, source§fn with_current_subscriber(self) -> WithDispatch<Self>
source§impl<T> DeserializeOwned for Twhere
- T: for<'de> Deserialize<'de>,
§impl<T> PeerIdentity for Twhere
+ T: for<'de> Deserialize<'de>,
source§impl<T> PeerIdentity for T
source§impl<T> RuleType for T
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_docs/struct.NamespacePublicKey.html b/pr/2595/docs/iroh_docs/struct.NamespacePublicKey.html
index 350dea9049..72b75ed510 100644
--- a/pr/2595/docs/iroh_docs/struct.NamespacePublicKey.html
+++ b/pr/2595/docs/iroh_docs/struct.NamespacePublicKey.html
@@ -147,6 +147,6 @@ builds.Into<Dispatch>,source§fn with_current_subscriber(self) -> WithDispatch<Self>
source§impl<T> DeserializeOwned for Twhere
- T: for<'de> Deserialize<'de>,
§impl<T> PeerIdentity for Twhere
+ T: for<'de> Deserialize<'de>,
source§impl<T> PeerIdentity for T
source§impl<T> RuleType for T
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_docs/sync/struct.Entry.html b/pr/2595/docs/iroh_docs/sync/struct.Entry.html
index 55bf06044f..055a4b6f54 100644
--- a/pr/2595/docs/iroh_docs/sync/struct.Entry.html
+++ b/pr/2595/docs/iroh_docs/sync/struct.Entry.html
@@ -1,6 +1,6 @@
Entry in iroh_docs::sync - Rust pub struct Entry { /* private fields */ }
Expand description
A single entry in a Replica
An entry is identified by a key, its Author, and the Replica’s
-NamespaceSecret. Its value is the 32-byte BLAKE3 hash
+NamespaceSecret. Its value is the 32-byte BLAKE3 hash
of the entry’s content data, the size of this content data, and a timestamp.
Implementations§
source§impl Entry
sourcepub fn new(id: RecordIdentifier, record: Record) -> Self
Create a new entry
sourcepub fn new_empty(id: RecordIdentifier) -> Self
Create a new empty entry with the current timestamp.
@@ -15,7 +15,7 @@ of the entry’s content data, the size of this content data, and a timestamp.
sourcepub fn sign(self, namespace: &NamespaceSecret, author: &Author) -> SignedEntry
Sign this entry with a NamespaceSecret and Author.
Methods from Deref<Target = Record>§
sourcepub fn content_len(&self) -> u64
Get the length of the data addressed by this record’s content hash.
-sourcepub fn content_hash(&self) -> Hash
Get the [struct@Hash] of the content data of this record.
+sourcepub fn content_hash(&self) -> Hash
Get the Hash of the content data of this record.
Trait Implementations§
source§impl<'de> Deserialize<'de> for Entry
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl From<SignedEntry> for Entry
source§fn from(value: SignedEntry) -> Self
Converts to this type from the input type.source§impl Ord for Entry
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
diff --git a/pr/2595/docs/iroh_docs/sync/struct.Record.html b/pr/2595/docs/iroh_docs/sync/struct.Record.html
index 94479a973e..f06cccab52 100644
--- a/pr/2595/docs/iroh_docs/sync/struct.Record.html
+++ b/pr/2595/docs/iroh_docs/sync/struct.Record.html
@@ -1,11 +1,11 @@
Record in iroh_docs::sync - Rust pub struct Record { /* private fields */ }
Expand description
The data part of an entry in a Replica.
-Implementations§
source§impl Record
Implementations§
source§impl Record
sourcepub fn empty_current() -> Self
Create a tombstone record with the timestamp set to now.
sourcepub fn new_current(hash: Hash, len: u64) -> Self
Create a new Record with the timestamp set to now.
+sourcepub fn new_current(hash: Hash, len: u64) -> Self
Create a new Record with the timestamp set to now.
sourcepub fn content_len(&self) -> u64
Get the length of the data addressed by this record’s content hash.
-sourcepub fn content_hash(&self) -> Hash
Get the [struct@Hash] of the content data of this record.
+sourcepub fn content_hash(&self) -> Hash
Get the Hash of the content data of this record.
Trait Implementations§
source§impl<'de> Deserialize<'de> for Record
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl Ord for Record
Ordering for entry values.
diff --git a/pr/2595/docs/iroh_docs/sync/struct.Replica.html b/pr/2595/docs/iroh_docs/sync/struct.Replica.html
index 23a9798651..c4e161f3c3 100644
--- a/pr/2595/docs/iroh_docs/sync/struct.Replica.html
+++ b/pr/2595/docs/iroh_docs/sync/struct.Replica.html
@@ -5,7 +5,7 @@
&mut self,
key: impl AsRef<[u8]>,
author: &Author,
- hash: Hash,
+ hash: Hash,
len: u64
) -> Result<usize, InsertError>Insert a new record at the given key.
The entry will by signed by the provided author.
@@ -35,7 +35,7 @@ or an error if the entry failed to validate or if a store operation failed.
key: impl AsRef<[u8]>,
author: &Author,
data: impl AsRef<[u8]>
-) -> Result<Hash, InsertError>Hashes the given data and inserts it.
+) -> Result<Hash, InsertError>Hashes the given data and inserts it.
This does not store the content, just the record of it.
Returns the calculated hash.
sourcepub fn record_id(
diff --git a/pr/2595/docs/iroh_docs/sync/struct.SignedEntry.html b/pr/2595/docs/iroh_docs/sync/struct.SignedEntry.html
index 21644eacb1..9ef5e98134 100644
--- a/pr/2595/docs/iroh_docs/sync/struct.SignedEntry.html
+++ b/pr/2595/docs/iroh_docs/sync/struct.SignedEntry.html
@@ -14,7 +14,7 @@
sourcepub fn signature(&self) -> &EntrySignature
Get the signature.
sourcepub fn validate_empty(&self) -> Result<(), ValidationFailure>
Validate that the entry has the empty hash if the length is 0, or a non-zero length.
sourcepub fn content_hash(&self) -> Hash
Get the content [struct@Hash] of the entry.
+sourcepub fn content_hash(&self) -> Hash
Get the content Hash of the entry.
sourcepub fn content_len(&self) -> u64
Get the content length of the entry.
Get the author bytes of this entry.
Methods from Deref<Target = Record>§
sourcepub fn content_len(&self) -> u64
Get the length of the data addressed by this record’s content hash.
-sourcepub fn content_hash(&self) -> Hash
Get the [struct@Hash] of the content data of this record.
+sourcepub fn content_hash(&self) -> Hash
Get the Hash of the content data of this record.
Trait Implementations§
source§impl Clone for SignedEntry
source§fn clone(&self) -> SignedEntry
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moresource§impl Debug for SignedEntry
source§impl Deref for SignedEntry
source§impl<'de> Deserialize<'de> for SignedEntry
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl From<SignedEntry> for Entry
source§fn from(value: SignedEntry) -> Self
Converts to this type from the input type.source§impl Ord for SignedEntry
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
diff --git a/pr/2595/docs/iroh_docs/sync/type.ContentStatusCallback.html b/pr/2595/docs/iroh_docs/sync/type.ContentStatusCallback.html
index 46d5a5a49c..84ffdbe8ee 100644
--- a/pr/2595/docs/iroh_docs/sync/type.ContentStatusCallback.html
+++ b/pr/2595/docs/iroh_docs/sync/type.ContentStatusCallback.html
@@ -1,2 +1,2 @@
-ContentStatusCallback in iroh_docs::sync - Rust Type Alias iroh_docs::sync::ContentStatusCallback
source · pub type ContentStatusCallback = Arc<dyn Fn(Hash) -> ContentStatus + Send + Sync + 'static>;
Expand description
Callback that may be set on a replica to determine the availability status for a content hash.
+ContentStatusCallback in iroh_docs::sync - Rust Type Alias iroh_docs::sync::ContentStatusCallback
source · pub type ContentStatusCallback = Arc<dyn Fn(Hash) -> ContentStatus + Send + Sync + 'static>;
Expand description
Callback that may be set on a replica to determine the availability status for a content hash.
Aliased Type§
struct ContentStatusCallback { /* private fields */ }
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_net/discovery/dns/index.html b/pr/2595/docs/iroh_net/discovery/dns/index.html
index 5a80538422..a752b49d78 100644
--- a/pr/2595/docs/iroh_net/discovery/dns/index.html
+++ b/pr/2595/docs/iroh_net/discovery/dns/index.html
@@ -1,2 +1,2 @@
-iroh_net::discovery::dns - Rust Expand description
DNS node discovery for iroh-net
+iroh_net::discovery::dns - Rust Expand description
DNS node discovery for iroh-net
Structs§
- DNS node discovery
Constants§
- The n0 testing DNS node origin, for production.
- The n0 testing DNS node origin, for testing.
- Testing DNS node origin, must run server from
crate::test_utils::DnsPkarrServer.
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_net/discovery/dns/struct.DnsDiscovery.html b/pr/2595/docs/iroh_net/discovery/dns/struct.DnsDiscovery.html
index 3e7d5d71cc..7628fb45a9 100644
--- a/pr/2595/docs/iroh_net/discovery/dns/struct.DnsDiscovery.html
+++ b/pr/2595/docs/iroh_net/discovery/dns/struct.DnsDiscovery.html
@@ -28,7 +28,7 @@ custom discovery mechanism.
For testing it is also possible to use the N0_DNS_NODE_ORIGIN_STAGING domain
with DnsDiscovery::new. This would then use a hosted discovery service again,
but for testing purposes.
-Trait Implementations§
Trait Implementations§
source§impl Debug for DnsDiscovery
source§impl Discovery for DnsDiscovery
source§fn resolve(
&self,
ep: Endpoint,
node_id: NodeId
diff --git a/pr/2595/docs/iroh_net/discovery/trait.Discovery.html b/pr/2595/docs/iroh_net/discovery/trait.Discovery.html
index a53a618708..d3832a56b5 100644
--- a/pr/2595/docs/iroh_net/discovery/trait.Discovery.html
+++ b/pr/2595/docs/iroh_net/discovery/trait.Discovery.html
@@ -29,4 +29,4 @@ These tasks will be run on the runtime of the Option<BoxStream<Result<DiscoveryItem>>>
Implementors§
source§impl Discovery for DnsDiscovery
source§impl Discovery for LocalSwarmDiscovery
source§impl Discovery for PkarrPublisher
source§impl Discovery for PkarrResolver
source§impl Discovery for ConcurrentDiscovery
\ No newline at end of file
+
Implementors§
source§impl Discovery for DnsDiscovery
source§impl Discovery for LocalSwarmDiscovery
source§impl Discovery for PkarrPublisher
source§impl Discovery for PkarrResolver
source§impl Discovery for ConcurrentDiscovery
\ No newline at end of file
diff --git a/pr/2595/docs/src/iroh_net/discovery/dns.rs.html b/pr/2595/docs/src/iroh_net/discovery/dns.rs.html
index dd1a279fb3..1d32545ed3 100644
--- a/pr/2595/docs/src/iroh_net/discovery/dns.rs.html
+++ b/pr/2595/docs/src/iroh_net/discovery/dns.rs.html
@@ -97,6 +97,10 @@
97
98
99
+100
+101
+102
+103
//! DNS node discovery for iroh-net
use anyhow::Result;
@@ -182,6 +186,10 @@
fn resolve(&self, ep: Endpoint, node_id: NodeId) -> Option<BoxStream<Result<DiscoveryItem>>> {
let resolver = ep.dns_resolver().clone();
let origin_domain = self.origin_domain.clone();
+ #[cfg(any(test, feature = "test-utils"))]
+ if origin_domain.contains(&TEST_DNS_NODE_ORIGIN.to_string()) {
+ panic!("wait. THIS IS ILLEGAL!");
+ }
let fut = async move {
let node_addr = resolver
.lookup_by_id_staggered(&node_id, &origin_domain, DNS_STAGGERING_MS)
diff --git a/pr/2595/docs/trait.impl/iroh_base/ticket/trait.Ticket.js b/pr/2595/docs/trait.impl/iroh_base/ticket/trait.Ticket.js
index 12fa1e3ee5..5d209fabd2 100644
--- a/pr/2595/docs/trait.impl/iroh_base/ticket/trait.Ticket.js
+++ b/pr/2595/docs/trait.impl/iroh_base/ticket/trait.Ticket.js
@@ -1,5 +1,5 @@
(function() {var implementors = {
"iroh":[],
"iroh_base":[],
-"iroh_docs":[["impl Ticket for DocTicket"]]
+"iroh_docs":[["impl Ticket for DocTicket"]]
};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
diff --git a/pr/2595/docs/type.impl/std/primitive.array.js b/pr/2595/docs/type.impl/std/primitive.array.js
index 588a8b53a3..3006964922 100644
--- a/pr/2595/docs/type.impl/std/primitive.array.js
+++ b/pr/2595/docs/type.impl/std/primitive.array.js
@@ -1,4 +1,4 @@
(function() {var type_impls = {
"iroh":[["source§impl<T, const N: usize> [T; N]
1.55.0 · sourcepub fn map<F, U>(self, f: F) -> [U; N]where\n F: FnMut(T) -> U,
Returns an array of the same size as self, with function f applied to each element\nin order.
\nIf you don’t necessarily need a new fixed-size array, consider using\nIterator::map instead.
\n§Note on performance and stack usage
\nUnfortunately, usages of this method are currently not always optimized\nas well as they could be. This mainly concerns large arrays, as mapping\nover small arrays seem to be optimized just fine. Also note that in\ndebug mode (i.e. without any optimizations), this method can use a lot\nof stack space (a few times the size of the array or more).
\nTherefore, in performance-critical code, try to avoid using this method\non large arrays or check the emitted code. Also try to avoid chained\nmaps (e.g. arr.map(...).map(...)).
\nIn many cases, you can instead use Iterator::map by calling .iter()\nor .into_iter() on your array. [T; N]::map is only necessary if you\nreally need a new array of the same size as the result. Rust’s lazy\niterators tend to get optimized very well.
\n§Examples
\nlet x = [1, 2, 3];\nlet y = x.map(|v| v + 1);\nassert_eq!(y, [2, 3, 4]);\n\nlet x = [1, 2, 3];\nlet mut temp = 0;\nlet y = x.map(|v| { temp += 1; v * temp });\nassert_eq!(y, [1, 4, 9]);\n\nlet x = [\"Ferris\", \"Bueller's\", \"Day\", \"Off\"];\nlet y = x.map(|v| v.len());\nassert_eq!(y, [6, 9, 3, 3]);
\nsourcepub fn try_map<F, R>(\n self,\n f: F\n) -> <<R as Try>::Residual as Residual<[<R as Try>::Output; N]>>::TryType
🔬This is a nightly-only experimental API. (array_try_map)
A fallible function f applied to each element on array self in order to\nreturn an array the same size as self or the first error encountered.
\nThe return type of this function depends on the return type of the closure.\nIf you return Result<T, E> from the closure, you’ll get a Result<[T; N], E>.\nIf you return Option<T> from the closure, you’ll get an Option<[T; N]>.
\n§Examples
\n#![feature(array_try_map)]\n\nlet a = [\"1\", \"2\", \"3\"];\nlet b = a.try_map(|v| v.parse::<u32>()).unwrap().map(|v| v + 1);\nassert_eq!(b, [2, 3, 4]);\n\nlet a = [\"1\", \"2a\", \"3\"];\nlet b = a.try_map(|v| v.parse::<u32>());\nassert!(b.is_err());\n\nuse std::num::NonZero;\n\nlet z = [1, 2, 0, 3, 4];\nassert_eq!(z.try_map(NonZero::new), None);\n\nlet a = [1, 2, 3];\nlet b = a.try_map(NonZero::new);\nlet c = b.map(|x| x.map(NonZero::get));\nassert_eq!(c, Some(a));
\n1.57.0 (const: 1.57.0) · sourcepub const fn as_slice(&self) -> &[T]
Returns a slice containing the entire array. Equivalent to &s[..].
\n1.57.0 · sourcepub fn as_mut_slice(&mut self) -> &mut [T]
Returns a mutable slice containing the entire array. Equivalent to\n&mut s[..].
\n1.77.0 · sourcepub fn each_ref(&self) -> [&T; N]
Borrows each element and returns an array of references with the same\nsize as self.
\n§Example
\nlet floats = [3.1, 2.7, -1.0];\nlet float_refs: [&f64; 3] = floats.each_ref();\nassert_eq!(float_refs, [&3.1, &2.7, &-1.0]);
\nThis method is particularly useful if combined with other methods, like\nmap. This way, you can avoid moving the original\narray if its elements are not Copy.
\n\nlet strings = [\"Ferris\".to_string(), \"♥\".to_string(), \"Rust\".to_string()];\nlet is_ascii = strings.each_ref().map(|s| s.is_ascii());\nassert_eq!(is_ascii, [true, false, true]);\n\n// We can still access the original array: it has not been moved.\nassert_eq!(strings.len(), 3);
\n1.77.0 · sourcepub fn each_mut(&mut self) -> [&mut T; N]
Borrows each element mutably and returns an array of mutable references\nwith the same size as self.
\n§Example
\n\nlet mut floats = [3.1, 2.7, -1.0];\nlet float_refs: [&mut f64; 3] = floats.each_mut();\n*float_refs[0] = 0.0;\nassert_eq!(float_refs, [&mut 0.0, &mut 2.7, &mut -1.0]);\nassert_eq!(floats, [0.0, 2.7, -1.0]);
\nsourcepub fn split_array_ref<const M: usize>(&self) -> (&[T; M], &[T])
🔬This is a nightly-only experimental API. (split_array)
Divides one array reference into two at an index.
\nThe first will contain all indices from [0, M) (excluding\nthe index M itself) and the second will contain all\nindices from [M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet v = [1, 2, 3, 4, 5, 6];\n\n{\n let (left, right) = v.split_array_ref::<0>();\n assert_eq!(left, &[]);\n assert_eq!(right, &[1, 2, 3, 4, 5, 6]);\n}\n\n{\n let (left, right) = v.split_array_ref::<2>();\n assert_eq!(left, &[1, 2]);\n assert_eq!(right, &[3, 4, 5, 6]);\n}\n\n{\n let (left, right) = v.split_array_ref::<6>();\n assert_eq!(left, &[1, 2, 3, 4, 5, 6]);\n assert_eq!(right, &[]);\n}
\nsourcepub fn split_array_mut<const M: usize>(&mut self) -> (&mut [T; M], &mut [T])
🔬This is a nightly-only experimental API. (split_array)
Divides one mutable array reference into two at an index.
\nThe first will contain all indices from [0, M) (excluding\nthe index M itself) and the second will contain all\nindices from [M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet mut v = [1, 0, 3, 0, 5, 6];\nlet (left, right) = v.split_array_mut::<2>();\nassert_eq!(left, &mut [1, 0][..]);\nassert_eq!(right, &mut [3, 0, 5, 6]);\nleft[1] = 2;\nright[1] = 4;\nassert_eq!(v, [1, 2, 3, 4, 5, 6]);
\nsourcepub fn rsplit_array_ref<const M: usize>(&self) -> (&[T], &[T; M])
🔬This is a nightly-only experimental API. (split_array)
Divides one array reference into two at an index from the end.
\nThe first will contain all indices from [0, N - M) (excluding\nthe index N - M itself) and the second will contain all\nindices from [N - M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet v = [1, 2, 3, 4, 5, 6];\n\n{\n let (left, right) = v.rsplit_array_ref::<0>();\n assert_eq!(left, &[1, 2, 3, 4, 5, 6]);\n assert_eq!(right, &[]);\n}\n\n{\n let (left, right) = v.rsplit_array_ref::<2>();\n assert_eq!(left, &[1, 2, 3, 4]);\n assert_eq!(right, &[5, 6]);\n}\n\n{\n let (left, right) = v.rsplit_array_ref::<6>();\n assert_eq!(left, &[]);\n assert_eq!(right, &[1, 2, 3, 4, 5, 6]);\n}
\nsourcepub fn rsplit_array_mut<const M: usize>(&mut self) -> (&mut [T], &mut [T; M])
🔬This is a nightly-only experimental API. (split_array)
Divides one mutable array reference into two at an index from the end.
\nThe first will contain all indices from [0, N - M) (excluding\nthe index N - M itself) and the second will contain all\nindices from [N - M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet mut v = [1, 0, 3, 0, 5, 6];\nlet (left, right) = v.rsplit_array_mut::<4>();\nassert_eq!(left, &mut [1, 0]);\nassert_eq!(right, &mut [3, 0, 5, 6][..]);\nleft[1] = 2;\nright[1] = 4;\nassert_eq!(v, [1, 2, 3, 4, 5, 6]);
\n",0,"iroh::docs::PeerIdBytes"],["source§impl<const N: usize> [u8; N]
sourcepub const fn as_ascii(&self) -> Option<&[AsciiChar; N]>
🔬This is a nightly-only experimental API. (ascii_char)
Converts this array of bytes into a array of ASCII characters,\nor returns None if any of the characters is non-ASCII.
\n§Examples
\n#![feature(ascii_char)]\n#![feature(const_option)]\n\nconst HEX_DIGITS: [std::ascii::Char; 16] =\n *b\"0123456789abcdef\".as_ascii().unwrap();\n\nassert_eq!(HEX_DIGITS[1].as_str(), \"1\");\nassert_eq!(HEX_DIGITS[10].as_str(), \"a\");
\nsourcepub const unsafe fn as_ascii_unchecked(&self) -> &[AsciiChar; N]
🔬This is a nightly-only experimental API. (ascii_char)
Converts this array of bytes into a array of ASCII characters,\nwithout checking whether they’re valid.
\n§Safety
\nEvery byte in the array must be in 0..=127, or else this is UB.
\n",0,"iroh::docs::PeerIdBytes"],["§impl<T> Array for [T; 32]where\n T: Default,
§fn as_slice_mut(&mut self) -> &mut [T]
Gives a unique slice over the whole thing. Read more","Array","iroh::docs::PeerIdBytes"],["","Array","iroh::docs::PeerIdBytes"],["§impl<const N: usize, T> AsBytes for [T; N]where\n T: AsBytes,
§fn write_to_prefix(&self, bytes: &mut [u8]) -> Option<()>
","AsBytes","iroh::docs::PeerIdBytes"],["","AsBytes","iroh::docs::PeerIdBytes"],["","AsMut<[T]>","iroh::docs::PeerIdBytes"],["","AsRef<[T]>","iroh::docs::PeerIdBytes"],["§impl<T, const N: usize> BitView for [T; N]where\n T: BitStore,
Note that overly-large arrays may cause the conversions to fail.
\n§fn view_bits<O>(&self) -> &BitSlice<T, O>where\n O: BitOrder,
Views a memory region as an immutable bit-slice.§fn try_view_bits<O>(&self) -> Result<&BitSlice<T, O>, BitSpanError<T>>where\n O: BitOrder,
Attempts to view a memory region as an immutable bit-slice. Read more§fn view_bits_mut<O>(&mut self) -> &mut BitSlice<T, O>where\n O: BitOrder,
Views a memory region as a mutable bit-slice.§fn try_view_bits_mut<O>(\n &mut self\n) -> Result<&mut BitSlice<T, O>, BitSpanError<T>>where\n O: BitOrder,
Attempts to view a memory region as a mutable bit-slice. Read more","BitView","iroh::docs::PeerIdBytes"],["§impl<T, const N: usize> BitViewSized for [T; N]where\n T: BitStore,
§fn as_raw_slice(&self) -> &[<[T; N] as BitView>::Store]
Views the type as a slice of its elements.§fn as_raw_mut_slice(&mut self) -> &mut [<[T; N] as BitView>::Store]
Views the type as a mutable slice of its elements.§fn into_bitarray<O>(self) -> BitArray<Self, O>where\n O: BitOrder,
Wraps self in a BitArray.","BitViewSized","iroh::docs::PeerIdBytes"],["","Borrow<[T]>","iroh::docs::PeerIdBytes"],["1.4.0 · source§impl<T, const N: usize> BorrowMut<[T]> for [T; N]
source§fn borrow_mut(&mut self) -> &mut [T]
Mutably borrows from an owned value. Read more","BorrowMut<[T]>","iroh::docs::PeerIdBytes"],["","Chain","iroh::docs::PeerIdBytes"],["","Clone","iroh::docs::PeerIdBytes"],["","Debug","iroh::docs::PeerIdBytes"],["§impl<const N: usize> Decode for [u8; N]
Decodes a byte array from byte[n] as described in RFC4251 § 5:
\n\nA byte represents an arbitrary 8-bit value (octet). Fixed length\ndata is sometimes represented as an array of bytes, written\nbyte[n], where n is the number of bytes in the array.
\n
\n","Decode","iroh::docs::PeerIdBytes"],["§impl<'a, T, const N: usize> DecodeValue<'a> for [T; N]where\n T: Decode<'a>,
§fn decode_value<R>(reader: &mut R, header: Header) -> Result<[T; N], Error>where\n R: Reader<'a>,
Attempt to decode this message using the provided [Reader].","DecodeValue<'a>","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["source§impl<'de, T> Deserialize<'de> for [T; 32]where\n T: Deserialize<'de>,
source§fn deserialize<D>(\n deserializer: D\n) -> Result<[T; 32], <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more","Deserialize<'de>","iroh::docs::PeerIdBytes"],["source§impl<'de, const N: usize> Deserialize<'de> for [u8; N]
source§fn deserialize<D>(\n deserializer: D\n) -> Result<[u8; N], <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
","Deserialize<'de>","iroh::docs::PeerIdBytes"],["§impl<const N: usize> Encode for [u8; N]
Encodes [u8; N] into byte[n] as described in RFC4251 § 5:
\n\nA byte represents an arbitrary 8-bit value (octet). Fixed length\ndata is sometimes represented as an array of bytes, written\nbyte[n], where n is the number of bytes in the array.
\n
\n§fn encoded_len(&self) -> Result<usize, Error>
Get the length of this type encoded in bytes, prior to Base64 encoding.§fn encode(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value using the provided [Writer].§fn encoded_len_prefixed(&self) -> Result<usize, Error>
Return the length of this type after encoding when prepended with a\nuint32 length prefix.§fn encode_prefixed(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value, first prepending a uint32 length prefix\nset to [Encode::encoded_len].","Encode","iroh::docs::PeerIdBytes"],["","EncodeLabelSet","iroh::docs::PeerIdBytes"],["§impl<T, const N: usize> EncodeValue for [T; N]where\n T: Encode,
","EncodeValue","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["§impl<'a> FindToken<&'a u8> for [u8; 32]
§fn find_token(&self, token: &u8) -> bool
Returns true if self contains the token","FindToken<&'a u8>","iroh::docs::PeerIdBytes"],["§impl FindToken<u8> for [u8; 32]
§fn find_token(&self, token: u8) -> bool
Returns true if self contains the token","FindToken","iroh::docs::PeerIdBytes"],["","FixedTag","iroh::docs::PeerIdBytes"],["","From<&Signature>","iroh::docs::PeerIdBytes"],["","From","iroh::docs::PeerIdBytes"],["§impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>>> for [T; 32]
","From, B0>, B0>, B0>, B0>, B0>>>","iroh::docs::PeerIdBytes"],["","From","iroh::docs::PeerIdBytes"],["","From","iroh::docs::PeerIdBytes"],["","From>","iroh::docs::PeerIdBytes"],["","From","iroh::docs::PeerIdBytes"],["","From","iroh::docs::PeerIdBytes"],["","From","iroh::docs::PeerIdBytes"],["","From>","iroh::docs::PeerIdBytes"],["§impl<const N: usize, T> FromBytes for [T; N]where\n T: FromBytes,
§fn slice_from_prefix(bytes: &[u8], count: usize) -> Option<(&[Self], &[u8])>where\n Self: Sized,
Interprets the prefix of the given bytes as a &[Self] with length\nequal to count without copying. Read more§fn slice_from_suffix(bytes: &[u8], count: usize) -> Option<(&[u8], &[Self])>where\n Self: Sized,
Interprets the suffix of the given bytes as a &[Self] with length\nequal to count without copying. Read more§fn read_from_prefix(bytes: &[u8]) -> Option<Self>where\n Self: Sized,
","FromBytes","iroh::docs::PeerIdBytes"],["","FromHex","iroh::docs::PeerIdBytes"],["","FromZeroes","iroh::docs::PeerIdBytes"],["","Hash","iroh::docs::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Hash for [T; N]where\n T: Hash,
The hash of an array is the same as that of the corresponding slice,\nas required by the Borrow implementation.
\n\nuse std::hash::BuildHasher;\n\nlet b = std::hash::RandomState::new();\nlet a: [u8; 3] = [0xa8, 0x3c, 0x09];\nlet s: &[u8] = &[0xa8, 0x3c, 0x09];\nassert_eq!(b.hash_one(a), b.hash_one(s));
\n","Hash","iroh::docs::PeerIdBytes"],["","Index","iroh::docs::PeerIdBytes"],["","IndexMut","iroh::docs::PeerIdBytes"],["","InputLength","iroh::docs::PeerIdBytes"],["1.53.0 · source§impl<T, const N: usize> IntoIterator for [T; N]
source§fn into_iter(self) -> <[T; N] as IntoIterator>::IntoIter
Creates a consuming iterator, that is, one that moves each value out of\nthe array (from start to end). The array cannot be used after calling\nthis unless T implements Copy, so the whole array is copied.
\nArrays have special behavior when calling .into_iter() prior to the\n2021 edition – see the array Editions section for more information.
\n","IntoIterator","iroh::docs::PeerIdBytes"],["§impl<const N: usize> IntoResponse for [u8; N]
§fn into_response(self) -> Response<Body>
Create a response.","IntoResponse","iroh::docs::PeerIdBytes"],["§impl<Fut, const N: usize> Join for [Fut; N]where\n Fut: IntoFuture,
§type Output = [<Fut as IntoFuture>::Output; N]
The resulting output type.§type Future = Join<<Fut as IntoFuture>::IntoFuture, N>
The Future implementation returned by this method.","Join","iroh::docs::PeerIdBytes"],["","Key","iroh::docs::PeerIdBytes"],["§impl<T, const N: usize> MaxSize for [T; N]where\n T: MaxSize,
§const POSTCARD_MAX_SIZE: usize = _
The maximum possible size that the serialization of this\ntype can have, in bytes.","MaxSize","iroh::docs::PeerIdBytes"],["","Merge","iroh::docs::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Ord for [T; N]where\n T: Ord,
Implements comparison of arrays lexicographically.
\n1.21.0 · source§fn max(self, other: Self) -> Selfwhere\n Self: Sized,
Compares and returns the maximum of two values. Read more","Ord","iroh::docs::PeerIdBytes"],["","PartialEq<&[U]>","iroh::docs::PeerIdBytes"],["1.0.0 · source§impl<T, U, const N: usize> PartialEq<&mut [U]> for [T; N]where\n T: PartialEq<U>,
","PartialEq<&mut [U]>","iroh::docs::PeerIdBytes"],["","PartialEq<[U]>","iroh::docs::PeerIdBytes"],["","PartialEq<[U; N]>","iroh::docs::PeerIdBytes"],["","PartialEq","iroh::docs::PeerIdBytes"],["§impl<A, B, const N: usize, const M: usize> PartialEq<Vec<A, N>> for [B; M]where\n A: PartialEq<B>,
","PartialEq>","iroh::docs::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> PartialOrd for [T; N]where\n T: PartialOrd,
Implements comparison of arrays lexicographically.
\nsource§fn le(&self, other: &[T; N]) -> bool
This method tests less than or equal to (for self and other) and is used by the <=\noperator. Read more","PartialOrd","iroh::docs::PeerIdBytes"],["§impl<Fut, const N: usize> Race for [Fut; N]where\n Fut: IntoFuture,
§type Output = <Fut as IntoFuture>::Output
The resulting output type.§type Future = Race<<Fut as IntoFuture>::IntoFuture, N>
Which kind of future are we turning this into?","Race","iroh::docs::PeerIdBytes"],["§impl<Fut, T, E, const N: usize> RaceOk for [Fut; N]where\n Fut: IntoFuture<Output = Result<T, E>>,
§type Future = RaceOk<<Fut as IntoFuture>::IntoFuture, T, E, N>
Which kind of future are we turning this into?","RaceOk","iroh::docs::PeerIdBytes"],["","Schema","iroh::docs::PeerIdBytes"],["source§impl<T> Serialize for [T; 32]where\n T: 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","iroh::docs::PeerIdBytes"],["source§impl<const N: usize> Serialize for [u8; N]
source§fn serialize<S>(\n &self,\n serializer: S\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where\n S: Serializer,
","Serialize","iroh::docs::PeerIdBytes"],["1.51.0 · source§impl<T, const N: usize> SlicePattern for [T; N]
","SlicePattern","iroh::docs::PeerIdBytes"],["1.34.0 · source§impl<T, const N: usize> TryFrom<&[T]> for [T; N]where\n T: Copy,
Tries to create an array [T; N] by copying from a slice &[T]. Succeeds if\nslice.len() == N.
\n\nlet bytes: [u8; 3] = [1, 0, 2];\n\nlet bytes_head: [u8; 2] = <[u8; 2]>::try_from(&bytes[0..2]).unwrap();\nassert_eq!(1, u16::from_le_bytes(bytes_head));\n\nlet bytes_tail: [u8; 2] = bytes[1..3].try_into().unwrap();\nassert_eq!(512, u16::from_le_bytes(bytes_tail));
\n§type Error = TryFromSliceError
The type returned in the event of a conversion error.","TryFrom<&[T]>","iroh::docs::PeerIdBytes"],["1.59.0 · source§impl<T, const N: usize> TryFrom<&mut [T]> for [T; N]where\n T: Copy,
Tries to create an array [T; N] by copying from a mutable slice &mut [T].\nSucceeds if slice.len() == N.
\n\nlet mut bytes: [u8; 3] = [1, 0, 2];\n\nlet bytes_head: [u8; 2] = <[u8; 2]>::try_from(&mut bytes[0..2]).unwrap();\nassert_eq!(1, u16::from_le_bytes(bytes_head));\n\nlet bytes_tail: [u8; 2] = (&mut bytes[1..3]).try_into().unwrap();\nassert_eq!(512, u16::from_le_bytes(bytes_tail));
\n§type Error = TryFromSliceError
The type returned in the event of a conversion error.","TryFrom<&mut [T]>","iroh::docs::PeerIdBytes"],["§impl<T, A, const N: usize> TryFrom<Vec<T, A>> for [T; N]where\n A: Allocator,
§fn try_from(vec: Vec<T, A>) -> Result<[T; N], Vec<T, A>>
Gets the entire contents of the Vec<T> as an array,\nif its size exactly matches that of the requested array.
\n§Examples
\nassert_eq!(vec![1, 2, 3].try_into(), Ok([1, 2, 3]));\nassert_eq!(<Vec<i32>>::new().try_into(), Ok([]));
\nIf the length doesn’t match, the input comes back in Err:
\n\nlet r: Result<[i32; 4], _> = (0..10).collect::<Vec<_>>().try_into();\nassert_eq!(r, Err(vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9]));
\nIf you’re fine with just getting a prefix of the Vec<T>,\nyou can call .truncate(N) first.
\n\nlet mut v = String::from(\"hello world\").into_bytes();\nv.sort();\nv.truncate(2);\nlet [a, b]: [_; 2] = v.try_into().unwrap();\nassert_eq!(a, b' ');\nassert_eq!(b, b'd');
\n","TryFrom>","iroh::docs::PeerIdBytes"],["1.48.0 · source§impl<T, A, const N: usize> TryFrom<Vec<T, A>> for [T; N]where\n A: Allocator,
source§fn try_from(vec: Vec<T, A>) -> Result<[T; N], Vec<T, A>>
Gets the entire contents of the Vec<T> as an array,\nif its size exactly matches that of the requested array.
\n§Examples
\nassert_eq!(vec![1, 2, 3].try_into(), Ok([1, 2, 3]));\nassert_eq!(<Vec<i32>>::new().try_into(), Ok([]));
\nIf the length doesn’t match, the input comes back in Err:
\n\nlet r: Result<[i32; 4], _> = (0..10).collect::<Vec<_>>().try_into();\nassert_eq!(r, Err(vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9]));
\nIf you’re fine with just getting a prefix of the Vec<T>,\nyou can call .truncate(N) first.
\n\nlet mut v = String::from(\"hello world\").into_bytes();\nv.sort();\nv.truncate(2);\nlet [a, b]: [_; 2] = v.try_into().unwrap();\nassert_eq!(a, b' ');\nassert_eq!(b, b'd');
\n","TryFrom>","iroh::docs::PeerIdBytes"],["§impl<Fut, T, E, const N: usize> TryJoin for [Fut; N]where\n Fut: IntoFuture<Output = Result<T, E>>,
§type Future = TryJoin<<Fut as IntoFuture>::IntoFuture, T, E, N>
Which kind of future are we turning this into?","TryJoin","iroh::docs::PeerIdBytes"],["§impl<const N: usize, T> Value for [T; N]where\n T: Value,
§type SelfType<'a> = [<T as Value>::SelfType<'a>; N]\nwhere\n [T; N]: 'a
SelfType<’a> must be the same type as Self with all lifetimes replaced with ’a§type AsBytes<'a> = Vec<u8>\nwhere\n [T; N]: 'a
§fn fixed_width() -> Option<usize>
Width of a fixed type, or None for variable width§fn from_bytes<'a>(data: &'a [u8]) -> [<T as Value>::SelfType<'a>; N]where\n [T; N]: 'a,
Deserializes data\nImplementations may return a view over data, or an owned type","Value","iroh::docs::PeerIdBytes"],["","ValueOrd","iroh::docs::PeerIdBytes"],["§impl<Z, const N: usize> Zeroize for [Z; N]where\n Z: Zeroize,
Impl [Zeroize] on arrays of types that impl [Zeroize].
\n","Zeroize","iroh::docs::PeerIdBytes"],["","Zip","iroh::docs::PeerIdBytes"],["source§impl<T, const N: usize> ConstParamTy for [T; N]where\n T: ConstParamTy,
","ConstParamTy","iroh::docs::PeerIdBytes"],["1.58.0 · source§impl<T, const N: usize> Copy for [T; N]where\n T: Copy,
","Copy","iroh::docs::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Eq for [T; N]where\n T: Eq,
","Eq","iroh::docs::PeerIdBytes"],["source§impl<T, const N: usize> StructuralPartialEq for [T; N]
","StructuralPartialEq","iroh::docs::PeerIdBytes"],["§impl<const N: usize, T> Unaligned for [T; N]where\n T: Unaligned,
","Unaligned","iroh::docs::PeerIdBytes"],["§impl<Z, const N: usize> ZeroizeOnDrop for [Z; N]where\n Z: ZeroizeOnDrop,
Impl [ZeroizeOnDrop] on arrays of types that impl [ZeroizeOnDrop].
\n","ZeroizeOnDrop","iroh::docs::PeerIdBytes"]],
-"iroh_docs":[["source§impl<T, const N: usize> [T; N]
1.55.0 · sourcepub fn map<F, U>(self, f: F) -> [U; N]where\n F: FnMut(T) -> U,
Returns an array of the same size as self, with function f applied to each element\nin order.
\nIf you don’t necessarily need a new fixed-size array, consider using\nIterator::map instead.
\n§Note on performance and stack usage
\nUnfortunately, usages of this method are currently not always optimized\nas well as they could be. This mainly concerns large arrays, as mapping\nover small arrays seem to be optimized just fine. Also note that in\ndebug mode (i.e. without any optimizations), this method can use a lot\nof stack space (a few times the size of the array or more).
\nTherefore, in performance-critical code, try to avoid using this method\non large arrays or check the emitted code. Also try to avoid chained\nmaps (e.g. arr.map(...).map(...)).
\nIn many cases, you can instead use Iterator::map by calling .iter()\nor .into_iter() on your array. [T; N]::map is only necessary if you\nreally need a new array of the same size as the result. Rust’s lazy\niterators tend to get optimized very well.
\n§Examples
\nlet x = [1, 2, 3];\nlet y = x.map(|v| v + 1);\nassert_eq!(y, [2, 3, 4]);\n\nlet x = [1, 2, 3];\nlet mut temp = 0;\nlet y = x.map(|v| { temp += 1; v * temp });\nassert_eq!(y, [1, 4, 9]);\n\nlet x = [\"Ferris\", \"Bueller's\", \"Day\", \"Off\"];\nlet y = x.map(|v| v.len());\nassert_eq!(y, [6, 9, 3, 3]);
\nsourcepub fn try_map<F, R>(\n self,\n f: F\n) -> <<R as Try>::Residual as Residual<[<R as Try>::Output; N]>>::TryType
🔬This is a nightly-only experimental API. (array_try_map)
A fallible function f applied to each element on array self in order to\nreturn an array the same size as self or the first error encountered.
\nThe return type of this function depends on the return type of the closure.\nIf you return Result<T, E> from the closure, you’ll get a Result<[T; N], E>.\nIf you return Option<T> from the closure, you’ll get an Option<[T; N]>.
\n§Examples
\n#![feature(array_try_map)]\n\nlet a = [\"1\", \"2\", \"3\"];\nlet b = a.try_map(|v| v.parse::<u32>()).unwrap().map(|v| v + 1);\nassert_eq!(b, [2, 3, 4]);\n\nlet a = [\"1\", \"2a\", \"3\"];\nlet b = a.try_map(|v| v.parse::<u32>());\nassert!(b.is_err());\n\nuse std::num::NonZero;\n\nlet z = [1, 2, 0, 3, 4];\nassert_eq!(z.try_map(NonZero::new), None);\n\nlet a = [1, 2, 3];\nlet b = a.try_map(NonZero::new);\nlet c = b.map(|x| x.map(NonZero::get));\nassert_eq!(c, Some(a));
\n1.57.0 (const: 1.57.0) · sourcepub const fn as_slice(&self) -> &[T]
Returns a slice containing the entire array. Equivalent to &s[..].
\n1.57.0 · sourcepub fn as_mut_slice(&mut self) -> &mut [T]
Returns a mutable slice containing the entire array. Equivalent to\n&mut s[..].
\n1.77.0 · sourcepub fn each_ref(&self) -> [&T; N]
Borrows each element and returns an array of references with the same\nsize as self.
\n§Example
\nlet floats = [3.1, 2.7, -1.0];\nlet float_refs: [&f64; 3] = floats.each_ref();\nassert_eq!(float_refs, [&3.1, &2.7, &-1.0]);
\nThis method is particularly useful if combined with other methods, like\nmap. This way, you can avoid moving the original\narray if its elements are not Copy.
\n\nlet strings = [\"Ferris\".to_string(), \"♥\".to_string(), \"Rust\".to_string()];\nlet is_ascii = strings.each_ref().map(|s| s.is_ascii());\nassert_eq!(is_ascii, [true, false, true]);\n\n// We can still access the original array: it has not been moved.\nassert_eq!(strings.len(), 3);
\n1.77.0 · sourcepub fn each_mut(&mut self) -> [&mut T; N]
Borrows each element mutably and returns an array of mutable references\nwith the same size as self.
\n§Example
\n\nlet mut floats = [3.1, 2.7, -1.0];\nlet float_refs: [&mut f64; 3] = floats.each_mut();\n*float_refs[0] = 0.0;\nassert_eq!(float_refs, [&mut 0.0, &mut 2.7, &mut -1.0]);\nassert_eq!(floats, [0.0, 2.7, -1.0]);
\nsourcepub fn split_array_ref<const M: usize>(&self) -> (&[T; M], &[T])
🔬This is a nightly-only experimental API. (split_array)
Divides one array reference into two at an index.
\nThe first will contain all indices from [0, M) (excluding\nthe index M itself) and the second will contain all\nindices from [M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet v = [1, 2, 3, 4, 5, 6];\n\n{\n let (left, right) = v.split_array_ref::<0>();\n assert_eq!(left, &[]);\n assert_eq!(right, &[1, 2, 3, 4, 5, 6]);\n}\n\n{\n let (left, right) = v.split_array_ref::<2>();\n assert_eq!(left, &[1, 2]);\n assert_eq!(right, &[3, 4, 5, 6]);\n}\n\n{\n let (left, right) = v.split_array_ref::<6>();\n assert_eq!(left, &[1, 2, 3, 4, 5, 6]);\n assert_eq!(right, &[]);\n}
\nsourcepub fn split_array_mut<const M: usize>(&mut self) -> (&mut [T; M], &mut [T])
🔬This is a nightly-only experimental API. (split_array)
Divides one mutable array reference into two at an index.
\nThe first will contain all indices from [0, M) (excluding\nthe index M itself) and the second will contain all\nindices from [M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet mut v = [1, 0, 3, 0, 5, 6];\nlet (left, right) = v.split_array_mut::<2>();\nassert_eq!(left, &mut [1, 0][..]);\nassert_eq!(right, &mut [3, 0, 5, 6]);\nleft[1] = 2;\nright[1] = 4;\nassert_eq!(v, [1, 2, 3, 4, 5, 6]);
\nsourcepub fn rsplit_array_ref<const M: usize>(&self) -> (&[T], &[T; M])
🔬This is a nightly-only experimental API. (split_array)
Divides one array reference into two at an index from the end.
\nThe first will contain all indices from [0, N - M) (excluding\nthe index N - M itself) and the second will contain all\nindices from [N - M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet v = [1, 2, 3, 4, 5, 6];\n\n{\n let (left, right) = v.rsplit_array_ref::<0>();\n assert_eq!(left, &[1, 2, 3, 4, 5, 6]);\n assert_eq!(right, &[]);\n}\n\n{\n let (left, right) = v.rsplit_array_ref::<2>();\n assert_eq!(left, &[1, 2, 3, 4]);\n assert_eq!(right, &[5, 6]);\n}\n\n{\n let (left, right) = v.rsplit_array_ref::<6>();\n assert_eq!(left, &[]);\n assert_eq!(right, &[1, 2, 3, 4, 5, 6]);\n}
\nsourcepub fn rsplit_array_mut<const M: usize>(&mut self) -> (&mut [T], &mut [T; M])
🔬This is a nightly-only experimental API. (split_array)
Divides one mutable array reference into two at an index from the end.
\nThe first will contain all indices from [0, N - M) (excluding\nthe index N - M itself) and the second will contain all\nindices from [N - M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet mut v = [1, 0, 3, 0, 5, 6];\nlet (left, right) = v.rsplit_array_mut::<4>();\nassert_eq!(left, &mut [1, 0]);\nassert_eq!(right, &mut [3, 0, 5, 6][..]);\nleft[1] = 2;\nright[1] = 4;\nassert_eq!(v, [1, 2, 3, 4, 5, 6]);
\n",0,"iroh_docs::sync::PeerIdBytes"],["source§impl<const N: usize> [u8; N]
sourcepub const fn as_ascii(&self) -> Option<&[AsciiChar; N]>
🔬This is a nightly-only experimental API. (ascii_char)
Converts this array of bytes into a array of ASCII characters,\nor returns None if any of the characters is non-ASCII.
\n§Examples
\n#![feature(ascii_char)]\n#![feature(const_option)]\n\nconst HEX_DIGITS: [std::ascii::Char; 16] =\n *b\"0123456789abcdef\".as_ascii().unwrap();\n\nassert_eq!(HEX_DIGITS[1].as_str(), \"1\");\nassert_eq!(HEX_DIGITS[10].as_str(), \"a\");
\nsourcepub const unsafe fn as_ascii_unchecked(&self) -> &[AsciiChar; N]
🔬This is a nightly-only experimental API. (ascii_char)
Converts this array of bytes into a array of ASCII characters,\nwithout checking whether they’re valid.
\n§Safety
\nEvery byte in the array must be in 0..=127, or else this is UB.
\n",0,"iroh_docs::sync::PeerIdBytes"],["§impl<T> Array for [T; 32]where\n T: Default,
§fn as_slice_mut(&mut self) -> &mut [T]
Gives a unique slice over the whole thing. Read more","Array","iroh_docs::sync::PeerIdBytes"],["","Array","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> AsBytes for [T; N]where\n T: AsBytes,
§fn write_to_prefix(&self, bytes: &mut [u8]) -> Option<()>
","AsBytes","iroh_docs::sync::PeerIdBytes"],["","AsBytes","iroh_docs::sync::PeerIdBytes"],["","AsMut<[T]>","iroh_docs::sync::PeerIdBytes"],["","AsRef<[T]>","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> BitView for [T; N]where\n T: BitStore,
Note that overly-large arrays may cause the conversions to fail.
\n§fn view_bits<O>(&self) -> &BitSlice<T, O>where\n O: BitOrder,
Views a memory region as an immutable bit-slice.§fn try_view_bits<O>(&self) -> Result<&BitSlice<T, O>, BitSpanError<T>>where\n O: BitOrder,
Attempts to view a memory region as an immutable bit-slice. Read more§fn view_bits_mut<O>(&mut self) -> &mut BitSlice<T, O>where\n O: BitOrder,
Views a memory region as a mutable bit-slice.§fn try_view_bits_mut<O>(\n &mut self\n) -> Result<&mut BitSlice<T, O>, BitSpanError<T>>where\n O: BitOrder,
Attempts to view a memory region as a mutable bit-slice. Read more","BitView","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> BitViewSized for [T; N]where\n T: BitStore,
§fn as_raw_slice(&self) -> &[<[T; N] as BitView>::Store]
Views the type as a slice of its elements.§fn as_raw_mut_slice(&mut self) -> &mut [<[T; N] as BitView>::Store]
Views the type as a mutable slice of its elements.§fn into_bitarray<O>(self) -> BitArray<Self, O>where\n O: BitOrder,
Wraps self in a BitArray.","BitViewSized","iroh_docs::sync::PeerIdBytes"],["","Borrow<[T]>","iroh_docs::sync::PeerIdBytes"],["1.4.0 · source§impl<T, const N: usize> BorrowMut<[T]> for [T; N]
source§fn borrow_mut(&mut self) -> &mut [T]
Mutably borrows from an owned value. Read more","BorrowMut<[T]>","iroh_docs::sync::PeerIdBytes"],["","Chain","iroh_docs::sync::PeerIdBytes"],["","Clone","iroh_docs::sync::PeerIdBytes"],["","Debug","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize> Decode for [u8; N]
Decodes a byte array from byte[n] as described in RFC4251 § 5:
\n\nA byte represents an arbitrary 8-bit value (octet). Fixed length\ndata is sometimes represented as an array of bytes, written\nbyte[n], where n is the number of bytes in the array.
\n
\n","Decode","iroh_docs::sync::PeerIdBytes"],["§impl<'a, T, const N: usize> DecodeValue<'a> for [T; N]where\n T: Decode<'a>,
§fn decode_value<R>(reader: &mut R, header: Header) -> Result<[T; N], Error>where\n R: Reader<'a>,
Attempt to decode this message using the provided [Reader].","DecodeValue<'a>","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["source§impl<'de, T> Deserialize<'de> for [T; 32]where\n T: Deserialize<'de>,
source§fn deserialize<D>(\n deserializer: D\n) -> Result<[T; 32], <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more","Deserialize<'de>","iroh_docs::sync::PeerIdBytes"],["source§impl<'de, const N: usize> Deserialize<'de> for [u8; N]
source§fn deserialize<D>(\n deserializer: D\n) -> Result<[u8; N], <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
","Deserialize<'de>","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize> Encode for [u8; N]
Encodes [u8; N] into byte[n] as described in RFC4251 § 5:
\n\nA byte represents an arbitrary 8-bit value (octet). Fixed length\ndata is sometimes represented as an array of bytes, written\nbyte[n], where n is the number of bytes in the array.
\n
\n§fn encoded_len(&self) -> Result<usize, Error>
Get the length of this type encoded in bytes, prior to Base64 encoding.§fn encode(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value using the provided [Writer].§fn encoded_len_prefixed(&self) -> Result<usize, Error>
Return the length of this type after encoding when prepended with a\nuint32 length prefix.§fn encode_prefixed(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value, first prepending a uint32 length prefix\nset to [Encode::encoded_len].","Encode","iroh_docs::sync::PeerIdBytes"],["","EncodeLabelSet","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> EncodeValue for [T; N]where\n T: Encode,
","EncodeValue","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["§impl<'a> FindToken<&'a u8> for [u8; 32]
§fn find_token(&self, token: &u8) -> bool
Returns true if self contains the token","FindToken<&'a u8>","iroh_docs::sync::PeerIdBytes"],["§impl FindToken<u8> for [u8; 32]
§fn find_token(&self, token: u8) -> bool
Returns true if self contains the token","FindToken","iroh_docs::sync::PeerIdBytes"],["","FixedTag","iroh_docs::sync::PeerIdBytes"],["","From<&Signature>","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["§impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>>> for [T; 32]
","From, B0>, B0>, B0>, B0>, B0>>>","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["","From>","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["source§impl From<NamespaceId> for [u8; 32]
source§fn from(value: NamespaceId) -> Self
Converts to this type from the input type.","From","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["","From>","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> FromBytes for [T; N]where\n T: FromBytes,
§fn slice_from_prefix(bytes: &[u8], count: usize) -> Option<(&[Self], &[u8])>where\n Self: Sized,
Interprets the prefix of the given bytes as a &[Self] with length\nequal to count without copying. Read more§fn slice_from_suffix(bytes: &[u8], count: usize) -> Option<(&[u8], &[Self])>where\n Self: Sized,
Interprets the suffix of the given bytes as a &[Self] with length\nequal to count without copying. Read more§fn read_from_prefix(bytes: &[u8]) -> Option<Self>where\n Self: Sized,
","FromBytes","iroh_docs::sync::PeerIdBytes"],["","FromHex","iroh_docs::sync::PeerIdBytes"],["","FromZeroes","iroh_docs::sync::PeerIdBytes"],["","Hash","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Hash for [T; N]where\n T: Hash,
The hash of an array is the same as that of the corresponding slice,\nas required by the Borrow implementation.
\n\nuse std::hash::BuildHasher;\n\nlet b = std::hash::RandomState::new();\nlet a: [u8; 3] = [0xa8, 0x3c, 0x09];\nlet s: &[u8] = &[0xa8, 0x3c, 0x09];\nassert_eq!(b.hash_one(a), b.hash_one(s));
\n","Hash","iroh_docs::sync::PeerIdBytes"],["","Index","iroh_docs::sync::PeerIdBytes"],["","IndexMut","iroh_docs::sync::PeerIdBytes"],["","InputLength","iroh_docs::sync::PeerIdBytes"],["1.53.0 · source§impl<T, const N: usize> IntoIterator for [T; N]
source§fn into_iter(self) -> <[T; N] as IntoIterator>::IntoIter
Creates a consuming iterator, that is, one that moves each value out of\nthe array (from start to end). The array cannot be used after calling\nthis unless T implements Copy, so the whole array is copied.
\nArrays have special behavior when calling .into_iter() prior to the\n2021 edition – see the array Editions section for more information.
\n","IntoIterator","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize> IntoResponse for [u8; N]
§fn into_response(self) -> Response<Body>
Create a response.","IntoResponse","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, const N: usize> Join for [Fut; N]where\n Fut: IntoFuture,
§type Output = [<Fut as IntoFuture>::Output; N]
The resulting output type.§type Future = Join<<Fut as IntoFuture>::IntoFuture, N>
The Future implementation returned by this method.","Join","iroh_docs::sync::PeerIdBytes"],["","Key","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> MaxSize for [T; N]where\n T: MaxSize,
§const POSTCARD_MAX_SIZE: usize = _
The maximum possible size that the serialization of this\ntype can have, in bytes.","MaxSize","iroh_docs::sync::PeerIdBytes"],["","Merge","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Ord for [T; N]where\n T: Ord,
Implements comparison of arrays lexicographically.
\n1.21.0 · source§fn max(self, other: Self) -> Selfwhere\n Self: Sized,
Compares and returns the maximum of two values. Read more","Ord","iroh_docs::sync::PeerIdBytes"],["","PartialEq<&[U]>","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, U, const N: usize> PartialEq<&mut [U]> for [T; N]where\n T: PartialEq<U>,
","PartialEq<&mut [U]>","iroh_docs::sync::PeerIdBytes"],["","PartialEq<[U]>","iroh_docs::sync::PeerIdBytes"],["","PartialEq<[U; N]>","iroh_docs::sync::PeerIdBytes"],["","PartialEq","iroh_docs::sync::PeerIdBytes"],["§impl<A, B, const N: usize, const M: usize> PartialEq<Vec<A, N>> for [B; M]where\n A: PartialEq<B>,
","PartialEq>","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> PartialOrd for [T; N]where\n T: PartialOrd,
Implements comparison of arrays lexicographically.
\nsource§fn le(&self, other: &[T; N]) -> bool
This method tests less than or equal to (for self and other) and is used by the <=\noperator. Read more","PartialOrd","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, const N: usize> Race for [Fut; N]where\n Fut: IntoFuture,
§type Output = <Fut as IntoFuture>::Output
The resulting output type.§type Future = Race<<Fut as IntoFuture>::IntoFuture, N>
Which kind of future are we turning this into?","Race","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, T, E, const N: usize> RaceOk for [Fut; N]where\n Fut: IntoFuture<Output = Result<T, E>>,
§type Future = RaceOk<<Fut as IntoFuture>::IntoFuture, T, E, N>
Which kind of future are we turning this into?","RaceOk","iroh_docs::sync::PeerIdBytes"],["","Schema","iroh_docs::sync::PeerIdBytes"],["source§impl<T> Serialize for [T; 32]where\n T: 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","iroh_docs::sync::PeerIdBytes"],["source§impl<const N: usize> Serialize for [u8; N]
source§fn serialize<S>(\n &self,\n serializer: S\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where\n S: Serializer,
","Serialize","iroh_docs::sync::PeerIdBytes"],["1.51.0 · source§impl<T, const N: usize> SlicePattern for [T; N]
","SlicePattern","iroh_docs::sync::PeerIdBytes"],["1.34.0 · source§impl<T, const N: usize> TryFrom<&[T]> for [T; N]where\n T: Copy,
Tries to create an array [T; N] by copying from a slice &[T]. Succeeds if\nslice.len() == N.
\n\nlet bytes: [u8; 3] = [1, 0, 2];\n\nlet bytes_head: [u8; 2] = <[u8; 2]>::try_from(&bytes[0..2]).unwrap();\nassert_eq!(1, u16::from_le_bytes(bytes_head));\n\nlet bytes_tail: [u8; 2] = bytes[1..3].try_into().unwrap();\nassert_eq!(512, u16::from_le_bytes(bytes_tail));
\n§type Error = TryFromSliceError
The type returned in the event of a conversion error.","TryFrom<&[T]>","iroh_docs::sync::PeerIdBytes"],["1.59.0 · source§impl<T, const N: usize> TryFrom<&mut [T]> for [T; N]where\n T: Copy,
Tries to create an array [T; N] by copying from a mutable slice &mut [T].\nSucceeds if slice.len() == N.
\n\nlet mut bytes: [u8; 3] = [1, 0, 2];\n\nlet bytes_head: [u8; 2] = <[u8; 2]>::try_from(&mut bytes[0..2]).unwrap();\nassert_eq!(1, u16::from_le_bytes(bytes_head));\n\nlet bytes_tail: [u8; 2] = (&mut bytes[1..3]).try_into().unwrap();\nassert_eq!(512, u16::from_le_bytes(bytes_tail));
\n§type Error = TryFromSliceError
The type returned in the event of a conversion error.","TryFrom<&mut [T]>","iroh_docs::sync::PeerIdBytes"],["§impl<T, A, const N: usize> TryFrom<Vec<T, A>> for [T; N]where\n A: Allocator,
§fn try_from(vec: Vec<T, A>) -> Result<[T; N], Vec<T, A>>
Gets the entire contents of the Vec<T> as an array,\nif its size exactly matches that of the requested array.
\n§Examples
\nassert_eq!(vec![1, 2, 3].try_into(), Ok([1, 2, 3]));\nassert_eq!(<Vec<i32>>::new().try_into(), Ok([]));
\nIf the length doesn’t match, the input comes back in Err:
\n\nlet r: Result<[i32; 4], _> = (0..10).collect::<Vec<_>>().try_into();\nassert_eq!(r, Err(vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9]));
\nIf you’re fine with just getting a prefix of the Vec<T>,\nyou can call .truncate(N) first.
\n\nlet mut v = String::from(\"hello world\").into_bytes();\nv.sort();\nv.truncate(2);\nlet [a, b]: [_; 2] = v.try_into().unwrap();\nassert_eq!(a, b' ');\nassert_eq!(b, b'd');
\n","TryFrom>","iroh_docs::sync::PeerIdBytes"],["1.48.0 · source§impl<T, A, const N: usize> TryFrom<Vec<T, A>> for [T; N]where\n A: Allocator,
source§fn try_from(vec: Vec<T, A>) -> Result<[T; N], Vec<T, A>>
Gets the entire contents of the Vec<T> as an array,\nif its size exactly matches that of the requested array.
\n§Examples
\nassert_eq!(vec![1, 2, 3].try_into(), Ok([1, 2, 3]));\nassert_eq!(<Vec<i32>>::new().try_into(), Ok([]));
\nIf the length doesn’t match, the input comes back in Err:
\n\nlet r: Result<[i32; 4], _> = (0..10).collect::<Vec<_>>().try_into();\nassert_eq!(r, Err(vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9]));
\nIf you’re fine with just getting a prefix of the Vec<T>,\nyou can call .truncate(N) first.
\n\nlet mut v = String::from(\"hello world\").into_bytes();\nv.sort();\nv.truncate(2);\nlet [a, b]: [_; 2] = v.try_into().unwrap();\nassert_eq!(a, b' ');\nassert_eq!(b, b'd');
\n","TryFrom>","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, T, E, const N: usize> TryJoin for [Fut; N]where\n Fut: IntoFuture<Output = Result<T, E>>,
§type Future = TryJoin<<Fut as IntoFuture>::IntoFuture, T, E, N>
Which kind of future are we turning this into?","TryJoin","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> Value for [T; N]where\n T: Value,
§type SelfType<'a> = [<T as Value>::SelfType<'a>; N]\nwhere\n [T; N]: 'a
SelfType<’a> must be the same type as Self with all lifetimes replaced with ’a§type AsBytes<'a> = Vec<u8>\nwhere\n [T; N]: 'a
§fn fixed_width() -> Option<usize>
Width of a fixed type, or None for variable width§fn from_bytes<'a>(data: &'a [u8]) -> [<T as Value>::SelfType<'a>; N]where\n [T; N]: 'a,
Deserializes data\nImplementations may return a view over data, or an owned type","Value","iroh_docs::sync::PeerIdBytes"],["","ValueOrd","iroh_docs::sync::PeerIdBytes"],["§impl<Z, const N: usize> Zeroize for [Z; N]where\n Z: Zeroize,
Impl [Zeroize] on arrays of types that impl [Zeroize].
\n","Zeroize","iroh_docs::sync::PeerIdBytes"],["","Zip","iroh_docs::sync::PeerIdBytes"],["source§impl<T, const N: usize> ConstParamTy for [T; N]where\n T: ConstParamTy,
","ConstParamTy","iroh_docs::sync::PeerIdBytes"],["1.58.0 · source§impl<T, const N: usize> Copy for [T; N]where\n T: Copy,
","Copy","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Eq for [T; N]where\n T: Eq,
","Eq","iroh_docs::sync::PeerIdBytes"],["source§impl<T, const N: usize> StructuralPartialEq for [T; N]
","StructuralPartialEq","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> Unaligned for [T; N]where\n T: Unaligned,
","Unaligned","iroh_docs::sync::PeerIdBytes"],["§impl<Z, const N: usize> ZeroizeOnDrop for [Z; N]where\n Z: ZeroizeOnDrop,
Impl [ZeroizeOnDrop] on arrays of types that impl [ZeroizeOnDrop].
\n","ZeroizeOnDrop","iroh_docs::sync::PeerIdBytes"]]
+"iroh_docs":[["source§impl<T, const N: usize> [T; N]
1.55.0 · sourcepub fn map<F, U>(self, f: F) -> [U; N]where\n F: FnMut(T) -> U,
Returns an array of the same size as self, with function f applied to each element\nin order.
\nIf you don’t necessarily need a new fixed-size array, consider using\nIterator::map instead.
\n§Note on performance and stack usage
\nUnfortunately, usages of this method are currently not always optimized\nas well as they could be. This mainly concerns large arrays, as mapping\nover small arrays seem to be optimized just fine. Also note that in\ndebug mode (i.e. without any optimizations), this method can use a lot\nof stack space (a few times the size of the array or more).
\nTherefore, in performance-critical code, try to avoid using this method\non large arrays or check the emitted code. Also try to avoid chained\nmaps (e.g. arr.map(...).map(...)).
\nIn many cases, you can instead use Iterator::map by calling .iter()\nor .into_iter() on your array. [T; N]::map is only necessary if you\nreally need a new array of the same size as the result. Rust’s lazy\niterators tend to get optimized very well.
\n§Examples
\nlet x = [1, 2, 3];\nlet y = x.map(|v| v + 1);\nassert_eq!(y, [2, 3, 4]);\n\nlet x = [1, 2, 3];\nlet mut temp = 0;\nlet y = x.map(|v| { temp += 1; v * temp });\nassert_eq!(y, [1, 4, 9]);\n\nlet x = [\"Ferris\", \"Bueller's\", \"Day\", \"Off\"];\nlet y = x.map(|v| v.len());\nassert_eq!(y, [6, 9, 3, 3]);
\nsourcepub fn try_map<F, R>(\n self,\n f: F\n) -> <<R as Try>::Residual as Residual<[<R as Try>::Output; N]>>::TryType
🔬This is a nightly-only experimental API. (array_try_map)
A fallible function f applied to each element on array self in order to\nreturn an array the same size as self or the first error encountered.
\nThe return type of this function depends on the return type of the closure.\nIf you return Result<T, E> from the closure, you’ll get a Result<[T; N], E>.\nIf you return Option<T> from the closure, you’ll get an Option<[T; N]>.
\n§Examples
\n#![feature(array_try_map)]\n\nlet a = [\"1\", \"2\", \"3\"];\nlet b = a.try_map(|v| v.parse::<u32>()).unwrap().map(|v| v + 1);\nassert_eq!(b, [2, 3, 4]);\n\nlet a = [\"1\", \"2a\", \"3\"];\nlet b = a.try_map(|v| v.parse::<u32>());\nassert!(b.is_err());\n\nuse std::num::NonZero;\n\nlet z = [1, 2, 0, 3, 4];\nassert_eq!(z.try_map(NonZero::new), None);\n\nlet a = [1, 2, 3];\nlet b = a.try_map(NonZero::new);\nlet c = b.map(|x| x.map(NonZero::get));\nassert_eq!(c, Some(a));
\n1.57.0 (const: 1.57.0) · sourcepub const fn as_slice(&self) -> &[T]
Returns a slice containing the entire array. Equivalent to &s[..].
\n1.57.0 · sourcepub fn as_mut_slice(&mut self) -> &mut [T]
Returns a mutable slice containing the entire array. Equivalent to\n&mut s[..].
\n1.77.0 · sourcepub fn each_ref(&self) -> [&T; N]
Borrows each element and returns an array of references with the same\nsize as self.
\n§Example
\nlet floats = [3.1, 2.7, -1.0];\nlet float_refs: [&f64; 3] = floats.each_ref();\nassert_eq!(float_refs, [&3.1, &2.7, &-1.0]);
\nThis method is particularly useful if combined with other methods, like\nmap. This way, you can avoid moving the original\narray if its elements are not Copy.
\n\nlet strings = [\"Ferris\".to_string(), \"♥\".to_string(), \"Rust\".to_string()];\nlet is_ascii = strings.each_ref().map(|s| s.is_ascii());\nassert_eq!(is_ascii, [true, false, true]);\n\n// We can still access the original array: it has not been moved.\nassert_eq!(strings.len(), 3);
\n1.77.0 · sourcepub fn each_mut(&mut self) -> [&mut T; N]
Borrows each element mutably and returns an array of mutable references\nwith the same size as self.
\n§Example
\n\nlet mut floats = [3.1, 2.7, -1.0];\nlet float_refs: [&mut f64; 3] = floats.each_mut();\n*float_refs[0] = 0.0;\nassert_eq!(float_refs, [&mut 0.0, &mut 2.7, &mut -1.0]);\nassert_eq!(floats, [0.0, 2.7, -1.0]);
\nsourcepub fn split_array_ref<const M: usize>(&self) -> (&[T; M], &[T])
🔬This is a nightly-only experimental API. (split_array)
Divides one array reference into two at an index.
\nThe first will contain all indices from [0, M) (excluding\nthe index M itself) and the second will contain all\nindices from [M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet v = [1, 2, 3, 4, 5, 6];\n\n{\n let (left, right) = v.split_array_ref::<0>();\n assert_eq!(left, &[]);\n assert_eq!(right, &[1, 2, 3, 4, 5, 6]);\n}\n\n{\n let (left, right) = v.split_array_ref::<2>();\n assert_eq!(left, &[1, 2]);\n assert_eq!(right, &[3, 4, 5, 6]);\n}\n\n{\n let (left, right) = v.split_array_ref::<6>();\n assert_eq!(left, &[1, 2, 3, 4, 5, 6]);\n assert_eq!(right, &[]);\n}
\nsourcepub fn split_array_mut<const M: usize>(&mut self) -> (&mut [T; M], &mut [T])
🔬This is a nightly-only experimental API. (split_array)
Divides one mutable array reference into two at an index.
\nThe first will contain all indices from [0, M) (excluding\nthe index M itself) and the second will contain all\nindices from [M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet mut v = [1, 0, 3, 0, 5, 6];\nlet (left, right) = v.split_array_mut::<2>();\nassert_eq!(left, &mut [1, 0][..]);\nassert_eq!(right, &mut [3, 0, 5, 6]);\nleft[1] = 2;\nright[1] = 4;\nassert_eq!(v, [1, 2, 3, 4, 5, 6]);
\nsourcepub fn rsplit_array_ref<const M: usize>(&self) -> (&[T], &[T; M])
🔬This is a nightly-only experimental API. (split_array)
Divides one array reference into two at an index from the end.
\nThe first will contain all indices from [0, N - M) (excluding\nthe index N - M itself) and the second will contain all\nindices from [N - M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet v = [1, 2, 3, 4, 5, 6];\n\n{\n let (left, right) = v.rsplit_array_ref::<0>();\n assert_eq!(left, &[1, 2, 3, 4, 5, 6]);\n assert_eq!(right, &[]);\n}\n\n{\n let (left, right) = v.rsplit_array_ref::<2>();\n assert_eq!(left, &[1, 2, 3, 4]);\n assert_eq!(right, &[5, 6]);\n}\n\n{\n let (left, right) = v.rsplit_array_ref::<6>();\n assert_eq!(left, &[]);\n assert_eq!(right, &[1, 2, 3, 4, 5, 6]);\n}
\nsourcepub fn rsplit_array_mut<const M: usize>(&mut self) -> (&mut [T], &mut [T; M])
🔬This is a nightly-only experimental API. (split_array)
Divides one mutable array reference into two at an index from the end.
\nThe first will contain all indices from [0, N - M) (excluding\nthe index N - M itself) and the second will contain all\nindices from [N - M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet mut v = [1, 0, 3, 0, 5, 6];\nlet (left, right) = v.rsplit_array_mut::<4>();\nassert_eq!(left, &mut [1, 0]);\nassert_eq!(right, &mut [3, 0, 5, 6][..]);\nleft[1] = 2;\nright[1] = 4;\nassert_eq!(v, [1, 2, 3, 4, 5, 6]);
\n",0,"iroh_docs::sync::PeerIdBytes"],["source§impl<const N: usize> [u8; N]
sourcepub const fn as_ascii(&self) -> Option<&[AsciiChar; N]>
🔬This is a nightly-only experimental API. (ascii_char)
Converts this array of bytes into a array of ASCII characters,\nor returns None if any of the characters is non-ASCII.
\n§Examples
\n#![feature(ascii_char)]\n#![feature(const_option)]\n\nconst HEX_DIGITS: [std::ascii::Char; 16] =\n *b\"0123456789abcdef\".as_ascii().unwrap();\n\nassert_eq!(HEX_DIGITS[1].as_str(), \"1\");\nassert_eq!(HEX_DIGITS[10].as_str(), \"a\");
\nsourcepub const unsafe fn as_ascii_unchecked(&self) -> &[AsciiChar; N]
🔬This is a nightly-only experimental API. (ascii_char)
Converts this array of bytes into a array of ASCII characters,\nwithout checking whether they’re valid.
\n§Safety
\nEvery byte in the array must be in 0..=127, or else this is UB.
\n",0,"iroh_docs::sync::PeerIdBytes"],["§impl<T> Array for [T; 32]where\n T: Default,
§fn as_slice_mut(&mut self) -> &mut [T]
Gives a unique slice over the whole thing. Read more","Array","iroh_docs::sync::PeerIdBytes"],["","Array","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> AsBytes for [T; N]where\n T: AsBytes,
§fn write_to_prefix(&self, bytes: &mut [u8]) -> Option<()>
","AsBytes","iroh_docs::sync::PeerIdBytes"],["","AsBytes","iroh_docs::sync::PeerIdBytes"],["","AsMut<[T]>","iroh_docs::sync::PeerIdBytes"],["","AsRef<[T]>","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> BitView for [T; N]where\n T: BitStore,
Note that overly-large arrays may cause the conversions to fail.
\n§fn view_bits<O>(&self) -> &BitSlice<T, O>where\n O: BitOrder,
Views a memory region as an immutable bit-slice.§fn try_view_bits<O>(&self) -> Result<&BitSlice<T, O>, BitSpanError<T>>where\n O: BitOrder,
Attempts to view a memory region as an immutable bit-slice. Read more§fn view_bits_mut<O>(&mut self) -> &mut BitSlice<T, O>where\n O: BitOrder,
Views a memory region as a mutable bit-slice.§fn try_view_bits_mut<O>(\n &mut self\n) -> Result<&mut BitSlice<T, O>, BitSpanError<T>>where\n O: BitOrder,
Attempts to view a memory region as a mutable bit-slice. Read more","BitView","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> BitViewSized for [T; N]where\n T: BitStore,
§fn as_raw_slice(&self) -> &[<[T; N] as BitView>::Store]
Views the type as a slice of its elements.§fn as_raw_mut_slice(&mut self) -> &mut [<[T; N] as BitView>::Store]
Views the type as a mutable slice of its elements.§fn into_bitarray<O>(self) -> BitArray<Self, O>where\n O: BitOrder,
Wraps self in a BitArray.","BitViewSized","iroh_docs::sync::PeerIdBytes"],["","Borrow<[T]>","iroh_docs::sync::PeerIdBytes"],["1.4.0 · source§impl<T, const N: usize> BorrowMut<[T]> for [T; N]
source§fn borrow_mut(&mut self) -> &mut [T]
Mutably borrows from an owned value. Read more","BorrowMut<[T]>","iroh_docs::sync::PeerIdBytes"],["","Chain","iroh_docs::sync::PeerIdBytes"],["","Clone","iroh_docs::sync::PeerIdBytes"],["","Debug","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize> Decode for [u8; N]
Decodes a byte array from byte[n] as described in RFC4251 § 5:
\n\nA byte represents an arbitrary 8-bit value (octet). Fixed length\ndata is sometimes represented as an array of bytes, written\nbyte[n], where n is the number of bytes in the array.
\n
\n","Decode","iroh_docs::sync::PeerIdBytes"],["§impl<'a, T, const N: usize> DecodeValue<'a> for [T; N]where\n T: Decode<'a>,
§fn decode_value<R>(reader: &mut R, header: Header) -> Result<[T; N], Error>where\n R: Reader<'a>,
Attempt to decode this message using the provided [Reader].","DecodeValue<'a>","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["source§impl<'de, T> Deserialize<'de> for [T; 32]where\n T: Deserialize<'de>,
source§fn deserialize<D>(\n deserializer: D\n) -> Result<[T; 32], <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more","Deserialize<'de>","iroh_docs::sync::PeerIdBytes"],["source§impl<'de, const N: usize> Deserialize<'de> for [u8; N]
source§fn deserialize<D>(\n deserializer: D\n) -> Result<[u8; N], <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
","Deserialize<'de>","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize> Encode for [u8; N]
Encodes [u8; N] into byte[n] as described in RFC4251 § 5:
\n\nA byte represents an arbitrary 8-bit value (octet). Fixed length\ndata is sometimes represented as an array of bytes, written\nbyte[n], where n is the number of bytes in the array.
\n
\n§fn encoded_len(&self) -> Result<usize, Error>
Get the length of this type encoded in bytes, prior to Base64 encoding.§fn encode(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value using the provided [Writer].§fn encoded_len_prefixed(&self) -> Result<usize, Error>
Return the length of this type after encoding when prepended with a\nuint32 length prefix.§fn encode_prefixed(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value, first prepending a uint32 length prefix\nset to [Encode::encoded_len].","Encode","iroh_docs::sync::PeerIdBytes"],["","EncodeLabelSet","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> EncodeValue for [T; N]where\n T: Encode,
","EncodeValue","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["§impl<'a> FindToken<&'a u8> for [u8; 32]
§fn find_token(&self, token: &u8) -> bool
Returns true if self contains the token","FindToken<&'a u8>","iroh_docs::sync::PeerIdBytes"],["§impl FindToken<u8> for [u8; 32]
§fn find_token(&self, token: u8) -> bool
Returns true if self contains the token","FindToken","iroh_docs::sync::PeerIdBytes"],["","FixedTag","iroh_docs::sync::PeerIdBytes"],["","From<&Signature>","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["§impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>>> for [T; 32]
","From, B0>, B0>, B0>, B0>, B0>>>","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["","From>","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["source§impl From<NamespaceId> for [u8; 32]
source§fn from(value: NamespaceId) -> Self
Converts to this type from the input type.","From","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["","From>","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> FromBytes for [T; N]where\n T: FromBytes,
§fn slice_from_prefix(bytes: &[u8], count: usize) -> Option<(&[Self], &[u8])>where\n Self: Sized,
Interprets the prefix of the given bytes as a &[Self] with length\nequal to count without copying. Read more§fn slice_from_suffix(bytes: &[u8], count: usize) -> Option<(&[u8], &[Self])>where\n Self: Sized,
Interprets the suffix of the given bytes as a &[Self] with length\nequal to count without copying. Read more§fn read_from_prefix(bytes: &[u8]) -> Option<Self>where\n Self: Sized,
","FromBytes","iroh_docs::sync::PeerIdBytes"],["","FromHex","iroh_docs::sync::PeerIdBytes"],["","FromZeroes","iroh_docs::sync::PeerIdBytes"],["","Hash","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Hash for [T; N]where\n T: Hash,
The hash of an array is the same as that of the corresponding slice,\nas required by the Borrow implementation.
\n\nuse std::hash::BuildHasher;\n\nlet b = std::hash::RandomState::new();\nlet a: [u8; 3] = [0xa8, 0x3c, 0x09];\nlet s: &[u8] = &[0xa8, 0x3c, 0x09];\nassert_eq!(b.hash_one(a), b.hash_one(s));
\n","Hash","iroh_docs::sync::PeerIdBytes"],["","Index","iroh_docs::sync::PeerIdBytes"],["","IndexMut","iroh_docs::sync::PeerIdBytes"],["","InputLength","iroh_docs::sync::PeerIdBytes"],["1.53.0 · source§impl<T, const N: usize> IntoIterator for [T; N]
source§fn into_iter(self) -> <[T; N] as IntoIterator>::IntoIter
Creates a consuming iterator, that is, one that moves each value out of\nthe array (from start to end). The array cannot be used after calling\nthis unless T implements Copy, so the whole array is copied.
\nArrays have special behavior when calling .into_iter() prior to the\n2021 edition – see the array Editions section for more information.
\n","IntoIterator","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize> IntoResponse for [u8; N]
§fn into_response(self) -> Response<Body>
Create a response.","IntoResponse","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, const N: usize> Join for [Fut; N]where\n Fut: IntoFuture,
§type Output = [<Fut as IntoFuture>::Output; N]
The resulting output type.§type Future = Join<<Fut as IntoFuture>::IntoFuture, N>
The Future implementation returned by this method.","Join","iroh_docs::sync::PeerIdBytes"],["","Key","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> MaxSize for [T; N]where\n T: MaxSize,
§const POSTCARD_MAX_SIZE: usize = _
The maximum possible size that the serialization of this\ntype can have, in bytes.","MaxSize","iroh_docs::sync::PeerIdBytes"],["","Merge","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Ord for [T; N]where\n T: Ord,
Implements comparison of arrays lexicographically.
\n1.21.0 · source§fn max(self, other: Self) -> Selfwhere\n Self: Sized,
Compares and returns the maximum of two values. Read more","Ord","iroh_docs::sync::PeerIdBytes"],["","PartialEq<&[U]>","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, U, const N: usize> PartialEq<&mut [U]> for [T; N]where\n T: PartialEq<U>,
","PartialEq<&mut [U]>","iroh_docs::sync::PeerIdBytes"],["","PartialEq<[U]>","iroh_docs::sync::PeerIdBytes"],["","PartialEq<[U; N]>","iroh_docs::sync::PeerIdBytes"],["","PartialEq","iroh_docs::sync::PeerIdBytes"],["§impl<A, B, const N: usize, const M: usize> PartialEq<Vec<A, N>> for [B; M]where\n A: PartialEq<B>,
","PartialEq>","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> PartialOrd for [T; N]where\n T: PartialOrd,
Implements comparison of arrays lexicographically.
\nsource§fn le(&self, other: &[T; N]) -> bool
This method tests less than or equal to (for self and other) and is used by the <=\noperator. Read more","PartialOrd","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, const N: usize> Race for [Fut; N]where\n Fut: IntoFuture,
§type Output = <Fut as IntoFuture>::Output
The resulting output type.§type Future = Race<<Fut as IntoFuture>::IntoFuture, N>
Which kind of future are we turning this into?","Race","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, T, E, const N: usize> RaceOk for [Fut; N]where\n Fut: IntoFuture<Output = Result<T, E>>,
§type Future = RaceOk<<Fut as IntoFuture>::IntoFuture, T, E, N>
Which kind of future are we turning this into?","RaceOk","iroh_docs::sync::PeerIdBytes"],["","Schema","iroh_docs::sync::PeerIdBytes"],["source§impl<T> Serialize for [T; 32]where\n T: 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","iroh_docs::sync::PeerIdBytes"],["source§impl<const N: usize> Serialize for [u8; N]
source§fn serialize<S>(\n &self,\n serializer: S\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where\n S: Serializer,
","Serialize","iroh_docs::sync::PeerIdBytes"],["1.51.0 · source§impl<T, const N: usize> SlicePattern for [T; N]
","SlicePattern","iroh_docs::sync::PeerIdBytes"],["1.34.0 · source§impl<T, const N: usize> TryFrom<&[T]> for [T; N]where\n T: Copy,
Tries to create an array [T; N] by copying from a slice &[T]. Succeeds if\nslice.len() == N.
\n\nlet bytes: [u8; 3] = [1, 0, 2];\n\nlet bytes_head: [u8; 2] = <[u8; 2]>::try_from(&bytes[0..2]).unwrap();\nassert_eq!(1, u16::from_le_bytes(bytes_head));\n\nlet bytes_tail: [u8; 2] = bytes[1..3].try_into().unwrap();\nassert_eq!(512, u16::from_le_bytes(bytes_tail));
\n§type Error = TryFromSliceError
The type returned in the event of a conversion error.","TryFrom<&[T]>","iroh_docs::sync::PeerIdBytes"],["1.59.0 · source§impl<T, const N: usize> TryFrom<&mut [T]> for [T; N]where\n T: Copy,
Tries to create an array [T; N] by copying from a mutable slice &mut [T].\nSucceeds if slice.len() == N.
\n\nlet mut bytes: [u8; 3] = [1, 0, 2];\n\nlet bytes_head: [u8; 2] = <[u8; 2]>::try_from(&mut bytes[0..2]).unwrap();\nassert_eq!(1, u16::from_le_bytes(bytes_head));\n\nlet bytes_tail: [u8; 2] = (&mut bytes[1..3]).try_into().unwrap();\nassert_eq!(512, u16::from_le_bytes(bytes_tail));
\n§type Error = TryFromSliceError
The type returned in the event of a conversion error.","TryFrom<&mut [T]>","iroh_docs::sync::PeerIdBytes"],["§impl<T, A, const N: usize> TryFrom<Vec<T, A>> for [T; N]where\n A: Allocator,
§fn try_from(vec: Vec<T, A>) -> Result<[T; N], Vec<T, A>>
Gets the entire contents of the Vec<T> as an array,\nif its size exactly matches that of the requested array.
\n§Examples
\nassert_eq!(vec![1, 2, 3].try_into(), Ok([1, 2, 3]));\nassert_eq!(<Vec<i32>>::new().try_into(), Ok([]));
\nIf the length doesn’t match, the input comes back in Err:
\n\nlet r: Result<[i32; 4], _> = (0..10).collect::<Vec<_>>().try_into();\nassert_eq!(r, Err(vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9]));
\nIf you’re fine with just getting a prefix of the Vec<T>,\nyou can call .truncate(N) first.
\n\nlet mut v = String::from(\"hello world\").into_bytes();\nv.sort();\nv.truncate(2);\nlet [a, b]: [_; 2] = v.try_into().unwrap();\nassert_eq!(a, b' ');\nassert_eq!(b, b'd');
\n","TryFrom>","iroh_docs::sync::PeerIdBytes"],["1.48.0 · source§impl<T, A, const N: usize> TryFrom<Vec<T, A>> for [T; N]where\n A: Allocator,
source§fn try_from(vec: Vec<T, A>) -> Result<[T; N], Vec<T, A>>
Gets the entire contents of the Vec<T> as an array,\nif its size exactly matches that of the requested array.
\n§Examples
\nassert_eq!(vec![1, 2, 3].try_into(), Ok([1, 2, 3]));\nassert_eq!(<Vec<i32>>::new().try_into(), Ok([]));
\nIf the length doesn’t match, the input comes back in Err:
\n\nlet r: Result<[i32; 4], _> = (0..10).collect::<Vec<_>>().try_into();\nassert_eq!(r, Err(vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9]));
\nIf you’re fine with just getting a prefix of the Vec<T>,\nyou can call .truncate(N) first.
\n\nlet mut v = String::from(\"hello world\").into_bytes();\nv.sort();\nv.truncate(2);\nlet [a, b]: [_; 2] = v.try_into().unwrap();\nassert_eq!(a, b' ');\nassert_eq!(b, b'd');
\n","TryFrom>","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, T, E, const N: usize> TryJoin for [Fut; N]where\n Fut: IntoFuture<Output = Result<T, E>>,
§type Future = TryJoin<<Fut as IntoFuture>::IntoFuture, T, E, N>
Which kind of future are we turning this into?","TryJoin","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> Value for [T; N]where\n T: Value,
§type SelfType<'a> = [<T as Value>::SelfType<'a>; N]\nwhere\n [T; N]: 'a
SelfType<’a> must be the same type as Self with all lifetimes replaced with ’a§type AsBytes<'a> = Vec<u8>\nwhere\n [T; N]: 'a
§fn fixed_width() -> Option<usize>
Width of a fixed type, or None for variable width§fn from_bytes<'a>(data: &'a [u8]) -> [<T as Value>::SelfType<'a>; N]where\n [T; N]: 'a,
Deserializes data\nImplementations may return a view over data, or an owned type","Value","iroh_docs::sync::PeerIdBytes"],["","ValueOrd","iroh_docs::sync::PeerIdBytes"],["§impl<Z, const N: usize> Zeroize for [Z; N]where\n Z: Zeroize,
Impl [Zeroize] on arrays of types that impl [Zeroize].
\n","Zeroize","iroh_docs::sync::PeerIdBytes"],["","Zip","iroh_docs::sync::PeerIdBytes"],["source§impl<T, const N: usize> ConstParamTy for [T; N]where\n T: ConstParamTy,
","ConstParamTy","iroh_docs::sync::PeerIdBytes"],["1.58.0 · source§impl<T, const N: usize> Copy for [T; N]where\n T: Copy,
","Copy","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Eq for [T; N]where\n T: Eq,
","Eq","iroh_docs::sync::PeerIdBytes"],["source§impl<T, const N: usize> StructuralPartialEq for [T; N]
","StructuralPartialEq","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> Unaligned for [T; N]where\n T: Unaligned,
","Unaligned","iroh_docs::sync::PeerIdBytes"],["§impl<Z, const N: usize> ZeroizeOnDrop for [Z; N]where\n Z: ZeroizeOnDrop,
Impl [ZeroizeOnDrop] on arrays of types that impl [ZeroizeOnDrop].
\n","ZeroizeOnDrop","iroh_docs::sync::PeerIdBytes"]]
};if (window.register_type_impls) {window.register_type_impls(type_impls);} else {window.pending_type_impls = type_impls;}})()
\ No newline at end of file
impl<T> Any for Twhere
diff --git a/pr/2595/docs/iroh_blobs/struct.Hash.html b/pr/2595/docs/iroh_blobs/struct.Hash.html
index 260e50d4b9..ba12d52876 100644
--- a/pr/2595/docs/iroh_blobs/struct.Hash.html
+++ b/pr/2595/docs/iroh_blobs/struct.Hash.html
@@ -1,36 +1,36 @@
-Hash in iroh_blobs - Rust Struct iroh_blobs::Hash
pub struct Hash(/* private fields */);
Expand description
Hash type used throughout.
-Implementations§
§impl Hash
pub const fn from_bytes(bytes: [u8; 32]) -> Hash
Create a Hash from its raw bytes representation.
-pub fn fmt_short(&self) -> String
Convert to a base32 string limited to the first 10 bytes for a friendly string
+
Hash in iroh_blobs - Rust Struct iroh_blobs::Hash
source · pub struct Hash(/* private fields */);
Expand description
Hash type used throughout.
+Implementations§
Trait Implementations§
Trait Implementations§
source§impl<'de> Deserialize<'de> for Hash
source§fn deserialize<D>(
deserializer: D
) -> Result<Hash, <D as Deserializer<'de>>::Error>where
- D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl FromIterator<Hash> for HashSeq
§impl Hash for Hash
§fn hash<__H>(&self, state: &mut __H)where
+ D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl FromIterator<Hash> for HashSeq
§impl MaxSize for Hash
§const POSTCARD_MAX_SIZE: usize = 32usize
The maximum possible size that the serialization of this
-type can have, in bytes.source§impl MaxSize for Hash
source§const POSTCARD_MAX_SIZE: usize = 32usize
The maximum possible size that the serialization of this
+type can have, in bytes.source§impl Ord for Hash
source§impl PartialEq for Hash
§impl PartialOrd for Hash
source§impl PartialOrd for Hash
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 <=
operator. Read moresource§impl Serialize for Hash
source§fn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
- S: Serializer,
Serialize this value into the given Serde serializer. Read more§impl Value for Hash
§type SelfType<'a> = Hash
SelfType<’a> must be the same type as Self with all lifetimes replaced with ’a§type AsBytes<'a> = &'a [u8; 32]
§fn fixed_width() -> Option<usize>
Width of a fixed type, or None for variable width§fn from_bytes<'a>(data: &'a [u8]) -> <Hash as Value>::SelfType<'a>where
+ S: Serializer,
Serialize this value into the given Serde serializer. Read moresource§impl Value for Hash
§type SelfType<'a> = Hash
SelfType<’a> must be the same type as Self with all lifetimes replaced with ’a§type AsBytes<'a> = &'a [u8; 32]
source§fn fixed_width() -> Option<usize>
Width of a fixed type, or None for variable width§impl Copy for Hash
§impl Eq for Hash
§impl StructuralPartialEq for Hash
Auto Trait Implementations§
§impl Freeze for Hash
§impl RefUnwindSafe for Hash
§impl Send for Hash
§impl Sync for Hash
§impl Unpin for Hash
§impl UnwindSafe for Hash
Blanket Implementations§
source§impl Copy for Hash
source§impl Eq for Hash
source§impl StructuralPartialEq for Hash
Auto Trait Implementations§
§impl Freeze for Hash
§impl RefUnwindSafe for Hash
§impl Send for Hash
§impl Sync for Hash
§impl Unpin for Hash
§impl UnwindSafe for Hash
Blanket Implementations§
§impl<A, T> AsBits<T> for A
§fn as_bits<O>(&self) -> &BitSlice<T, O>where
diff --git a/pr/2595/docs/iroh_blobs/struct.HashAndFormat.html b/pr/2595/docs/iroh_blobs/struct.HashAndFormat.html
index 8eb7ba64d5..421c7e1439 100644
--- a/pr/2595/docs/iroh_blobs/struct.HashAndFormat.html
+++ b/pr/2595/docs/iroh_blobs/struct.HashAndFormat.html
@@ -1,37 +1,37 @@
-HashAndFormat in iroh_blobs - Rust Struct iroh_blobs::HashAndFormat
pub struct HashAndFormat {
+HashAndFormat in iroh_blobs - Rust Struct iroh_blobs::HashAndFormat
source · pub struct HashAndFormat {
pub hash: Hash,
pub format: BlobFormat,
}
Expand description
A hash and format pair
Fields§
§hash: HashThe hash
§format: BlobFormatThe format
-Implementations§
§impl HashAndFormat
pub fn new(hash: Hash, format: BlobFormat) -> HashAndFormat
Create a new hash and format pair.
-pub fn raw(hash: Hash) -> HashAndFormat
Create a new hash and format pair, using the default (raw) format.
-pub fn hash_seq(hash: Hash) -> HashAndFormat
Create a new hash and format pair, using the collection format.
-Trait Implementations§
§impl Clone for HashAndFormat
§fn clone(&self) -> HashAndFormat
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more§impl Debug for HashAndFormat
§impl<'de> Deserialize<'de> for HashAndFormat
§fn deserialize<D>(
+
Implementations§
source§impl HashAndFormat
sourcepub fn new(hash: Hash, format: BlobFormat) -> HashAndFormat
Create a new hash and format pair.
+sourcepub fn raw(hash: Hash) -> HashAndFormat
Create a new hash and format pair, using the default (raw) format.
+sourcepub fn hash_seq(hash: Hash) -> HashAndFormat
Create a new hash and format pair, using the collection format.
+Trait Implementations§
source§impl Clone for HashAndFormat
source§fn clone(&self) -> HashAndFormat
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moresource§impl Debug for HashAndFormat
source§impl<'de> Deserialize<'de> for HashAndFormat
source§fn deserialize<D>(
deserializer: D
) -> Result<HashAndFormat, <D as Deserializer<'de>>::Error>where
- D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more§impl Display for HashAndFormat
source§impl From<DownloadKind> for HashAndFormat
source§fn from(value: DownloadKind) -> Self
Converts to this type from the input type.source§impl From<HashAndFormat> for DownloadKind
source§fn from(value: HashAndFormat) -> Self
Converts to this type from the input type.§impl FromStr for HashAndFormat
§impl Hash for HashAndFormat
§fn hash<__H>(&self, state: &mut __H)where
+ D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl Display for HashAndFormat
source§impl From<DownloadKind> for HashAndFormat
source§fn from(value: DownloadKind) -> Self
Converts to this type from the input type.source§impl From<HashAndFormat> for DownloadKind
source§fn from(value: HashAndFormat) -> Self
Converts to this type from the input type.source§impl FromStr for HashAndFormat
source§impl Hash for HashAndFormat
§impl MaxSize for HashAndFormat
§const POSTCARD_MAX_SIZE: usize = 33usize
The maximum possible size that the serialization of this
-type can have, in bytes.§impl Ord for HashAndFormat
source§impl MaxSize for HashAndFormat
source§const POSTCARD_MAX_SIZE: usize = 33usize
The maximum possible size that the serialization of this
+type can have, in bytes.source§impl Ord for HashAndFormat
source§fn cmp(&self, other: &HashAndFormat) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more§impl PartialEq for HashAndFormat
§fn eq(&self, other: &HashAndFormat) -> bool
Restrict a value to a certain interval. Read moresource§impl PartialEq for HashAndFormat
source§fn eq(&self, other: &HashAndFormat) -> bool
This method tests for self and other values to be equal, and is used
by ==.§impl PartialOrd for HashAndFormat
§fn partial_cmp(&self, other: &HashAndFormat) -> Option<Ordering>
source§impl PartialOrd for HashAndFormat
source§fn partial_cmp(&self, other: &HashAndFormat) -> Option<Ordering>
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 <=
operator. Read moresource§impl Serialize for HashAndFormat
source§fn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
- S: Serializer,
Serialize this value into the given Serde serializer. Read more§impl Value for HashAndFormat
§type SelfType<'a> = HashAndFormat
SelfType<’a> must be the same type as Self with all lifetimes replaced with ’a§type AsBytes<'a> = [u8; 33]
§fn fixed_width() -> Option<usize>
Width of a fixed type, or None for variable width§fn from_bytes<'a>(data: &'a [u8]) -> <HashAndFormat as Value>::SelfType<'a>where
+ S: Serializer,
Serialize this value into the given Serde serializer. Read moresource§impl Value for HashAndFormat
§type SelfType<'a> = HashAndFormat
SelfType<’a> must be the same type as Self with all lifetimes replaced with ’a§type AsBytes<'a> = [u8; 33]
source§fn fixed_width() -> Option<usize>
Width of a fixed type, or None for variable widthsource§fn from_bytes<'a>(data: &'a [u8]) -> <HashAndFormat as Value>::SelfType<'a>where
HashAndFormat: 'a,
Deserializes data
-Implementations may return a view over data, or an owned typesource§fn as_bytes<'a, 'b>(
value: &'a <HashAndFormat as Value>::SelfType<'b>
) -> <HashAndFormat as Value>::AsBytes<'a>where
'b: 'a,
- HashAndFormat: 'a + 'b,
Serialize the value to a slice§impl Copy for HashAndFormat
§impl Eq for HashAndFormat
§impl StructuralPartialEq for HashAndFormat
Auto Trait Implementations§
§impl Freeze for HashAndFormat
§impl RefUnwindSafe for HashAndFormat
§impl Send for HashAndFormat
§impl Sync for HashAndFormat
§impl Unpin for HashAndFormat
§impl UnwindSafe for HashAndFormat
Blanket Implementations§
source§impl<T> Any for Twhere
+ HashAndFormat: 'a + 'b,
Serialize the value to a slicesource§impl Copy for HashAndFormat
source§impl Eq for HashAndFormat
source§impl StructuralPartialEq for HashAndFormat
Auto Trait Implementations§
§impl Freeze for HashAndFormat
§impl RefUnwindSafe for HashAndFormat
§impl Send for HashAndFormat
§impl Sync for HashAndFormat
§impl Unpin for HashAndFormat
§impl UnwindSafe for HashAndFormat
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
diff --git a/pr/2595/docs/iroh_docs/actor/struct.SyncHandle.html b/pr/2595/docs/iroh_docs/actor/struct.SyncHandle.html
index cfd29c2ce8..6c70a0ff39 100644
--- a/pr/2595/docs/iroh_docs/actor/struct.SyncHandle.html
+++ b/pr/2595/docs/iroh_docs/actor/struct.SyncHandle.html
@@ -26,7 +26,7 @@ waiting for the actor to finish happens in an async context, and therefore that
namespace: NamespaceId,
author: AuthorId,
key: Bytes,
- hash: Hash,
+ hash: Hash,
len: u64
) -> Result<()>sourcepub async fn delete_prefix(
&self,
diff --git a/pr/2595/docs/iroh_docs/engine/enum.LiveEvent.html b/pr/2595/docs/iroh_docs/engine/enum.LiveEvent.html
index ceb8545b50..f0d33bcb21 100644
--- a/pr/2595/docs/iroh_docs/engine/enum.LiveEvent.html
+++ b/pr/2595/docs/iroh_docs/engine/enum.LiveEvent.html
@@ -3,34 +3,34 @@
entry: Entry,
},
InsertRemote {
- from: PublicKey,
+ from: PublicKey,
entry: Entry,
content_status: ContentStatus,
},
ContentReady {
- hash: Hash,
+ hash: Hash,
},
PendingContentReady,
- NeighborUp(PublicKey),
- NeighborDown(PublicKey),
+ NeighborUp(PublicKey),
+ NeighborDown(PublicKey),
SyncFinished(SyncEvent),
}Expand description
Events informing about actions of the live sync progress.
Variants§
§InsertLocal
A local insertion.
§InsertRemote
Received a remote insert.
-Fields
§from: PublicKeyThe peer that sent us the entry.
+Fields
§content_status: ContentStatusIf the content is available at the local node
§ContentReady
The content of an entry was downloaded and is now available at the local node
-Fields
§hash: HashThe content hash of the newly available entry content
+§PendingContentReady
All pending content is now ready.
This event signals that all queued content downloads from the last sync run have either
completed or failed.
It will only be emitted after a Self::SyncFinished event, never before.
Receiving this event does not guarantee that all content in the document is available. If
blobs failed to download, this event will still be emitted after all operations completed.
-§NeighborUp(PublicKey)
We have a new neighbor in the swarm.
-§NeighborDown(PublicKey)
We lost a neighbor in the swarm.
+§NeighborUp(PublicKey)
We have a new neighbor in the swarm.
+§NeighborDown(PublicKey)
We lost a neighbor in the swarm.
§SyncFinished(SyncEvent)
A set-reconciliation sync finished.
Trait Implementations§
source§impl<'de> Deserialize<'de> for LiveEvent
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl PartialEq for LiveEvent
source§fn eq(&self, other: &LiveEvent) -> bool
This method tests for self and other values to be equal, and is used
diff --git a/pr/2595/docs/iroh_docs/engine/fn.entry_to_content_status.html b/pr/2595/docs/iroh_docs/engine/fn.entry_to_content_status.html
index 459a6719d2..3b39df6428 100644
--- a/pr/2595/docs/iroh_docs/engine/fn.entry_to_content_status.html
+++ b/pr/2595/docs/iroh_docs/engine/fn.entry_to_content_status.html
@@ -1,2 +1,2 @@
-entry_to_content_status in iroh_docs::engine - Rust Function iroh_docs::engine::entry_to_content_status
source · pub fn entry_to_content_status(entry: Result<EntryStatus>) -> ContentStatus
Expand description
Converts an [EntryStatus] into a [‘ContentStatus’].
+entry_to_content_status in iroh_docs::engine - Rust Function iroh_docs::engine::entry_to_content_status
source · pub fn entry_to_content_status(entry: Result<EntryStatus>) -> ContentStatus
Expand description
Converts an EntryStatus into a [‘ContentStatus’].
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_docs/engine/index.html b/pr/2595/docs/iroh_docs/engine/index.html
index 5f78e23386..622ab4b871 100644
--- a/pr/2595/docs/iroh_docs/engine/index.html
+++ b/pr/2595/docs/iroh_docs/engine/index.html
@@ -1,4 +1,4 @@
iroh_docs::engine - Rust Expand description
Handlers and actors to for live syncing replicas.
crate::Replica is also called documents here.
Structs§
- Persistent default author for a docs engine.
- The sync engine coordinates actors that manage open documents, set-reconciliation syncs with
-peers and a gossip swarm for each syncing document.
- Event emitted when a sync operation completes
Enums§
- Where to persist the default author.
- Events informing about actions of the live sync progress.
- Why we performed a sync exchange
- Why we started a sync request
Functions§
- Converts an [
EntryStatus] into a [‘ContentStatus’].
\ No newline at end of file
+peers and a gossip swarm for each syncing document.Event emitted when a sync operation completes Enums§
- Where to persist the default author.
- Events informing about actions of the live sync progress.
- Why we performed a sync exchange
- Why we started a sync request
Functions§
- Converts an
EntryStatus into a [‘ContentStatus’].
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_docs/engine/struct.Engine.html b/pr/2595/docs/iroh_docs/engine/struct.Engine.html
index 1b88a96726..46cd25179e 100644
--- a/pr/2595/docs/iroh_docs/engine/struct.Engine.html
+++ b/pr/2595/docs/iroh_docs/engine/struct.Engine.html
@@ -8,12 +8,12 @@ peers and a gossip swarm for each syncing document.
Fields§
§endpoint: EndpointEndpoint used by the engine.
§sync: SyncHandleHandle to the actor thread.
The persistent default author for this engine.
-Implementations§
source§impl Engine
Implementations§
source§impl Engine
sourcepub async fn spawn<B: Store>(
endpoint: Endpoint,
- gossip: Gossip,
+ gossip: Gossip,
replica_store: Store,
bao_store: B,
- downloader: Downloader,
+ downloader: Downloader,
default_author_storage: DefaultAuthorStorage
) -> Result<Self>
Start the sync engine.
This will spawn two tokio tasks for the live sync coordination and gossip actors, and a
@@ -21,7 +21,7 @@ thread for the sourcepub async fn start_sync(
&self,
namespace: NamespaceId,
- peers: Vec<NodeAddr>
+ peers: Vec<NodeAddr>
) -> Result<()>
Start to sync a document.
If peers is non-empty, it will both do an initial set-reconciliation sync with each peer,
and join an iroh-gossip swarm with these peers to receive and broadcast document updates.
diff --git a/pr/2595/docs/iroh_docs/engine/struct.SyncEvent.html b/pr/2595/docs/iroh_docs/engine/struct.SyncEvent.html
index 49ba954022..d7eb730d81 100644
--- a/pr/2595/docs/iroh_docs/engine/struct.SyncEvent.html
+++ b/pr/2595/docs/iroh_docs/engine/struct.SyncEvent.html
@@ -1,11 +1,11 @@
SyncEvent in iroh_docs::engine - Rust pub struct SyncEvent {
- pub peer: PublicKey,
+ pub peer: PublicKey,
pub origin: Origin,
pub finished: SystemTime,
pub started: SystemTime,
pub result: Result<SyncDetails, String>,
}
Expand description
Event emitted when a sync operation completes
-Fields§
§peer: PublicKeyPeer we synced with
+Fields§
§peer: PublicKeyPeer we synced with
§origin: OriginOrigin of the sync exchange
§finished: SystemTimeTimestamp when the sync started
§started: SystemTimeTimestamp when the sync finished
diff --git a/pr/2595/docs/iroh_docs/index.html b/pr/2595/docs/iroh_docs/index.html
index a37d30e2a6..41c792c5e5 100644
--- a/pr/2595/docs/iroh_docs/index.html
+++ b/pr/2595/docs/iroh_docs/index.html
@@ -1,7 +1,7 @@
iroh_docs - Rust Expand description
Multi-dimensional key-value documents with an efficient synchronization protocol
The crate operates on Replicas. A replica contains an unlimited number of
Entries. Each entry is identified by a key, its author, and the replica’s
-namespace. Its value is the 32-byte BLAKE3 hash
+namespace. Its value is the 32-byte BLAKE3 hash
of the entry’s content data, the size of this content data, and a timestamp.
The content data itself is not stored or transferred through a replica.
All entries in a replica are signed with two keypairs:
diff --git a/pr/2595/docs/iroh_docs/net/enum.AcceptError.html b/pr/2595/docs/iroh_docs/net/enum.AcceptError.html
index 87e9a07ad3..cf11b5b695 100644
--- a/pr/2595/docs/iroh_docs/net/enum.AcceptError.html
+++ b/pr/2595/docs/iroh_docs/net/enum.AcceptError.html
@@ -3,31 +3,31 @@
error: Error,
},
Open {
- peer: PublicKey,
+ peer: PublicKey,
error: Error,
},
Abort {
- peer: PublicKey,
+ peer: PublicKey,
namespace: NamespaceId,
reason: AbortReason,
},
Sync {
- peer: PublicKey,
+ peer: PublicKey,
namespace: Option<NamespaceId>,
error: Error,
},
Close {
- peer: PublicKey,
+ peer: PublicKey,
namespace: Option<NamespaceId>,
error: Error,
},
}Expand description
Errors that may occur on handling incoming sync connections.
Variants§
§Connect
Failed to establish connection
§Open
Failed to open replica
-§Abort
We aborted the sync request.
-§Sync
Failed to run sync
-§Close
Failed to close
-Implementations§
source§impl AcceptError
Implementations§
Trait Implementations§
source§impl Debug for AcceptError
source§impl Display for AcceptError
source§impl Error for AcceptError
source§fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more1.0.0 · source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()Auto Trait Implementations§
§impl Freeze for AcceptError
§impl RefUnwindSafe for AcceptError
§impl Send for AcceptError
§impl Sync for AcceptError
§impl Unpin for AcceptError
§impl UnwindSafe for AcceptError
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
diff --git a/pr/2595/docs/iroh_docs/net/fn.connect_and_sync.html b/pr/2595/docs/iroh_docs/net/fn.connect_and_sync.html
index 1ee6909d53..7bec313309 100644
--- a/pr/2595/docs/iroh_docs/net/fn.connect_and_sync.html
+++ b/pr/2595/docs/iroh_docs/net/fn.connect_and_sync.html
@@ -2,6 +2,6 @@
endpoint: &Endpoint,
sync: &SyncHandle,
namespace: NamespaceId,
- peer: NodeAddr
+ peer: NodeAddr
) -> Result<SyncFinished, ConnectError>Expand description
Connect to a peer and sync a replica
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_docs/net/fn.handle_connection.html b/pr/2595/docs/iroh_docs/net/fn.handle_connection.html
index 347a0c22bf..e96816b362 100644
--- a/pr/2595/docs/iroh_docs/net/fn.handle_connection.html
+++ b/pr/2595/docs/iroh_docs/net/fn.handle_connection.html
@@ -3,6 +3,6 @@
connecting: Connecting,
accept_cb: F
) -> Result<SyncFinished, AcceptError>where
- F: Fn(NamespaceId, PublicKey) -> Fut,
+ F: Fn(NamespaceId, PublicKey) -> Fut,
Fut: Future<Output = AcceptOutcome>,Expand description
Handle an iroh-docs connection and sync all shared documents in the replica store.
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_docs/net/struct.SyncFinished.html b/pr/2595/docs/iroh_docs/net/struct.SyncFinished.html
index 74ab2f6632..dcd549e6fc 100644
--- a/pr/2595/docs/iroh_docs/net/struct.SyncFinished.html
+++ b/pr/2595/docs/iroh_docs/net/struct.SyncFinished.html
@@ -1,11 +1,11 @@
SyncFinished in iroh_docs::net - Rust Struct iroh_docs::net::SyncFinished
source · pub struct SyncFinished {
pub namespace: NamespaceId,
- pub peer: PublicKey,
+ pub peer: PublicKey,
pub outcome: SyncOutcome,
pub timings: Timings,
}
Expand description
Details of a finished sync operation.
Fields§
§namespace: NamespaceIdThe namespace that was synced.
-§peer: PublicKeyThe peer we syned with.
+§peer: PublicKeyThe peer we syned with.
§outcome: SyncOutcomeThe outcome of the sync operation
§timings: TimingsThe time this operation took
Trait Implementations§
source§impl Clone for SyncFinished
source§fn clone(&self) -> SyncFinished
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moreAuto Trait Implementations§
§impl Freeze for SyncFinished
§impl RefUnwindSafe for SyncFinished
§impl Send for SyncFinished
§impl Sync for SyncFinished
§impl Unpin for SyncFinished
§impl UnwindSafe for SyncFinished
Blanket Implementations§
source§impl<T> Any for Twhere
diff --git a/pr/2595/docs/iroh_docs/store/fs/struct.ContentHashesIterator.html b/pr/2595/docs/iroh_docs/store/fs/struct.ContentHashesIterator.html
index 8bebf68ec6..df1fc8865f 100644
--- a/pr/2595/docs/iroh_docs/store/fs/struct.ContentHashesIterator.html
+++ b/pr/2595/docs/iroh_docs/store/fs/struct.ContentHashesIterator.html
@@ -6,7 +6,7 @@ It needs a copy of a redb::ReadOnlyTable to be self-contained.
Implementations§
Trait Implementations§
source§impl Debug for ContentHashesIterator
Trait Implementations§
source§impl Debug for ContentHashesIterator
source§impl Iterator for ContentHashesIterator
source§fn next(&mut self) -> Option<Self::Item>
Advances the iterator and returns the next value. Read moresource§fn next_chunk<const N: usize>(
&mut self
) -> Result<[Self::Item; N], IntoIter<Self::Item, N>>where
Self: Sized,
🔬This is a nightly-only experimental API. (iter_next_chunk)Advances the iterator and returns an array containing the next N values. Read more1.0.0 · source§fn size_hint(&self) -> (usize, Option<usize>)
Returns the bounds on the remaining length of the iterator. Read more1.0.0 · source§fn count(self) -> usizewhere
diff --git a/pr/2595/docs/iroh_docs/struct.AuthorId.html b/pr/2595/docs/iroh_docs/struct.AuthorId.html
index 7dfa3dea5b..02221b0eb6 100644
--- a/pr/2595/docs/iroh_docs/struct.AuthorId.html
+++ b/pr/2595/docs/iroh_docs/struct.AuthorId.html
@@ -156,6 +156,6 @@ letters are used (e.g. F9B4CA)
Into<Dispatch>, source§fn with_current_subscriber(self) -> WithDispatch<Self>
source§impl<T> DeserializeOwned for Twhere
- T: for<'de> Deserialize<'de>,
§impl<T> PeerIdentity for Twhere
+ T: for<'de> Deserialize<'de>,
source§impl<T> PeerIdentity for T
source§impl<T> RuleType for T
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_docs/struct.AuthorPublicKey.html b/pr/2595/docs/iroh_docs/struct.AuthorPublicKey.html
index 8e72b11c8a..7a83ce68e4 100644
--- a/pr/2595/docs/iroh_docs/struct.AuthorPublicKey.html
+++ b/pr/2595/docs/iroh_docs/struct.AuthorPublicKey.html
@@ -148,6 +148,6 @@ builds. Into<Dispatch>,source§fn with_current_subscriber(self) -> WithDispatch<Self>
source§impl<T> DeserializeOwned for Twhere
- T: for<'de> Deserialize<'de>,
§impl<T> PeerIdentity for Twhere
+ T: for<'de> Deserialize<'de>,
source§impl<T> PeerIdentity for T
source§impl<T> RuleType for T
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_docs/struct.DocTicket.html b/pr/2595/docs/iroh_docs/struct.DocTicket.html
index d53a93c4c4..fd1bb5eb02 100644
--- a/pr/2595/docs/iroh_docs/struct.DocTicket.html
+++ b/pr/2595/docs/iroh_docs/struct.DocTicket.html
@@ -1,13 +1,13 @@
DocTicket in iroh_docs - Rust pub struct DocTicket {
pub capability: Capability,
- pub nodes: Vec<NodeAddr>,
+ pub nodes: Vec<NodeAddr>,
}
Expand description
Contains both a key (either secret or public) to a document, and a list of peers to join.
Fields§
§capability: Capabilityeither a public or private key
-§nodes: Vec<NodeAddr>A list of nodes to contact.
-Implementations§
source§impl DocTicket
sourcepub fn new(capability: Capability, peers: Vec<NodeAddr>) -> Self
Create a new doc ticket
+§nodes: Vec<NodeAddr>A list of nodes to contact.
+Implementations§
Trait Implementations§
source§impl<'de> Deserialize<'de> for DocTicket
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
- __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreAuto Trait Implementations§
§impl Freeze for DocTicket
§impl RefUnwindSafe for DocTicket
§impl Send for DocTicket
§impl Sync for DocTicket
§impl Unpin for DocTicket
§impl UnwindSafe for DocTicket
Blanket Implementations§
source§impl<T> Any for Twhere
+ __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreAuto Trait Implementations§
§impl Freeze for DocTicket
§impl RefUnwindSafe for DocTicket
§impl Send for DocTicket
§impl Sync for DocTicket
§impl Unpin for DocTicket
§impl UnwindSafe for DocTicket
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
diff --git a/pr/2595/docs/iroh_docs/struct.NamespaceId.html b/pr/2595/docs/iroh_docs/struct.NamespaceId.html
index 433d51afc6..f9acda8e94 100644
--- a/pr/2595/docs/iroh_docs/struct.NamespaceId.html
+++ b/pr/2595/docs/iroh_docs/struct.NamespaceId.html
@@ -156,6 +156,6 @@ letters are used (e.g. F9B4CA)
Into<Dispatch>, source§fn with_current_subscriber(self) -> WithDispatch<Self>
source§impl<T> DeserializeOwned for Twhere
- T: for<'de> Deserialize<'de>,
§impl<T> PeerIdentity for Twhere
+ T: for<'de> Deserialize<'de>,
source§impl<T> PeerIdentity for T
source§impl<T> RuleType for T
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_docs/struct.NamespacePublicKey.html b/pr/2595/docs/iroh_docs/struct.NamespacePublicKey.html
index 350dea9049..72b75ed510 100644
--- a/pr/2595/docs/iroh_docs/struct.NamespacePublicKey.html
+++ b/pr/2595/docs/iroh_docs/struct.NamespacePublicKey.html
@@ -147,6 +147,6 @@ builds.Into<Dispatch>,source§fn with_current_subscriber(self) -> WithDispatch<Self>
source§impl<T> DeserializeOwned for Twhere
- T: for<'de> Deserialize<'de>,
§impl<T> PeerIdentity for Twhere
+ T: for<'de> Deserialize<'de>,
source§impl<T> PeerIdentity for T
source§impl<T> RuleType for T
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_docs/sync/struct.Entry.html b/pr/2595/docs/iroh_docs/sync/struct.Entry.html
index 55bf06044f..055a4b6f54 100644
--- a/pr/2595/docs/iroh_docs/sync/struct.Entry.html
+++ b/pr/2595/docs/iroh_docs/sync/struct.Entry.html
@@ -1,6 +1,6 @@
Entry in iroh_docs::sync - Rust pub struct Entry { /* private fields */ }
Expand description
A single entry in a Replica
An entry is identified by a key, its Author, and the Replica’s
-NamespaceSecret. Its value is the 32-byte BLAKE3 hash
+NamespaceSecret. Its value is the 32-byte BLAKE3 hash
of the entry’s content data, the size of this content data, and a timestamp.
Implementations§
source§impl Entry
sourcepub fn new(id: RecordIdentifier, record: Record) -> Self
Create a new entry
sourcepub fn new_empty(id: RecordIdentifier) -> Self
Create a new empty entry with the current timestamp.
@@ -15,7 +15,7 @@ of the entry’s content data, the size of this content data, and a timestamp.
sourcepub fn sign(self, namespace: &NamespaceSecret, author: &Author) -> SignedEntry
Sign this entry with a NamespaceSecret and Author.
Methods from Deref<Target = Record>§
sourcepub fn content_len(&self) -> u64
Get the length of the data addressed by this record’s content hash.
-sourcepub fn content_hash(&self) -> Hash
Get the [struct@Hash] of the content data of this record.
+sourcepub fn content_hash(&self) -> Hash
Get the Hash of the content data of this record.
Trait Implementations§
source§impl<'de> Deserialize<'de> for Entry
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl From<SignedEntry> for Entry
source§fn from(value: SignedEntry) -> Self
Converts to this type from the input type.source§impl Ord for Entry
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
diff --git a/pr/2595/docs/iroh_docs/sync/struct.Record.html b/pr/2595/docs/iroh_docs/sync/struct.Record.html
index 94479a973e..f06cccab52 100644
--- a/pr/2595/docs/iroh_docs/sync/struct.Record.html
+++ b/pr/2595/docs/iroh_docs/sync/struct.Record.html
@@ -1,11 +1,11 @@
Record in iroh_docs::sync - Rust pub struct Record { /* private fields */ }
Expand description
The data part of an entry in a Replica.
-Implementations§
source§impl Record
Implementations§
source§impl Record
sourcepub fn empty_current() -> Self
Create a tombstone record with the timestamp set to now.
sourcepub fn new_current(hash: Hash, len: u64) -> Self
Create a new Record with the timestamp set to now.
+sourcepub fn new_current(hash: Hash, len: u64) -> Self
Create a new Record with the timestamp set to now.
sourcepub fn content_len(&self) -> u64
Get the length of the data addressed by this record’s content hash.
-sourcepub fn content_hash(&self) -> Hash
Get the [struct@Hash] of the content data of this record.
+sourcepub fn content_hash(&self) -> Hash
Get the Hash of the content data of this record.
Trait Implementations§
source§impl<'de> Deserialize<'de> for Record
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl Ord for Record
Ordering for entry values.
diff --git a/pr/2595/docs/iroh_docs/sync/struct.Replica.html b/pr/2595/docs/iroh_docs/sync/struct.Replica.html
index 23a9798651..c4e161f3c3 100644
--- a/pr/2595/docs/iroh_docs/sync/struct.Replica.html
+++ b/pr/2595/docs/iroh_docs/sync/struct.Replica.html
@@ -5,7 +5,7 @@
&mut self,
key: impl AsRef<[u8]>,
author: &Author,
- hash: Hash,
+ hash: Hash,
len: u64
) -> Result<usize, InsertError>Insert a new record at the given key.
The entry will by signed by the provided author.
@@ -35,7 +35,7 @@ or an error if the entry failed to validate or if a store operation failed.
key: impl AsRef<[u8]>,
author: &Author,
data: impl AsRef<[u8]>
-) -> Result<Hash, InsertError>Hashes the given data and inserts it.
+) -> Result<Hash, InsertError>Hashes the given data and inserts it.
This does not store the content, just the record of it.
Returns the calculated hash.
sourcepub fn record_id(
diff --git a/pr/2595/docs/iroh_docs/sync/struct.SignedEntry.html b/pr/2595/docs/iroh_docs/sync/struct.SignedEntry.html
index 21644eacb1..9ef5e98134 100644
--- a/pr/2595/docs/iroh_docs/sync/struct.SignedEntry.html
+++ b/pr/2595/docs/iroh_docs/sync/struct.SignedEntry.html
@@ -14,7 +14,7 @@
sourcepub fn signature(&self) -> &EntrySignature
Get the signature.
sourcepub fn validate_empty(&self) -> Result<(), ValidationFailure>
Validate that the entry has the empty hash if the length is 0, or a non-zero length.
sourcepub fn content_hash(&self) -> Hash
Get the content [struct@Hash] of the entry.
+sourcepub fn content_hash(&self) -> Hash
Get the content Hash of the entry.
sourcepub fn content_len(&self) -> u64
Get the content length of the entry.
Get the author bytes of this entry.
Methods from Deref<Target = Record>§
sourcepub fn content_len(&self) -> u64
Get the length of the data addressed by this record’s content hash.
-sourcepub fn content_hash(&self) -> Hash
Get the [struct@Hash] of the content data of this record.
+sourcepub fn content_hash(&self) -> Hash
Get the Hash of the content data of this record.
Trait Implementations§
source§impl Clone for SignedEntry
source§fn clone(&self) -> SignedEntry
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moresource§impl Debug for SignedEntry
source§impl Deref for SignedEntry
source§impl<'de> Deserialize<'de> for SignedEntry
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl From<SignedEntry> for Entry
source§fn from(value: SignedEntry) -> Self
Converts to this type from the input type.source§impl Ord for SignedEntry
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
diff --git a/pr/2595/docs/iroh_docs/sync/type.ContentStatusCallback.html b/pr/2595/docs/iroh_docs/sync/type.ContentStatusCallback.html
index 46d5a5a49c..84ffdbe8ee 100644
--- a/pr/2595/docs/iroh_docs/sync/type.ContentStatusCallback.html
+++ b/pr/2595/docs/iroh_docs/sync/type.ContentStatusCallback.html
@@ -1,2 +1,2 @@
-ContentStatusCallback in iroh_docs::sync - Rust Type Alias iroh_docs::sync::ContentStatusCallback
source · pub type ContentStatusCallback = Arc<dyn Fn(Hash) -> ContentStatus + Send + Sync + 'static>;
Expand description
Callback that may be set on a replica to determine the availability status for a content hash.
+ContentStatusCallback in iroh_docs::sync - Rust Type Alias iroh_docs::sync::ContentStatusCallback
source · pub type ContentStatusCallback = Arc<dyn Fn(Hash) -> ContentStatus + Send + Sync + 'static>;
Expand description
Callback that may be set on a replica to determine the availability status for a content hash.
Aliased Type§
struct ContentStatusCallback { /* private fields */ }
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_net/discovery/dns/index.html b/pr/2595/docs/iroh_net/discovery/dns/index.html
index 5a80538422..a752b49d78 100644
--- a/pr/2595/docs/iroh_net/discovery/dns/index.html
+++ b/pr/2595/docs/iroh_net/discovery/dns/index.html
@@ -1,2 +1,2 @@
-iroh_net::discovery::dns - Rust Expand description
DNS node discovery for iroh-net
+iroh_net::discovery::dns - Rust Expand description
DNS node discovery for iroh-net
Structs§
- DNS node discovery
Constants§
- The n0 testing DNS node origin, for production.
- The n0 testing DNS node origin, for testing.
- Testing DNS node origin, must run server from
crate::test_utils::DnsPkarrServer.
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_net/discovery/dns/struct.DnsDiscovery.html b/pr/2595/docs/iroh_net/discovery/dns/struct.DnsDiscovery.html
index 3e7d5d71cc..7628fb45a9 100644
--- a/pr/2595/docs/iroh_net/discovery/dns/struct.DnsDiscovery.html
+++ b/pr/2595/docs/iroh_net/discovery/dns/struct.DnsDiscovery.html
@@ -28,7 +28,7 @@ custom discovery mechanism.
For testing it is also possible to use the N0_DNS_NODE_ORIGIN_STAGING domain
with DnsDiscovery::new. This would then use a hosted discovery service again,
but for testing purposes.
-Trait Implementations§
Trait Implementations§
source§impl Debug for DnsDiscovery
source§impl Discovery for DnsDiscovery
source§fn resolve(
&self,
ep: Endpoint,
node_id: NodeId
diff --git a/pr/2595/docs/iroh_net/discovery/trait.Discovery.html b/pr/2595/docs/iroh_net/discovery/trait.Discovery.html
index a53a618708..d3832a56b5 100644
--- a/pr/2595/docs/iroh_net/discovery/trait.Discovery.html
+++ b/pr/2595/docs/iroh_net/discovery/trait.Discovery.html
@@ -29,4 +29,4 @@ These tasks will be run on the runtime of the Option<BoxStream<Result<DiscoveryItem>>>
Implementors§
source§impl Discovery for DnsDiscovery
source§impl Discovery for LocalSwarmDiscovery
source§impl Discovery for PkarrPublisher
source§impl Discovery for PkarrResolver
source§impl Discovery for ConcurrentDiscovery
\ No newline at end of file
+
Implementors§
source§impl Discovery for DnsDiscovery
source§impl Discovery for LocalSwarmDiscovery
source§impl Discovery for PkarrPublisher
source§impl Discovery for PkarrResolver
source§impl Discovery for ConcurrentDiscovery
\ No newline at end of file
diff --git a/pr/2595/docs/src/iroh_net/discovery/dns.rs.html b/pr/2595/docs/src/iroh_net/discovery/dns.rs.html
index dd1a279fb3..1d32545ed3 100644
--- a/pr/2595/docs/src/iroh_net/discovery/dns.rs.html
+++ b/pr/2595/docs/src/iroh_net/discovery/dns.rs.html
@@ -97,6 +97,10 @@
97
98
99
+100
+101
+102
+103
//! DNS node discovery for iroh-net
use anyhow::Result;
@@ -182,6 +186,10 @@
fn resolve(&self, ep: Endpoint, node_id: NodeId) -> Option<BoxStream<Result<DiscoveryItem>>> {
let resolver = ep.dns_resolver().clone();
let origin_domain = self.origin_domain.clone();
+ #[cfg(any(test, feature = "test-utils"))]
+ if origin_domain.contains(&TEST_DNS_NODE_ORIGIN.to_string()) {
+ panic!("wait. THIS IS ILLEGAL!");
+ }
let fut = async move {
let node_addr = resolver
.lookup_by_id_staggered(&node_id, &origin_domain, DNS_STAGGERING_MS)
diff --git a/pr/2595/docs/trait.impl/iroh_base/ticket/trait.Ticket.js b/pr/2595/docs/trait.impl/iroh_base/ticket/trait.Ticket.js
index 12fa1e3ee5..5d209fabd2 100644
--- a/pr/2595/docs/trait.impl/iroh_base/ticket/trait.Ticket.js
+++ b/pr/2595/docs/trait.impl/iroh_base/ticket/trait.Ticket.js
@@ -1,5 +1,5 @@
(function() {var implementors = {
"iroh":[],
"iroh_base":[],
-"iroh_docs":[["impl Ticket for DocTicket"]]
+"iroh_docs":[["impl Ticket for DocTicket"]]
};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
diff --git a/pr/2595/docs/type.impl/std/primitive.array.js b/pr/2595/docs/type.impl/std/primitive.array.js
index 588a8b53a3..3006964922 100644
--- a/pr/2595/docs/type.impl/std/primitive.array.js
+++ b/pr/2595/docs/type.impl/std/primitive.array.js
@@ -1,4 +1,4 @@
(function() {var type_impls = {
"iroh":[["source§impl<T, const N: usize> [T; N]
1.55.0 · sourcepub fn map<F, U>(self, f: F) -> [U; N]where\n F: FnMut(T) -> U,
Returns an array of the same size as self, with function f applied to each element\nin order.
\nIf you don’t necessarily need a new fixed-size array, consider using\nIterator::map instead.
\n§Note on performance and stack usage
\nUnfortunately, usages of this method are currently not always optimized\nas well as they could be. This mainly concerns large arrays, as mapping\nover small arrays seem to be optimized just fine. Also note that in\ndebug mode (i.e. without any optimizations), this method can use a lot\nof stack space (a few times the size of the array or more).
\nTherefore, in performance-critical code, try to avoid using this method\non large arrays or check the emitted code. Also try to avoid chained\nmaps (e.g. arr.map(...).map(...)).
\nIn many cases, you can instead use Iterator::map by calling .iter()\nor .into_iter() on your array. [T; N]::map is only necessary if you\nreally need a new array of the same size as the result. Rust’s lazy\niterators tend to get optimized very well.
\n§Examples
\nlet x = [1, 2, 3];\nlet y = x.map(|v| v + 1);\nassert_eq!(y, [2, 3, 4]);\n\nlet x = [1, 2, 3];\nlet mut temp = 0;\nlet y = x.map(|v| { temp += 1; v * temp });\nassert_eq!(y, [1, 4, 9]);\n\nlet x = [\"Ferris\", \"Bueller's\", \"Day\", \"Off\"];\nlet y = x.map(|v| v.len());\nassert_eq!(y, [6, 9, 3, 3]);
\nsourcepub fn try_map<F, R>(\n self,\n f: F\n) -> <<R as Try>::Residual as Residual<[<R as Try>::Output; N]>>::TryType
🔬This is a nightly-only experimental API. (array_try_map)
A fallible function f applied to each element on array self in order to\nreturn an array the same size as self or the first error encountered.
\nThe return type of this function depends on the return type of the closure.\nIf you return Result<T, E> from the closure, you’ll get a Result<[T; N], E>.\nIf you return Option<T> from the closure, you’ll get an Option<[T; N]>.
\n§Examples
\n#![feature(array_try_map)]\n\nlet a = [\"1\", \"2\", \"3\"];\nlet b = a.try_map(|v| v.parse::<u32>()).unwrap().map(|v| v + 1);\nassert_eq!(b, [2, 3, 4]);\n\nlet a = [\"1\", \"2a\", \"3\"];\nlet b = a.try_map(|v| v.parse::<u32>());\nassert!(b.is_err());\n\nuse std::num::NonZero;\n\nlet z = [1, 2, 0, 3, 4];\nassert_eq!(z.try_map(NonZero::new), None);\n\nlet a = [1, 2, 3];\nlet b = a.try_map(NonZero::new);\nlet c = b.map(|x| x.map(NonZero::get));\nassert_eq!(c, Some(a));
\n1.57.0 (const: 1.57.0) · sourcepub const fn as_slice(&self) -> &[T]
Returns a slice containing the entire array. Equivalent to &s[..].
\n1.57.0 · sourcepub fn as_mut_slice(&mut self) -> &mut [T]
Returns a mutable slice containing the entire array. Equivalent to\n&mut s[..].
\n1.77.0 · sourcepub fn each_ref(&self) -> [&T; N]
Borrows each element and returns an array of references with the same\nsize as self.
\n§Example
\nlet floats = [3.1, 2.7, -1.0];\nlet float_refs: [&f64; 3] = floats.each_ref();\nassert_eq!(float_refs, [&3.1, &2.7, &-1.0]);
\nThis method is particularly useful if combined with other methods, like\nmap. This way, you can avoid moving the original\narray if its elements are not Copy.
\n\nlet strings = [\"Ferris\".to_string(), \"♥\".to_string(), \"Rust\".to_string()];\nlet is_ascii = strings.each_ref().map(|s| s.is_ascii());\nassert_eq!(is_ascii, [true, false, true]);\n\n// We can still access the original array: it has not been moved.\nassert_eq!(strings.len(), 3);
\n1.77.0 · sourcepub fn each_mut(&mut self) -> [&mut T; N]
Borrows each element mutably and returns an array of mutable references\nwith the same size as self.
\n§Example
\n\nlet mut floats = [3.1, 2.7, -1.0];\nlet float_refs: [&mut f64; 3] = floats.each_mut();\n*float_refs[0] = 0.0;\nassert_eq!(float_refs, [&mut 0.0, &mut 2.7, &mut -1.0]);\nassert_eq!(floats, [0.0, 2.7, -1.0]);
\nsourcepub fn split_array_ref<const M: usize>(&self) -> (&[T; M], &[T])
🔬This is a nightly-only experimental API. (split_array)
Divides one array reference into two at an index.
\nThe first will contain all indices from [0, M) (excluding\nthe index M itself) and the second will contain all\nindices from [M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet v = [1, 2, 3, 4, 5, 6];\n\n{\n let (left, right) = v.split_array_ref::<0>();\n assert_eq!(left, &[]);\n assert_eq!(right, &[1, 2, 3, 4, 5, 6]);\n}\n\n{\n let (left, right) = v.split_array_ref::<2>();\n assert_eq!(left, &[1, 2]);\n assert_eq!(right, &[3, 4, 5, 6]);\n}\n\n{\n let (left, right) = v.split_array_ref::<6>();\n assert_eq!(left, &[1, 2, 3, 4, 5, 6]);\n assert_eq!(right, &[]);\n}
\nsourcepub fn split_array_mut<const M: usize>(&mut self) -> (&mut [T; M], &mut [T])
🔬This is a nightly-only experimental API. (split_array)
Divides one mutable array reference into two at an index.
\nThe first will contain all indices from [0, M) (excluding\nthe index M itself) and the second will contain all\nindices from [M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet mut v = [1, 0, 3, 0, 5, 6];\nlet (left, right) = v.split_array_mut::<2>();\nassert_eq!(left, &mut [1, 0][..]);\nassert_eq!(right, &mut [3, 0, 5, 6]);\nleft[1] = 2;\nright[1] = 4;\nassert_eq!(v, [1, 2, 3, 4, 5, 6]);
\nsourcepub fn rsplit_array_ref<const M: usize>(&self) -> (&[T], &[T; M])
🔬This is a nightly-only experimental API. (split_array)
Divides one array reference into two at an index from the end.
\nThe first will contain all indices from [0, N - M) (excluding\nthe index N - M itself) and the second will contain all\nindices from [N - M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet v = [1, 2, 3, 4, 5, 6];\n\n{\n let (left, right) = v.rsplit_array_ref::<0>();\n assert_eq!(left, &[1, 2, 3, 4, 5, 6]);\n assert_eq!(right, &[]);\n}\n\n{\n let (left, right) = v.rsplit_array_ref::<2>();\n assert_eq!(left, &[1, 2, 3, 4]);\n assert_eq!(right, &[5, 6]);\n}\n\n{\n let (left, right) = v.rsplit_array_ref::<6>();\n assert_eq!(left, &[]);\n assert_eq!(right, &[1, 2, 3, 4, 5, 6]);\n}
\nsourcepub fn rsplit_array_mut<const M: usize>(&mut self) -> (&mut [T], &mut [T; M])
🔬This is a nightly-only experimental API. (split_array)
Divides one mutable array reference into two at an index from the end.
\nThe first will contain all indices from [0, N - M) (excluding\nthe index N - M itself) and the second will contain all\nindices from [N - M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet mut v = [1, 0, 3, 0, 5, 6];\nlet (left, right) = v.rsplit_array_mut::<4>();\nassert_eq!(left, &mut [1, 0]);\nassert_eq!(right, &mut [3, 0, 5, 6][..]);\nleft[1] = 2;\nright[1] = 4;\nassert_eq!(v, [1, 2, 3, 4, 5, 6]);
\n",0,"iroh::docs::PeerIdBytes"],["source§impl<const N: usize> [u8; N]
sourcepub const fn as_ascii(&self) -> Option<&[AsciiChar; N]>
🔬This is a nightly-only experimental API. (ascii_char)
Converts this array of bytes into a array of ASCII characters,\nor returns None if any of the characters is non-ASCII.
\n§Examples
\n#![feature(ascii_char)]\n#![feature(const_option)]\n\nconst HEX_DIGITS: [std::ascii::Char; 16] =\n *b\"0123456789abcdef\".as_ascii().unwrap();\n\nassert_eq!(HEX_DIGITS[1].as_str(), \"1\");\nassert_eq!(HEX_DIGITS[10].as_str(), \"a\");
\nsourcepub const unsafe fn as_ascii_unchecked(&self) -> &[AsciiChar; N]
🔬This is a nightly-only experimental API. (ascii_char)
Converts this array of bytes into a array of ASCII characters,\nwithout checking whether they’re valid.
\n§Safety
\nEvery byte in the array must be in 0..=127, or else this is UB.
\n",0,"iroh::docs::PeerIdBytes"],["§impl<T> Array for [T; 32]where\n T: Default,
§fn as_slice_mut(&mut self) -> &mut [T]
Gives a unique slice over the whole thing. Read more","Array","iroh::docs::PeerIdBytes"],["","Array","iroh::docs::PeerIdBytes"],["§impl<const N: usize, T> AsBytes for [T; N]where\n T: AsBytes,
§fn write_to_prefix(&self, bytes: &mut [u8]) -> Option<()>
","AsBytes","iroh::docs::PeerIdBytes"],["","AsBytes","iroh::docs::PeerIdBytes"],["","AsMut<[T]>","iroh::docs::PeerIdBytes"],["","AsRef<[T]>","iroh::docs::PeerIdBytes"],["§impl<T, const N: usize> BitView for [T; N]where\n T: BitStore,
Note that overly-large arrays may cause the conversions to fail.
\n§fn view_bits<O>(&self) -> &BitSlice<T, O>where\n O: BitOrder,
Views a memory region as an immutable bit-slice.§fn try_view_bits<O>(&self) -> Result<&BitSlice<T, O>, BitSpanError<T>>where\n O: BitOrder,
Attempts to view a memory region as an immutable bit-slice. Read more§fn view_bits_mut<O>(&mut self) -> &mut BitSlice<T, O>where\n O: BitOrder,
Views a memory region as a mutable bit-slice.§fn try_view_bits_mut<O>(\n &mut self\n) -> Result<&mut BitSlice<T, O>, BitSpanError<T>>where\n O: BitOrder,
Attempts to view a memory region as a mutable bit-slice. Read more","BitView","iroh::docs::PeerIdBytes"],["§impl<T, const N: usize> BitViewSized for [T; N]where\n T: BitStore,
§fn as_raw_slice(&self) -> &[<[T; N] as BitView>::Store]
Views the type as a slice of its elements.§fn as_raw_mut_slice(&mut self) -> &mut [<[T; N] as BitView>::Store]
Views the type as a mutable slice of its elements.§fn into_bitarray<O>(self) -> BitArray<Self, O>where\n O: BitOrder,
Wraps self in a BitArray.","BitViewSized","iroh::docs::PeerIdBytes"],["","Borrow<[T]>","iroh::docs::PeerIdBytes"],["1.4.0 · source§impl<T, const N: usize> BorrowMut<[T]> for [T; N]
source§fn borrow_mut(&mut self) -> &mut [T]
Mutably borrows from an owned value. Read more","BorrowMut<[T]>","iroh::docs::PeerIdBytes"],["","Chain","iroh::docs::PeerIdBytes"],["","Clone","iroh::docs::PeerIdBytes"],["","Debug","iroh::docs::PeerIdBytes"],["§impl<const N: usize> Decode for [u8; N]
Decodes a byte array from byte[n] as described in RFC4251 § 5:
\n\nA byte represents an arbitrary 8-bit value (octet). Fixed length\ndata is sometimes represented as an array of bytes, written\nbyte[n], where n is the number of bytes in the array.
\n
\n","Decode","iroh::docs::PeerIdBytes"],["§impl<'a, T, const N: usize> DecodeValue<'a> for [T; N]where\n T: Decode<'a>,
§fn decode_value<R>(reader: &mut R, header: Header) -> Result<[T; N], Error>where\n R: Reader<'a>,
Attempt to decode this message using the provided [Reader].","DecodeValue<'a>","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["source§impl<'de, T> Deserialize<'de> for [T; 32]where\n T: Deserialize<'de>,
source§fn deserialize<D>(\n deserializer: D\n) -> Result<[T; 32], <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more","Deserialize<'de>","iroh::docs::PeerIdBytes"],["source§impl<'de, const N: usize> Deserialize<'de> for [u8; N]
source§fn deserialize<D>(\n deserializer: D\n) -> Result<[u8; N], <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
","Deserialize<'de>","iroh::docs::PeerIdBytes"],["§impl<const N: usize> Encode for [u8; N]
Encodes [u8; N] into byte[n] as described in RFC4251 § 5:
\n\nA byte represents an arbitrary 8-bit value (octet). Fixed length\ndata is sometimes represented as an array of bytes, written\nbyte[n], where n is the number of bytes in the array.
\n
\n§fn encoded_len(&self) -> Result<usize, Error>
Get the length of this type encoded in bytes, prior to Base64 encoding.§fn encode(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value using the provided [Writer].§fn encoded_len_prefixed(&self) -> Result<usize, Error>
Return the length of this type after encoding when prepended with a\nuint32 length prefix.§fn encode_prefixed(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value, first prepending a uint32 length prefix\nset to [Encode::encoded_len].","Encode","iroh::docs::PeerIdBytes"],["","EncodeLabelSet","iroh::docs::PeerIdBytes"],["§impl<T, const N: usize> EncodeValue for [T; N]where\n T: Encode,
","EncodeValue","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["§impl<'a> FindToken<&'a u8> for [u8; 32]
§fn find_token(&self, token: &u8) -> bool
Returns true if self contains the token","FindToken<&'a u8>","iroh::docs::PeerIdBytes"],["§impl FindToken<u8> for [u8; 32]
§fn find_token(&self, token: u8) -> bool
Returns true if self contains the token","FindToken","iroh::docs::PeerIdBytes"],["","FixedTag","iroh::docs::PeerIdBytes"],["","From<&Signature>","iroh::docs::PeerIdBytes"],["","From","iroh::docs::PeerIdBytes"],["§impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>>> for [T; 32]
","From, B0>, B0>, B0>, B0>, B0>>>","iroh::docs::PeerIdBytes"],["","From","iroh::docs::PeerIdBytes"],["","From","iroh::docs::PeerIdBytes"],["","From>","iroh::docs::PeerIdBytes"],["","From","iroh::docs::PeerIdBytes"],["","From","iroh::docs::PeerIdBytes"],["","From","iroh::docs::PeerIdBytes"],["","From>","iroh::docs::PeerIdBytes"],["§impl<const N: usize, T> FromBytes for [T; N]where\n T: FromBytes,
§fn slice_from_prefix(bytes: &[u8], count: usize) -> Option<(&[Self], &[u8])>where\n Self: Sized,
Interprets the prefix of the given bytes as a &[Self] with length\nequal to count without copying. Read more§fn slice_from_suffix(bytes: &[u8], count: usize) -> Option<(&[u8], &[Self])>where\n Self: Sized,
Interprets the suffix of the given bytes as a &[Self] with length\nequal to count without copying. Read more§fn read_from_prefix(bytes: &[u8]) -> Option<Self>where\n Self: Sized,
","FromBytes","iroh::docs::PeerIdBytes"],["","FromHex","iroh::docs::PeerIdBytes"],["","FromZeroes","iroh::docs::PeerIdBytes"],["","Hash","iroh::docs::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Hash for [T; N]where\n T: Hash,
The hash of an array is the same as that of the corresponding slice,\nas required by the Borrow implementation.
\n\nuse std::hash::BuildHasher;\n\nlet b = std::hash::RandomState::new();\nlet a: [u8; 3] = [0xa8, 0x3c, 0x09];\nlet s: &[u8] = &[0xa8, 0x3c, 0x09];\nassert_eq!(b.hash_one(a), b.hash_one(s));
\n","Hash","iroh::docs::PeerIdBytes"],["","Index","iroh::docs::PeerIdBytes"],["","IndexMut","iroh::docs::PeerIdBytes"],["","InputLength","iroh::docs::PeerIdBytes"],["1.53.0 · source§impl<T, const N: usize> IntoIterator for [T; N]
source§fn into_iter(self) -> <[T; N] as IntoIterator>::IntoIter
Creates a consuming iterator, that is, one that moves each value out of\nthe array (from start to end). The array cannot be used after calling\nthis unless T implements Copy, so the whole array is copied.
\nArrays have special behavior when calling .into_iter() prior to the\n2021 edition – see the array Editions section for more information.
\n","IntoIterator","iroh::docs::PeerIdBytes"],["§impl<const N: usize> IntoResponse for [u8; N]
§fn into_response(self) -> Response<Body>
Create a response.","IntoResponse","iroh::docs::PeerIdBytes"],["§impl<Fut, const N: usize> Join for [Fut; N]where\n Fut: IntoFuture,
§type Output = [<Fut as IntoFuture>::Output; N]
The resulting output type.§type Future = Join<<Fut as IntoFuture>::IntoFuture, N>
The Future implementation returned by this method.","Join","iroh::docs::PeerIdBytes"],["","Key","iroh::docs::PeerIdBytes"],["§impl<T, const N: usize> MaxSize for [T; N]where\n T: MaxSize,
§const POSTCARD_MAX_SIZE: usize = _
The maximum possible size that the serialization of this\ntype can have, in bytes.","MaxSize","iroh::docs::PeerIdBytes"],["","Merge","iroh::docs::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Ord for [T; N]where\n T: Ord,
Implements comparison of arrays lexicographically.
\n1.21.0 · source§fn max(self, other: Self) -> Selfwhere\n Self: Sized,
Compares and returns the maximum of two values. Read more","Ord","iroh::docs::PeerIdBytes"],["","PartialEq<&[U]>","iroh::docs::PeerIdBytes"],["1.0.0 · source§impl<T, U, const N: usize> PartialEq<&mut [U]> for [T; N]where\n T: PartialEq<U>,
","PartialEq<&mut [U]>","iroh::docs::PeerIdBytes"],["","PartialEq<[U]>","iroh::docs::PeerIdBytes"],["","PartialEq<[U; N]>","iroh::docs::PeerIdBytes"],["","PartialEq","iroh::docs::PeerIdBytes"],["§impl<A, B, const N: usize, const M: usize> PartialEq<Vec<A, N>> for [B; M]where\n A: PartialEq<B>,
","PartialEq>","iroh::docs::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> PartialOrd for [T; N]where\n T: PartialOrd,
Implements comparison of arrays lexicographically.
\nsource§fn le(&self, other: &[T; N]) -> bool
This method tests less than or equal to (for self and other) and is used by the <=\noperator. Read more","PartialOrd","iroh::docs::PeerIdBytes"],["§impl<Fut, const N: usize> Race for [Fut; N]where\n Fut: IntoFuture,
§type Output = <Fut as IntoFuture>::Output
The resulting output type.§type Future = Race<<Fut as IntoFuture>::IntoFuture, N>
Which kind of future are we turning this into?","Race","iroh::docs::PeerIdBytes"],["§impl<Fut, T, E, const N: usize> RaceOk for [Fut; N]where\n Fut: IntoFuture<Output = Result<T, E>>,
§type Future = RaceOk<<Fut as IntoFuture>::IntoFuture, T, E, N>
Which kind of future are we turning this into?","RaceOk","iroh::docs::PeerIdBytes"],["","Schema","iroh::docs::PeerIdBytes"],["source§impl<T> Serialize for [T; 32]where\n T: 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","iroh::docs::PeerIdBytes"],["source§impl<const N: usize> Serialize for [u8; N]
source§fn serialize<S>(\n &self,\n serializer: S\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where\n S: Serializer,
","Serialize","iroh::docs::PeerIdBytes"],["1.51.0 · source§impl<T, const N: usize> SlicePattern for [T; N]
","SlicePattern","iroh::docs::PeerIdBytes"],["1.34.0 · source§impl<T, const N: usize> TryFrom<&[T]> for [T; N]where\n T: Copy,
Tries to create an array [T; N] by copying from a slice &[T]. Succeeds if\nslice.len() == N.
\n\nlet bytes: [u8; 3] = [1, 0, 2];\n\nlet bytes_head: [u8; 2] = <[u8; 2]>::try_from(&bytes[0..2]).unwrap();\nassert_eq!(1, u16::from_le_bytes(bytes_head));\n\nlet bytes_tail: [u8; 2] = bytes[1..3].try_into().unwrap();\nassert_eq!(512, u16::from_le_bytes(bytes_tail));
\n§type Error = TryFromSliceError
The type returned in the event of a conversion error.","TryFrom<&[T]>","iroh::docs::PeerIdBytes"],["1.59.0 · source§impl<T, const N: usize> TryFrom<&mut [T]> for [T; N]where\n T: Copy,
Tries to create an array [T; N] by copying from a mutable slice &mut [T].\nSucceeds if slice.len() == N.
\n\nlet mut bytes: [u8; 3] = [1, 0, 2];\n\nlet bytes_head: [u8; 2] = <[u8; 2]>::try_from(&mut bytes[0..2]).unwrap();\nassert_eq!(1, u16::from_le_bytes(bytes_head));\n\nlet bytes_tail: [u8; 2] = (&mut bytes[1..3]).try_into().unwrap();\nassert_eq!(512, u16::from_le_bytes(bytes_tail));
\n§type Error = TryFromSliceError
The type returned in the event of a conversion error.","TryFrom<&mut [T]>","iroh::docs::PeerIdBytes"],["§impl<T, A, const N: usize> TryFrom<Vec<T, A>> for [T; N]where\n A: Allocator,
§fn try_from(vec: Vec<T, A>) -> Result<[T; N], Vec<T, A>>
Gets the entire contents of the Vec<T> as an array,\nif its size exactly matches that of the requested array.
\n§Examples
\nassert_eq!(vec![1, 2, 3].try_into(), Ok([1, 2, 3]));\nassert_eq!(<Vec<i32>>::new().try_into(), Ok([]));
\nIf the length doesn’t match, the input comes back in Err:
\n\nlet r: Result<[i32; 4], _> = (0..10).collect::<Vec<_>>().try_into();\nassert_eq!(r, Err(vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9]));
\nIf you’re fine with just getting a prefix of the Vec<T>,\nyou can call .truncate(N) first.
\n\nlet mut v = String::from(\"hello world\").into_bytes();\nv.sort();\nv.truncate(2);\nlet [a, b]: [_; 2] = v.try_into().unwrap();\nassert_eq!(a, b' ');\nassert_eq!(b, b'd');
\n","TryFrom>","iroh::docs::PeerIdBytes"],["1.48.0 · source§impl<T, A, const N: usize> TryFrom<Vec<T, A>> for [T; N]where\n A: Allocator,
source§fn try_from(vec: Vec<T, A>) -> Result<[T; N], Vec<T, A>>
Gets the entire contents of the Vec<T> as an array,\nif its size exactly matches that of the requested array.
\n§Examples
\nassert_eq!(vec![1, 2, 3].try_into(), Ok([1, 2, 3]));\nassert_eq!(<Vec<i32>>::new().try_into(), Ok([]));
\nIf the length doesn’t match, the input comes back in Err:
\n\nlet r: Result<[i32; 4], _> = (0..10).collect::<Vec<_>>().try_into();\nassert_eq!(r, Err(vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9]));
\nIf you’re fine with just getting a prefix of the Vec<T>,\nyou can call .truncate(N) first.
\n\nlet mut v = String::from(\"hello world\").into_bytes();\nv.sort();\nv.truncate(2);\nlet [a, b]: [_; 2] = v.try_into().unwrap();\nassert_eq!(a, b' ');\nassert_eq!(b, b'd');
\n","TryFrom>","iroh::docs::PeerIdBytes"],["§impl<Fut, T, E, const N: usize> TryJoin for [Fut; N]where\n Fut: IntoFuture<Output = Result<T, E>>,
§type Future = TryJoin<<Fut as IntoFuture>::IntoFuture, T, E, N>
Which kind of future are we turning this into?","TryJoin","iroh::docs::PeerIdBytes"],["§impl<const N: usize, T> Value for [T; N]where\n T: Value,
§type SelfType<'a> = [<T as Value>::SelfType<'a>; N]\nwhere\n [T; N]: 'a
SelfType<’a> must be the same type as Self with all lifetimes replaced with ’a§type AsBytes<'a> = Vec<u8>\nwhere\n [T; N]: 'a
§fn fixed_width() -> Option<usize>
Width of a fixed type, or None for variable width§fn from_bytes<'a>(data: &'a [u8]) -> [<T as Value>::SelfType<'a>; N]where\n [T; N]: 'a,
Deserializes data\nImplementations may return a view over data, or an owned type","Value","iroh::docs::PeerIdBytes"],["","ValueOrd","iroh::docs::PeerIdBytes"],["§impl<Z, const N: usize> Zeroize for [Z; N]where\n Z: Zeroize,
Impl [Zeroize] on arrays of types that impl [Zeroize].
\n","Zeroize","iroh::docs::PeerIdBytes"],["","Zip","iroh::docs::PeerIdBytes"],["source§impl<T, const N: usize> ConstParamTy for [T; N]where\n T: ConstParamTy,
","ConstParamTy","iroh::docs::PeerIdBytes"],["1.58.0 · source§impl<T, const N: usize> Copy for [T; N]where\n T: Copy,
","Copy","iroh::docs::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Eq for [T; N]where\n T: Eq,
","Eq","iroh::docs::PeerIdBytes"],["source§impl<T, const N: usize> StructuralPartialEq for [T; N]
","StructuralPartialEq","iroh::docs::PeerIdBytes"],["§impl<const N: usize, T> Unaligned for [T; N]where\n T: Unaligned,
","Unaligned","iroh::docs::PeerIdBytes"],["§impl<Z, const N: usize> ZeroizeOnDrop for [Z; N]where\n Z: ZeroizeOnDrop,
Impl [ZeroizeOnDrop] on arrays of types that impl [ZeroizeOnDrop].
\n","ZeroizeOnDrop","iroh::docs::PeerIdBytes"]],
-"iroh_docs":[["source§impl<T, const N: usize> [T; N]
1.55.0 · sourcepub fn map<F, U>(self, f: F) -> [U; N]where\n F: FnMut(T) -> U,
Returns an array of the same size as self, with function f applied to each element\nin order.
\nIf you don’t necessarily need a new fixed-size array, consider using\nIterator::map instead.
\n§Note on performance and stack usage
\nUnfortunately, usages of this method are currently not always optimized\nas well as they could be. This mainly concerns large arrays, as mapping\nover small arrays seem to be optimized just fine. Also note that in\ndebug mode (i.e. without any optimizations), this method can use a lot\nof stack space (a few times the size of the array or more).
\nTherefore, in performance-critical code, try to avoid using this method\non large arrays or check the emitted code. Also try to avoid chained\nmaps (e.g. arr.map(...).map(...)).
\nIn many cases, you can instead use Iterator::map by calling .iter()\nor .into_iter() on your array. [T; N]::map is only necessary if you\nreally need a new array of the same size as the result. Rust’s lazy\niterators tend to get optimized very well.
\n§Examples
\nlet x = [1, 2, 3];\nlet y = x.map(|v| v + 1);\nassert_eq!(y, [2, 3, 4]);\n\nlet x = [1, 2, 3];\nlet mut temp = 0;\nlet y = x.map(|v| { temp += 1; v * temp });\nassert_eq!(y, [1, 4, 9]);\n\nlet x = [\"Ferris\", \"Bueller's\", \"Day\", \"Off\"];\nlet y = x.map(|v| v.len());\nassert_eq!(y, [6, 9, 3, 3]);
\nsourcepub fn try_map<F, R>(\n self,\n f: F\n) -> <<R as Try>::Residual as Residual<[<R as Try>::Output; N]>>::TryType
🔬This is a nightly-only experimental API. (array_try_map)
A fallible function f applied to each element on array self in order to\nreturn an array the same size as self or the first error encountered.
\nThe return type of this function depends on the return type of the closure.\nIf you return Result<T, E> from the closure, you’ll get a Result<[T; N], E>.\nIf you return Option<T> from the closure, you’ll get an Option<[T; N]>.
\n§Examples
\n#![feature(array_try_map)]\n\nlet a = [\"1\", \"2\", \"3\"];\nlet b = a.try_map(|v| v.parse::<u32>()).unwrap().map(|v| v + 1);\nassert_eq!(b, [2, 3, 4]);\n\nlet a = [\"1\", \"2a\", \"3\"];\nlet b = a.try_map(|v| v.parse::<u32>());\nassert!(b.is_err());\n\nuse std::num::NonZero;\n\nlet z = [1, 2, 0, 3, 4];\nassert_eq!(z.try_map(NonZero::new), None);\n\nlet a = [1, 2, 3];\nlet b = a.try_map(NonZero::new);\nlet c = b.map(|x| x.map(NonZero::get));\nassert_eq!(c, Some(a));
\n1.57.0 (const: 1.57.0) · sourcepub const fn as_slice(&self) -> &[T]
Returns a slice containing the entire array. Equivalent to &s[..].
\n1.57.0 · sourcepub fn as_mut_slice(&mut self) -> &mut [T]
Returns a mutable slice containing the entire array. Equivalent to\n&mut s[..].
\n1.77.0 · sourcepub fn each_ref(&self) -> [&T; N]
Borrows each element and returns an array of references with the same\nsize as self.
\n§Example
\nlet floats = [3.1, 2.7, -1.0];\nlet float_refs: [&f64; 3] = floats.each_ref();\nassert_eq!(float_refs, [&3.1, &2.7, &-1.0]);
\nThis method is particularly useful if combined with other methods, like\nmap. This way, you can avoid moving the original\narray if its elements are not Copy.
\n\nlet strings = [\"Ferris\".to_string(), \"♥\".to_string(), \"Rust\".to_string()];\nlet is_ascii = strings.each_ref().map(|s| s.is_ascii());\nassert_eq!(is_ascii, [true, false, true]);\n\n// We can still access the original array: it has not been moved.\nassert_eq!(strings.len(), 3);
\n1.77.0 · sourcepub fn each_mut(&mut self) -> [&mut T; N]
Borrows each element mutably and returns an array of mutable references\nwith the same size as self.
\n§Example
\n\nlet mut floats = [3.1, 2.7, -1.0];\nlet float_refs: [&mut f64; 3] = floats.each_mut();\n*float_refs[0] = 0.0;\nassert_eq!(float_refs, [&mut 0.0, &mut 2.7, &mut -1.0]);\nassert_eq!(floats, [0.0, 2.7, -1.0]);
\nsourcepub fn split_array_ref<const M: usize>(&self) -> (&[T; M], &[T])
🔬This is a nightly-only experimental API. (split_array)
Divides one array reference into two at an index.
\nThe first will contain all indices from [0, M) (excluding\nthe index M itself) and the second will contain all\nindices from [M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet v = [1, 2, 3, 4, 5, 6];\n\n{\n let (left, right) = v.split_array_ref::<0>();\n assert_eq!(left, &[]);\n assert_eq!(right, &[1, 2, 3, 4, 5, 6]);\n}\n\n{\n let (left, right) = v.split_array_ref::<2>();\n assert_eq!(left, &[1, 2]);\n assert_eq!(right, &[3, 4, 5, 6]);\n}\n\n{\n let (left, right) = v.split_array_ref::<6>();\n assert_eq!(left, &[1, 2, 3, 4, 5, 6]);\n assert_eq!(right, &[]);\n}
\nsourcepub fn split_array_mut<const M: usize>(&mut self) -> (&mut [T; M], &mut [T])
🔬This is a nightly-only experimental API. (split_array)
Divides one mutable array reference into two at an index.
\nThe first will contain all indices from [0, M) (excluding\nthe index M itself) and the second will contain all\nindices from [M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet mut v = [1, 0, 3, 0, 5, 6];\nlet (left, right) = v.split_array_mut::<2>();\nassert_eq!(left, &mut [1, 0][..]);\nassert_eq!(right, &mut [3, 0, 5, 6]);\nleft[1] = 2;\nright[1] = 4;\nassert_eq!(v, [1, 2, 3, 4, 5, 6]);
\nsourcepub fn rsplit_array_ref<const M: usize>(&self) -> (&[T], &[T; M])
🔬This is a nightly-only experimental API. (split_array)
Divides one array reference into two at an index from the end.
\nThe first will contain all indices from [0, N - M) (excluding\nthe index N - M itself) and the second will contain all\nindices from [N - M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet v = [1, 2, 3, 4, 5, 6];\n\n{\n let (left, right) = v.rsplit_array_ref::<0>();\n assert_eq!(left, &[1, 2, 3, 4, 5, 6]);\n assert_eq!(right, &[]);\n}\n\n{\n let (left, right) = v.rsplit_array_ref::<2>();\n assert_eq!(left, &[1, 2, 3, 4]);\n assert_eq!(right, &[5, 6]);\n}\n\n{\n let (left, right) = v.rsplit_array_ref::<6>();\n assert_eq!(left, &[]);\n assert_eq!(right, &[1, 2, 3, 4, 5, 6]);\n}
\nsourcepub fn rsplit_array_mut<const M: usize>(&mut self) -> (&mut [T], &mut [T; M])
🔬This is a nightly-only experimental API. (split_array)
Divides one mutable array reference into two at an index from the end.
\nThe first will contain all indices from [0, N - M) (excluding\nthe index N - M itself) and the second will contain all\nindices from [N - M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet mut v = [1, 0, 3, 0, 5, 6];\nlet (left, right) = v.rsplit_array_mut::<4>();\nassert_eq!(left, &mut [1, 0]);\nassert_eq!(right, &mut [3, 0, 5, 6][..]);\nleft[1] = 2;\nright[1] = 4;\nassert_eq!(v, [1, 2, 3, 4, 5, 6]);
\n",0,"iroh_docs::sync::PeerIdBytes"],["source§impl<const N: usize> [u8; N]
sourcepub const fn as_ascii(&self) -> Option<&[AsciiChar; N]>
🔬This is a nightly-only experimental API. (ascii_char)
Converts this array of bytes into a array of ASCII characters,\nor returns None if any of the characters is non-ASCII.
\n§Examples
\n#![feature(ascii_char)]\n#![feature(const_option)]\n\nconst HEX_DIGITS: [std::ascii::Char; 16] =\n *b\"0123456789abcdef\".as_ascii().unwrap();\n\nassert_eq!(HEX_DIGITS[1].as_str(), \"1\");\nassert_eq!(HEX_DIGITS[10].as_str(), \"a\");
\nsourcepub const unsafe fn as_ascii_unchecked(&self) -> &[AsciiChar; N]
🔬This is a nightly-only experimental API. (ascii_char)
Converts this array of bytes into a array of ASCII characters,\nwithout checking whether they’re valid.
\n§Safety
\nEvery byte in the array must be in 0..=127, or else this is UB.
\n",0,"iroh_docs::sync::PeerIdBytes"],["§impl<T> Array for [T; 32]where\n T: Default,
§fn as_slice_mut(&mut self) -> &mut [T]
Gives a unique slice over the whole thing. Read more","Array","iroh_docs::sync::PeerIdBytes"],["","Array","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> AsBytes for [T; N]where\n T: AsBytes,
§fn write_to_prefix(&self, bytes: &mut [u8]) -> Option<()>
","AsBytes","iroh_docs::sync::PeerIdBytes"],["","AsBytes","iroh_docs::sync::PeerIdBytes"],["","AsMut<[T]>","iroh_docs::sync::PeerIdBytes"],["","AsRef<[T]>","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> BitView for [T; N]where\n T: BitStore,
Note that overly-large arrays may cause the conversions to fail.
\n§fn view_bits<O>(&self) -> &BitSlice<T, O>where\n O: BitOrder,
Views a memory region as an immutable bit-slice.§fn try_view_bits<O>(&self) -> Result<&BitSlice<T, O>, BitSpanError<T>>where\n O: BitOrder,
Attempts to view a memory region as an immutable bit-slice. Read more§fn view_bits_mut<O>(&mut self) -> &mut BitSlice<T, O>where\n O: BitOrder,
Views a memory region as a mutable bit-slice.§fn try_view_bits_mut<O>(\n &mut self\n) -> Result<&mut BitSlice<T, O>, BitSpanError<T>>where\n O: BitOrder,
Attempts to view a memory region as a mutable bit-slice. Read more","BitView","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> BitViewSized for [T; N]where\n T: BitStore,
§fn as_raw_slice(&self) -> &[<[T; N] as BitView>::Store]
Views the type as a slice of its elements.§fn as_raw_mut_slice(&mut self) -> &mut [<[T; N] as BitView>::Store]
Views the type as a mutable slice of its elements.§fn into_bitarray<O>(self) -> BitArray<Self, O>where\n O: BitOrder,
Wraps self in a BitArray.","BitViewSized","iroh_docs::sync::PeerIdBytes"],["","Borrow<[T]>","iroh_docs::sync::PeerIdBytes"],["1.4.0 · source§impl<T, const N: usize> BorrowMut<[T]> for [T; N]
source§fn borrow_mut(&mut self) -> &mut [T]
Mutably borrows from an owned value. Read more","BorrowMut<[T]>","iroh_docs::sync::PeerIdBytes"],["","Chain","iroh_docs::sync::PeerIdBytes"],["","Clone","iroh_docs::sync::PeerIdBytes"],["","Debug","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize> Decode for [u8; N]
Decodes a byte array from byte[n] as described in RFC4251 § 5:
\n\nA byte represents an arbitrary 8-bit value (octet). Fixed length\ndata is sometimes represented as an array of bytes, written\nbyte[n], where n is the number of bytes in the array.
\n
\n","Decode","iroh_docs::sync::PeerIdBytes"],["§impl<'a, T, const N: usize> DecodeValue<'a> for [T; N]where\n T: Decode<'a>,
§fn decode_value<R>(reader: &mut R, header: Header) -> Result<[T; N], Error>where\n R: Reader<'a>,
Attempt to decode this message using the provided [Reader].","DecodeValue<'a>","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["source§impl<'de, T> Deserialize<'de> for [T; 32]where\n T: Deserialize<'de>,
source§fn deserialize<D>(\n deserializer: D\n) -> Result<[T; 32], <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more","Deserialize<'de>","iroh_docs::sync::PeerIdBytes"],["source§impl<'de, const N: usize> Deserialize<'de> for [u8; N]
source§fn deserialize<D>(\n deserializer: D\n) -> Result<[u8; N], <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
","Deserialize<'de>","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize> Encode for [u8; N]
Encodes [u8; N] into byte[n] as described in RFC4251 § 5:
\n\nA byte represents an arbitrary 8-bit value (octet). Fixed length\ndata is sometimes represented as an array of bytes, written\nbyte[n], where n is the number of bytes in the array.
\n
\n§fn encoded_len(&self) -> Result<usize, Error>
Get the length of this type encoded in bytes, prior to Base64 encoding.§fn encode(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value using the provided [Writer].§fn encoded_len_prefixed(&self) -> Result<usize, Error>
Return the length of this type after encoding when prepended with a\nuint32 length prefix.§fn encode_prefixed(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value, first prepending a uint32 length prefix\nset to [Encode::encoded_len].","Encode","iroh_docs::sync::PeerIdBytes"],["","EncodeLabelSet","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> EncodeValue for [T; N]where\n T: Encode,
","EncodeValue","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["§impl<'a> FindToken<&'a u8> for [u8; 32]
§fn find_token(&self, token: &u8) -> bool
Returns true if self contains the token","FindToken<&'a u8>","iroh_docs::sync::PeerIdBytes"],["§impl FindToken<u8> for [u8; 32]
§fn find_token(&self, token: u8) -> bool
Returns true if self contains the token","FindToken","iroh_docs::sync::PeerIdBytes"],["","FixedTag","iroh_docs::sync::PeerIdBytes"],["","From<&Signature>","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["§impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>>> for [T; 32]
","From, B0>, B0>, B0>, B0>, B0>>>","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["","From>","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["source§impl From<NamespaceId> for [u8; 32]
source§fn from(value: NamespaceId) -> Self
Converts to this type from the input type.","From","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["","From>","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> FromBytes for [T; N]where\n T: FromBytes,
§fn slice_from_prefix(bytes: &[u8], count: usize) -> Option<(&[Self], &[u8])>where\n Self: Sized,
Interprets the prefix of the given bytes as a &[Self] with length\nequal to count without copying. Read more§fn slice_from_suffix(bytes: &[u8], count: usize) -> Option<(&[u8], &[Self])>where\n Self: Sized,
Interprets the suffix of the given bytes as a &[Self] with length\nequal to count without copying. Read more§fn read_from_prefix(bytes: &[u8]) -> Option<Self>where\n Self: Sized,
","FromBytes","iroh_docs::sync::PeerIdBytes"],["","FromHex","iroh_docs::sync::PeerIdBytes"],["","FromZeroes","iroh_docs::sync::PeerIdBytes"],["","Hash","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Hash for [T; N]where\n T: Hash,
The hash of an array is the same as that of the corresponding slice,\nas required by the Borrow implementation.
\n\nuse std::hash::BuildHasher;\n\nlet b = std::hash::RandomState::new();\nlet a: [u8; 3] = [0xa8, 0x3c, 0x09];\nlet s: &[u8] = &[0xa8, 0x3c, 0x09];\nassert_eq!(b.hash_one(a), b.hash_one(s));
\n","Hash","iroh_docs::sync::PeerIdBytes"],["","Index","iroh_docs::sync::PeerIdBytes"],["","IndexMut","iroh_docs::sync::PeerIdBytes"],["","InputLength","iroh_docs::sync::PeerIdBytes"],["1.53.0 · source§impl<T, const N: usize> IntoIterator for [T; N]
source§fn into_iter(self) -> <[T; N] as IntoIterator>::IntoIter
Creates a consuming iterator, that is, one that moves each value out of\nthe array (from start to end). The array cannot be used after calling\nthis unless T implements Copy, so the whole array is copied.
\nArrays have special behavior when calling .into_iter() prior to the\n2021 edition – see the array Editions section for more information.
\n","IntoIterator","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize> IntoResponse for [u8; N]
§fn into_response(self) -> Response<Body>
Create a response.","IntoResponse","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, const N: usize> Join for [Fut; N]where\n Fut: IntoFuture,
§type Output = [<Fut as IntoFuture>::Output; N]
The resulting output type.§type Future = Join<<Fut as IntoFuture>::IntoFuture, N>
The Future implementation returned by this method.","Join","iroh_docs::sync::PeerIdBytes"],["","Key","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> MaxSize for [T; N]where\n T: MaxSize,
§const POSTCARD_MAX_SIZE: usize = _
The maximum possible size that the serialization of this\ntype can have, in bytes.","MaxSize","iroh_docs::sync::PeerIdBytes"],["","Merge","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Ord for [T; N]where\n T: Ord,
Implements comparison of arrays lexicographically.
\n1.21.0 · source§fn max(self, other: Self) -> Selfwhere\n Self: Sized,
Compares and returns the maximum of two values. Read more","Ord","iroh_docs::sync::PeerIdBytes"],["","PartialEq<&[U]>","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, U, const N: usize> PartialEq<&mut [U]> for [T; N]where\n T: PartialEq<U>,
","PartialEq<&mut [U]>","iroh_docs::sync::PeerIdBytes"],["","PartialEq<[U]>","iroh_docs::sync::PeerIdBytes"],["","PartialEq<[U; N]>","iroh_docs::sync::PeerIdBytes"],["","PartialEq","iroh_docs::sync::PeerIdBytes"],["§impl<A, B, const N: usize, const M: usize> PartialEq<Vec<A, N>> for [B; M]where\n A: PartialEq<B>,
","PartialEq>","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> PartialOrd for [T; N]where\n T: PartialOrd,
Implements comparison of arrays lexicographically.
\nsource§fn le(&self, other: &[T; N]) -> bool
This method tests less than or equal to (for self and other) and is used by the <=\noperator. Read more","PartialOrd","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, const N: usize> Race for [Fut; N]where\n Fut: IntoFuture,
§type Output = <Fut as IntoFuture>::Output
The resulting output type.§type Future = Race<<Fut as IntoFuture>::IntoFuture, N>
Which kind of future are we turning this into?","Race","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, T, E, const N: usize> RaceOk for [Fut; N]where\n Fut: IntoFuture<Output = Result<T, E>>,
§type Future = RaceOk<<Fut as IntoFuture>::IntoFuture, T, E, N>
Which kind of future are we turning this into?","RaceOk","iroh_docs::sync::PeerIdBytes"],["","Schema","iroh_docs::sync::PeerIdBytes"],["source§impl<T> Serialize for [T; 32]where\n T: 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","iroh_docs::sync::PeerIdBytes"],["source§impl<const N: usize> Serialize for [u8; N]
source§fn serialize<S>(\n &self,\n serializer: S\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where\n S: Serializer,
","Serialize","iroh_docs::sync::PeerIdBytes"],["1.51.0 · source§impl<T, const N: usize> SlicePattern for [T; N]
","SlicePattern","iroh_docs::sync::PeerIdBytes"],["1.34.0 · source§impl<T, const N: usize> TryFrom<&[T]> for [T; N]where\n T: Copy,
Tries to create an array [T; N] by copying from a slice &[T]. Succeeds if\nslice.len() == N.
\n\nlet bytes: [u8; 3] = [1, 0, 2];\n\nlet bytes_head: [u8; 2] = <[u8; 2]>::try_from(&bytes[0..2]).unwrap();\nassert_eq!(1, u16::from_le_bytes(bytes_head));\n\nlet bytes_tail: [u8; 2] = bytes[1..3].try_into().unwrap();\nassert_eq!(512, u16::from_le_bytes(bytes_tail));
\n§type Error = TryFromSliceError
The type returned in the event of a conversion error.","TryFrom<&[T]>","iroh_docs::sync::PeerIdBytes"],["1.59.0 · source§impl<T, const N: usize> TryFrom<&mut [T]> for [T; N]where\n T: Copy,
Tries to create an array [T; N] by copying from a mutable slice &mut [T].\nSucceeds if slice.len() == N.
\n\nlet mut bytes: [u8; 3] = [1, 0, 2];\n\nlet bytes_head: [u8; 2] = <[u8; 2]>::try_from(&mut bytes[0..2]).unwrap();\nassert_eq!(1, u16::from_le_bytes(bytes_head));\n\nlet bytes_tail: [u8; 2] = (&mut bytes[1..3]).try_into().unwrap();\nassert_eq!(512, u16::from_le_bytes(bytes_tail));
\n§type Error = TryFromSliceError
The type returned in the event of a conversion error.","TryFrom<&mut [T]>","iroh_docs::sync::PeerIdBytes"],["§impl<T, A, const N: usize> TryFrom<Vec<T, A>> for [T; N]where\n A: Allocator,
§fn try_from(vec: Vec<T, A>) -> Result<[T; N], Vec<T, A>>
Gets the entire contents of the Vec<T> as an array,\nif its size exactly matches that of the requested array.
\n§Examples
\nassert_eq!(vec![1, 2, 3].try_into(), Ok([1, 2, 3]));\nassert_eq!(<Vec<i32>>::new().try_into(), Ok([]));
\nIf the length doesn’t match, the input comes back in Err:
\n\nlet r: Result<[i32; 4], _> = (0..10).collect::<Vec<_>>().try_into();\nassert_eq!(r, Err(vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9]));
\nIf you’re fine with just getting a prefix of the Vec<T>,\nyou can call .truncate(N) first.
\n\nlet mut v = String::from(\"hello world\").into_bytes();\nv.sort();\nv.truncate(2);\nlet [a, b]: [_; 2] = v.try_into().unwrap();\nassert_eq!(a, b' ');\nassert_eq!(b, b'd');
\n","TryFrom>","iroh_docs::sync::PeerIdBytes"],["1.48.0 · source§impl<T, A, const N: usize> TryFrom<Vec<T, A>> for [T; N]where\n A: Allocator,
source§fn try_from(vec: Vec<T, A>) -> Result<[T; N], Vec<T, A>>
Gets the entire contents of the Vec<T> as an array,\nif its size exactly matches that of the requested array.
\n§Examples
\nassert_eq!(vec![1, 2, 3].try_into(), Ok([1, 2, 3]));\nassert_eq!(<Vec<i32>>::new().try_into(), Ok([]));
\nIf the length doesn’t match, the input comes back in Err:
\n\nlet r: Result<[i32; 4], _> = (0..10).collect::<Vec<_>>().try_into();\nassert_eq!(r, Err(vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9]));
\nIf you’re fine with just getting a prefix of the Vec<T>,\nyou can call .truncate(N) first.
\n\nlet mut v = String::from(\"hello world\").into_bytes();\nv.sort();\nv.truncate(2);\nlet [a, b]: [_; 2] = v.try_into().unwrap();\nassert_eq!(a, b' ');\nassert_eq!(b, b'd');
\n","TryFrom>","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, T, E, const N: usize> TryJoin for [Fut; N]where\n Fut: IntoFuture<Output = Result<T, E>>,
§type Future = TryJoin<<Fut as IntoFuture>::IntoFuture, T, E, N>
Which kind of future are we turning this into?","TryJoin","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> Value for [T; N]where\n T: Value,
§type SelfType<'a> = [<T as Value>::SelfType<'a>; N]\nwhere\n [T; N]: 'a
SelfType<’a> must be the same type as Self with all lifetimes replaced with ’a§type AsBytes<'a> = Vec<u8>\nwhere\n [T; N]: 'a
§fn fixed_width() -> Option<usize>
Width of a fixed type, or None for variable width§fn from_bytes<'a>(data: &'a [u8]) -> [<T as Value>::SelfType<'a>; N]where\n [T; N]: 'a,
Deserializes data\nImplementations may return a view over data, or an owned type","Value","iroh_docs::sync::PeerIdBytes"],["","ValueOrd","iroh_docs::sync::PeerIdBytes"],["§impl<Z, const N: usize> Zeroize for [Z; N]where\n Z: Zeroize,
Impl [Zeroize] on arrays of types that impl [Zeroize].
\n","Zeroize","iroh_docs::sync::PeerIdBytes"],["","Zip","iroh_docs::sync::PeerIdBytes"],["source§impl<T, const N: usize> ConstParamTy for [T; N]where\n T: ConstParamTy,
","ConstParamTy","iroh_docs::sync::PeerIdBytes"],["1.58.0 · source§impl<T, const N: usize> Copy for [T; N]where\n T: Copy,
","Copy","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Eq for [T; N]where\n T: Eq,
","Eq","iroh_docs::sync::PeerIdBytes"],["source§impl<T, const N: usize> StructuralPartialEq for [T; N]
","StructuralPartialEq","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> Unaligned for [T; N]where\n T: Unaligned,
","Unaligned","iroh_docs::sync::PeerIdBytes"],["§impl<Z, const N: usize> ZeroizeOnDrop for [Z; N]where\n Z: ZeroizeOnDrop,
Impl [ZeroizeOnDrop] on arrays of types that impl [ZeroizeOnDrop].
\n","ZeroizeOnDrop","iroh_docs::sync::PeerIdBytes"]]
+"iroh_docs":[["source§impl<T, const N: usize> [T; N]
1.55.0 · sourcepub fn map<F, U>(self, f: F) -> [U; N]where\n F: FnMut(T) -> U,
Returns an array of the same size as self, with function f applied to each element\nin order.
\nIf you don’t necessarily need a new fixed-size array, consider using\nIterator::map instead.
\n§Note on performance and stack usage
\nUnfortunately, usages of this method are currently not always optimized\nas well as they could be. This mainly concerns large arrays, as mapping\nover small arrays seem to be optimized just fine. Also note that in\ndebug mode (i.e. without any optimizations), this method can use a lot\nof stack space (a few times the size of the array or more).
\nTherefore, in performance-critical code, try to avoid using this method\non large arrays or check the emitted code. Also try to avoid chained\nmaps (e.g. arr.map(...).map(...)).
\nIn many cases, you can instead use Iterator::map by calling .iter()\nor .into_iter() on your array. [T; N]::map is only necessary if you\nreally need a new array of the same size as the result. Rust’s lazy\niterators tend to get optimized very well.
\n§Examples
\nlet x = [1, 2, 3];\nlet y = x.map(|v| v + 1);\nassert_eq!(y, [2, 3, 4]);\n\nlet x = [1, 2, 3];\nlet mut temp = 0;\nlet y = x.map(|v| { temp += 1; v * temp });\nassert_eq!(y, [1, 4, 9]);\n\nlet x = [\"Ferris\", \"Bueller's\", \"Day\", \"Off\"];\nlet y = x.map(|v| v.len());\nassert_eq!(y, [6, 9, 3, 3]);
\nsourcepub fn try_map<F, R>(\n self,\n f: F\n) -> <<R as Try>::Residual as Residual<[<R as Try>::Output; N]>>::TryType
🔬This is a nightly-only experimental API. (array_try_map)
A fallible function f applied to each element on array self in order to\nreturn an array the same size as self or the first error encountered.
\nThe return type of this function depends on the return type of the closure.\nIf you return Result<T, E> from the closure, you’ll get a Result<[T; N], E>.\nIf you return Option<T> from the closure, you’ll get an Option<[T; N]>.
\n§Examples
\n#![feature(array_try_map)]\n\nlet a = [\"1\", \"2\", \"3\"];\nlet b = a.try_map(|v| v.parse::<u32>()).unwrap().map(|v| v + 1);\nassert_eq!(b, [2, 3, 4]);\n\nlet a = [\"1\", \"2a\", \"3\"];\nlet b = a.try_map(|v| v.parse::<u32>());\nassert!(b.is_err());\n\nuse std::num::NonZero;\n\nlet z = [1, 2, 0, 3, 4];\nassert_eq!(z.try_map(NonZero::new), None);\n\nlet a = [1, 2, 3];\nlet b = a.try_map(NonZero::new);\nlet c = b.map(|x| x.map(NonZero::get));\nassert_eq!(c, Some(a));
\n1.57.0 (const: 1.57.0) · sourcepub const fn as_slice(&self) -> &[T]
Returns a slice containing the entire array. Equivalent to &s[..].
\n1.57.0 · sourcepub fn as_mut_slice(&mut self) -> &mut [T]
Returns a mutable slice containing the entire array. Equivalent to\n&mut s[..].
\n1.77.0 · sourcepub fn each_ref(&self) -> [&T; N]
Borrows each element and returns an array of references with the same\nsize as self.
\n§Example
\nlet floats = [3.1, 2.7, -1.0];\nlet float_refs: [&f64; 3] = floats.each_ref();\nassert_eq!(float_refs, [&3.1, &2.7, &-1.0]);
\nThis method is particularly useful if combined with other methods, like\nmap. This way, you can avoid moving the original\narray if its elements are not Copy.
\n\nlet strings = [\"Ferris\".to_string(), \"♥\".to_string(), \"Rust\".to_string()];\nlet is_ascii = strings.each_ref().map(|s| s.is_ascii());\nassert_eq!(is_ascii, [true, false, true]);\n\n// We can still access the original array: it has not been moved.\nassert_eq!(strings.len(), 3);
\n1.77.0 · sourcepub fn each_mut(&mut self) -> [&mut T; N]
Borrows each element mutably and returns an array of mutable references\nwith the same size as self.
\n§Example
\n\nlet mut floats = [3.1, 2.7, -1.0];\nlet float_refs: [&mut f64; 3] = floats.each_mut();\n*float_refs[0] = 0.0;\nassert_eq!(float_refs, [&mut 0.0, &mut 2.7, &mut -1.0]);\nassert_eq!(floats, [0.0, 2.7, -1.0]);
\nsourcepub fn split_array_ref<const M: usize>(&self) -> (&[T; M], &[T])
🔬This is a nightly-only experimental API. (split_array)
Divides one array reference into two at an index.
\nThe first will contain all indices from [0, M) (excluding\nthe index M itself) and the second will contain all\nindices from [M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet v = [1, 2, 3, 4, 5, 6];\n\n{\n let (left, right) = v.split_array_ref::<0>();\n assert_eq!(left, &[]);\n assert_eq!(right, &[1, 2, 3, 4, 5, 6]);\n}\n\n{\n let (left, right) = v.split_array_ref::<2>();\n assert_eq!(left, &[1, 2]);\n assert_eq!(right, &[3, 4, 5, 6]);\n}\n\n{\n let (left, right) = v.split_array_ref::<6>();\n assert_eq!(left, &[1, 2, 3, 4, 5, 6]);\n assert_eq!(right, &[]);\n}
\nsourcepub fn split_array_mut<const M: usize>(&mut self) -> (&mut [T; M], &mut [T])
🔬This is a nightly-only experimental API. (split_array)
Divides one mutable array reference into two at an index.
\nThe first will contain all indices from [0, M) (excluding\nthe index M itself) and the second will contain all\nindices from [M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet mut v = [1, 0, 3, 0, 5, 6];\nlet (left, right) = v.split_array_mut::<2>();\nassert_eq!(left, &mut [1, 0][..]);\nassert_eq!(right, &mut [3, 0, 5, 6]);\nleft[1] = 2;\nright[1] = 4;\nassert_eq!(v, [1, 2, 3, 4, 5, 6]);
\nsourcepub fn rsplit_array_ref<const M: usize>(&self) -> (&[T], &[T; M])
🔬This is a nightly-only experimental API. (split_array)
Divides one array reference into two at an index from the end.
\nThe first will contain all indices from [0, N - M) (excluding\nthe index N - M itself) and the second will contain all\nindices from [N - M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet v = [1, 2, 3, 4, 5, 6];\n\n{\n let (left, right) = v.rsplit_array_ref::<0>();\n assert_eq!(left, &[1, 2, 3, 4, 5, 6]);\n assert_eq!(right, &[]);\n}\n\n{\n let (left, right) = v.rsplit_array_ref::<2>();\n assert_eq!(left, &[1, 2, 3, 4]);\n assert_eq!(right, &[5, 6]);\n}\n\n{\n let (left, right) = v.rsplit_array_ref::<6>();\n assert_eq!(left, &[]);\n assert_eq!(right, &[1, 2, 3, 4, 5, 6]);\n}
\nsourcepub fn rsplit_array_mut<const M: usize>(&mut self) -> (&mut [T], &mut [T; M])
🔬This is a nightly-only experimental API. (split_array)
Divides one mutable array reference into two at an index from the end.
\nThe first will contain all indices from [0, N - M) (excluding\nthe index N - M itself) and the second will contain all\nindices from [N - M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet mut v = [1, 0, 3, 0, 5, 6];\nlet (left, right) = v.rsplit_array_mut::<4>();\nassert_eq!(left, &mut [1, 0]);\nassert_eq!(right, &mut [3, 0, 5, 6][..]);\nleft[1] = 2;\nright[1] = 4;\nassert_eq!(v, [1, 2, 3, 4, 5, 6]);
\n",0,"iroh_docs::sync::PeerIdBytes"],["source§impl<const N: usize> [u8; N]
sourcepub const fn as_ascii(&self) -> Option<&[AsciiChar; N]>
🔬This is a nightly-only experimental API. (ascii_char)
Converts this array of bytes into a array of ASCII characters,\nor returns None if any of the characters is non-ASCII.
\n§Examples
\n#![feature(ascii_char)]\n#![feature(const_option)]\n\nconst HEX_DIGITS: [std::ascii::Char; 16] =\n *b\"0123456789abcdef\".as_ascii().unwrap();\n\nassert_eq!(HEX_DIGITS[1].as_str(), \"1\");\nassert_eq!(HEX_DIGITS[10].as_str(), \"a\");
\nsourcepub const unsafe fn as_ascii_unchecked(&self) -> &[AsciiChar; N]
🔬This is a nightly-only experimental API. (ascii_char)
Converts this array of bytes into a array of ASCII characters,\nwithout checking whether they’re valid.
\n§Safety
\nEvery byte in the array must be in 0..=127, or else this is UB.
\n",0,"iroh_docs::sync::PeerIdBytes"],["§impl<T> Array for [T; 32]where\n T: Default,
§fn as_slice_mut(&mut self) -> &mut [T]
Gives a unique slice over the whole thing. Read more","Array","iroh_docs::sync::PeerIdBytes"],["","Array","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> AsBytes for [T; N]where\n T: AsBytes,
§fn write_to_prefix(&self, bytes: &mut [u8]) -> Option<()>
","AsBytes","iroh_docs::sync::PeerIdBytes"],["","AsBytes","iroh_docs::sync::PeerIdBytes"],["","AsMut<[T]>","iroh_docs::sync::PeerIdBytes"],["","AsRef<[T]>","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> BitView for [T; N]where\n T: BitStore,
Note that overly-large arrays may cause the conversions to fail.
\n§fn view_bits<O>(&self) -> &BitSlice<T, O>where\n O: BitOrder,
Views a memory region as an immutable bit-slice.§fn try_view_bits<O>(&self) -> Result<&BitSlice<T, O>, BitSpanError<T>>where\n O: BitOrder,
Attempts to view a memory region as an immutable bit-slice. Read more§fn view_bits_mut<O>(&mut self) -> &mut BitSlice<T, O>where\n O: BitOrder,
Views a memory region as a mutable bit-slice.§fn try_view_bits_mut<O>(\n &mut self\n) -> Result<&mut BitSlice<T, O>, BitSpanError<T>>where\n O: BitOrder,
Attempts to view a memory region as a mutable bit-slice. Read more","BitView","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> BitViewSized for [T; N]where\n T: BitStore,
§fn as_raw_slice(&self) -> &[<[T; N] as BitView>::Store]
Views the type as a slice of its elements.§fn as_raw_mut_slice(&mut self) -> &mut [<[T; N] as BitView>::Store]
Views the type as a mutable slice of its elements.§fn into_bitarray<O>(self) -> BitArray<Self, O>where\n O: BitOrder,
Wraps self in a BitArray.","BitViewSized","iroh_docs::sync::PeerIdBytes"],["","Borrow<[T]>","iroh_docs::sync::PeerIdBytes"],["1.4.0 · source§impl<T, const N: usize> BorrowMut<[T]> for [T; N]
source§fn borrow_mut(&mut self) -> &mut [T]
Mutably borrows from an owned value. Read more","BorrowMut<[T]>","iroh_docs::sync::PeerIdBytes"],["","Chain","iroh_docs::sync::PeerIdBytes"],["","Clone","iroh_docs::sync::PeerIdBytes"],["","Debug","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize> Decode for [u8; N]
Decodes a byte array from byte[n] as described in RFC4251 § 5:
\n\nA byte represents an arbitrary 8-bit value (octet). Fixed length\ndata is sometimes represented as an array of bytes, written\nbyte[n], where n is the number of bytes in the array.
\n
\n","Decode","iroh_docs::sync::PeerIdBytes"],["§impl<'a, T, const N: usize> DecodeValue<'a> for [T; N]where\n T: Decode<'a>,
§fn decode_value<R>(reader: &mut R, header: Header) -> Result<[T; N], Error>where\n R: Reader<'a>,
Attempt to decode this message using the provided [Reader].","DecodeValue<'a>","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["source§impl<'de, T> Deserialize<'de> for [T; 32]where\n T: Deserialize<'de>,
source§fn deserialize<D>(\n deserializer: D\n) -> Result<[T; 32], <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more","Deserialize<'de>","iroh_docs::sync::PeerIdBytes"],["source§impl<'de, const N: usize> Deserialize<'de> for [u8; N]
source§fn deserialize<D>(\n deserializer: D\n) -> Result<[u8; N], <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
","Deserialize<'de>","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize> Encode for [u8; N]
Encodes [u8; N] into byte[n] as described in RFC4251 § 5:
\n\nA byte represents an arbitrary 8-bit value (octet). Fixed length\ndata is sometimes represented as an array of bytes, written\nbyte[n], where n is the number of bytes in the array.
\n
\n§fn encoded_len(&self) -> Result<usize, Error>
Get the length of this type encoded in bytes, prior to Base64 encoding.§fn encode(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value using the provided [Writer].§fn encoded_len_prefixed(&self) -> Result<usize, Error>
Return the length of this type after encoding when prepended with a\nuint32 length prefix.§fn encode_prefixed(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value, first prepending a uint32 length prefix\nset to [Encode::encoded_len].","Encode","iroh_docs::sync::PeerIdBytes"],["","EncodeLabelSet","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> EncodeValue for [T; N]where\n T: Encode,
","EncodeValue","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["§impl<'a> FindToken<&'a u8> for [u8; 32]
§fn find_token(&self, token: &u8) -> bool
Returns true if self contains the token","FindToken<&'a u8>","iroh_docs::sync::PeerIdBytes"],["§impl FindToken<u8> for [u8; 32]
§fn find_token(&self, token: u8) -> bool
Returns true if self contains the token","FindToken","iroh_docs::sync::PeerIdBytes"],["","FixedTag","iroh_docs::sync::PeerIdBytes"],["","From<&Signature>","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["§impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>>> for [T; 32]
","From, B0>, B0>, B0>, B0>, B0>>>","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["","From>","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["source§impl From<NamespaceId> for [u8; 32]
source§fn from(value: NamespaceId) -> Self
Converts to this type from the input type.","From","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["","From>","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> FromBytes for [T; N]where\n T: FromBytes,
§fn slice_from_prefix(bytes: &[u8], count: usize) -> Option<(&[Self], &[u8])>where\n Self: Sized,
Interprets the prefix of the given bytes as a &[Self] with length\nequal to count without copying. Read more§fn slice_from_suffix(bytes: &[u8], count: usize) -> Option<(&[u8], &[Self])>where\n Self: Sized,
Interprets the suffix of the given bytes as a &[Self] with length\nequal to count without copying. Read more§fn read_from_prefix(bytes: &[u8]) -> Option<Self>where\n Self: Sized,
","FromBytes","iroh_docs::sync::PeerIdBytes"],["","FromHex","iroh_docs::sync::PeerIdBytes"],["","FromZeroes","iroh_docs::sync::PeerIdBytes"],["","Hash","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Hash for [T; N]where\n T: Hash,
The hash of an array is the same as that of the corresponding slice,\nas required by the Borrow implementation.
\n\nuse std::hash::BuildHasher;\n\nlet b = std::hash::RandomState::new();\nlet a: [u8; 3] = [0xa8, 0x3c, 0x09];\nlet s: &[u8] = &[0xa8, 0x3c, 0x09];\nassert_eq!(b.hash_one(a), b.hash_one(s));
\n","Hash","iroh_docs::sync::PeerIdBytes"],["","Index","iroh_docs::sync::PeerIdBytes"],["","IndexMut","iroh_docs::sync::PeerIdBytes"],["","InputLength","iroh_docs::sync::PeerIdBytes"],["1.53.0 · source§impl<T, const N: usize> IntoIterator for [T; N]
source§fn into_iter(self) -> <[T; N] as IntoIterator>::IntoIter
Creates a consuming iterator, that is, one that moves each value out of\nthe array (from start to end). The array cannot be used after calling\nthis unless T implements Copy, so the whole array is copied.
\nArrays have special behavior when calling .into_iter() prior to the\n2021 edition – see the array Editions section for more information.
\n","IntoIterator","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize> IntoResponse for [u8; N]
§fn into_response(self) -> Response<Body>
Create a response.","IntoResponse","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, const N: usize> Join for [Fut; N]where\n Fut: IntoFuture,
§type Output = [<Fut as IntoFuture>::Output; N]
The resulting output type.§type Future = Join<<Fut as IntoFuture>::IntoFuture, N>
The Future implementation returned by this method.","Join","iroh_docs::sync::PeerIdBytes"],["","Key","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> MaxSize for [T; N]where\n T: MaxSize,
§const POSTCARD_MAX_SIZE: usize = _
The maximum possible size that the serialization of this\ntype can have, in bytes.","MaxSize","iroh_docs::sync::PeerIdBytes"],["","Merge","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Ord for [T; N]where\n T: Ord,
Implements comparison of arrays lexicographically.
\n1.21.0 · source§fn max(self, other: Self) -> Selfwhere\n Self: Sized,
Compares and returns the maximum of two values. Read more","Ord","iroh_docs::sync::PeerIdBytes"],["","PartialEq<&[U]>","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, U, const N: usize> PartialEq<&mut [U]> for [T; N]where\n T: PartialEq<U>,
","PartialEq<&mut [U]>","iroh_docs::sync::PeerIdBytes"],["","PartialEq<[U]>","iroh_docs::sync::PeerIdBytes"],["","PartialEq<[U; N]>","iroh_docs::sync::PeerIdBytes"],["","PartialEq","iroh_docs::sync::PeerIdBytes"],["§impl<A, B, const N: usize, const M: usize> PartialEq<Vec<A, N>> for [B; M]where\n A: PartialEq<B>,
","PartialEq>","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> PartialOrd for [T; N]where\n T: PartialOrd,
Implements comparison of arrays lexicographically.
\nsource§fn le(&self, other: &[T; N]) -> bool
This method tests less than or equal to (for self and other) and is used by the <=\noperator. Read more","PartialOrd","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, const N: usize> Race for [Fut; N]where\n Fut: IntoFuture,
§type Output = <Fut as IntoFuture>::Output
The resulting output type.§type Future = Race<<Fut as IntoFuture>::IntoFuture, N>
Which kind of future are we turning this into?","Race","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, T, E, const N: usize> RaceOk for [Fut; N]where\n Fut: IntoFuture<Output = Result<T, E>>,
§type Future = RaceOk<<Fut as IntoFuture>::IntoFuture, T, E, N>
Which kind of future are we turning this into?","RaceOk","iroh_docs::sync::PeerIdBytes"],["","Schema","iroh_docs::sync::PeerIdBytes"],["source§impl<T> Serialize for [T; 32]where\n T: 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","iroh_docs::sync::PeerIdBytes"],["source§impl<const N: usize> Serialize for [u8; N]
source§fn serialize<S>(\n &self,\n serializer: S\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where\n S: Serializer,
","Serialize","iroh_docs::sync::PeerIdBytes"],["1.51.0 · source§impl<T, const N: usize> SlicePattern for [T; N]
","SlicePattern","iroh_docs::sync::PeerIdBytes"],["1.34.0 · source§impl<T, const N: usize> TryFrom<&[T]> for [T; N]where\n T: Copy,
Tries to create an array [T; N] by copying from a slice &[T]. Succeeds if\nslice.len() == N.
\n\nlet bytes: [u8; 3] = [1, 0, 2];\n\nlet bytes_head: [u8; 2] = <[u8; 2]>::try_from(&bytes[0..2]).unwrap();\nassert_eq!(1, u16::from_le_bytes(bytes_head));\n\nlet bytes_tail: [u8; 2] = bytes[1..3].try_into().unwrap();\nassert_eq!(512, u16::from_le_bytes(bytes_tail));
\n§type Error = TryFromSliceError
The type returned in the event of a conversion error.","TryFrom<&[T]>","iroh_docs::sync::PeerIdBytes"],["1.59.0 · source§impl<T, const N: usize> TryFrom<&mut [T]> for [T; N]where\n T: Copy,
Tries to create an array [T; N] by copying from a mutable slice &mut [T].\nSucceeds if slice.len() == N.
\n\nlet mut bytes: [u8; 3] = [1, 0, 2];\n\nlet bytes_head: [u8; 2] = <[u8; 2]>::try_from(&mut bytes[0..2]).unwrap();\nassert_eq!(1, u16::from_le_bytes(bytes_head));\n\nlet bytes_tail: [u8; 2] = (&mut bytes[1..3]).try_into().unwrap();\nassert_eq!(512, u16::from_le_bytes(bytes_tail));
\n§type Error = TryFromSliceError
The type returned in the event of a conversion error.","TryFrom<&mut [T]>","iroh_docs::sync::PeerIdBytes"],["§impl<T, A, const N: usize> TryFrom<Vec<T, A>> for [T; N]where\n A: Allocator,
§fn try_from(vec: Vec<T, A>) -> Result<[T; N], Vec<T, A>>
Gets the entire contents of the Vec<T> as an array,\nif its size exactly matches that of the requested array.
\n§Examples
\nassert_eq!(vec![1, 2, 3].try_into(), Ok([1, 2, 3]));\nassert_eq!(<Vec<i32>>::new().try_into(), Ok([]));
\nIf the length doesn’t match, the input comes back in Err:
\n\nlet r: Result<[i32; 4], _> = (0..10).collect::<Vec<_>>().try_into();\nassert_eq!(r, Err(vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9]));
\nIf you’re fine with just getting a prefix of the Vec<T>,\nyou can call .truncate(N) first.
\n\nlet mut v = String::from(\"hello world\").into_bytes();\nv.sort();\nv.truncate(2);\nlet [a, b]: [_; 2] = v.try_into().unwrap();\nassert_eq!(a, b' ');\nassert_eq!(b, b'd');
\n","TryFrom>","iroh_docs::sync::PeerIdBytes"],["1.48.0 · source§impl<T, A, const N: usize> TryFrom<Vec<T, A>> for [T; N]where\n A: Allocator,
source§fn try_from(vec: Vec<T, A>) -> Result<[T; N], Vec<T, A>>
Gets the entire contents of the Vec<T> as an array,\nif its size exactly matches that of the requested array.
\n§Examples
\nassert_eq!(vec![1, 2, 3].try_into(), Ok([1, 2, 3]));\nassert_eq!(<Vec<i32>>::new().try_into(), Ok([]));
\nIf the length doesn’t match, the input comes back in Err:
\n\nlet r: Result<[i32; 4], _> = (0..10).collect::<Vec<_>>().try_into();\nassert_eq!(r, Err(vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9]));
\nIf you’re fine with just getting a prefix of the Vec<T>,\nyou can call .truncate(N) first.
\n\nlet mut v = String::from(\"hello world\").into_bytes();\nv.sort();\nv.truncate(2);\nlet [a, b]: [_; 2] = v.try_into().unwrap();\nassert_eq!(a, b' ');\nassert_eq!(b, b'd');
\n","TryFrom>","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, T, E, const N: usize> TryJoin for [Fut; N]where\n Fut: IntoFuture<Output = Result<T, E>>,
§type Future = TryJoin<<Fut as IntoFuture>::IntoFuture, T, E, N>
Which kind of future are we turning this into?","TryJoin","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> Value for [T; N]where\n T: Value,
§type SelfType<'a> = [<T as Value>::SelfType<'a>; N]\nwhere\n [T; N]: 'a
SelfType<’a> must be the same type as Self with all lifetimes replaced with ’a§type AsBytes<'a> = Vec<u8>\nwhere\n [T; N]: 'a
§fn fixed_width() -> Option<usize>
Width of a fixed type, or None for variable width§fn from_bytes<'a>(data: &'a [u8]) -> [<T as Value>::SelfType<'a>; N]where\n [T; N]: 'a,
Deserializes data\nImplementations may return a view over data, or an owned type","Value","iroh_docs::sync::PeerIdBytes"],["","ValueOrd","iroh_docs::sync::PeerIdBytes"],["§impl<Z, const N: usize> Zeroize for [Z; N]where\n Z: Zeroize,
Impl [Zeroize] on arrays of types that impl [Zeroize].
\n","Zeroize","iroh_docs::sync::PeerIdBytes"],["","Zip","iroh_docs::sync::PeerIdBytes"],["source§impl<T, const N: usize> ConstParamTy for [T; N]where\n T: ConstParamTy,
","ConstParamTy","iroh_docs::sync::PeerIdBytes"],["1.58.0 · source§impl<T, const N: usize> Copy for [T; N]where\n T: Copy,
","Copy","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Eq for [T; N]where\n T: Eq,
","Eq","iroh_docs::sync::PeerIdBytes"],["source§impl<T, const N: usize> StructuralPartialEq for [T; N]
","StructuralPartialEq","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> Unaligned for [T; N]where\n T: Unaligned,
","Unaligned","iroh_docs::sync::PeerIdBytes"],["§impl<Z, const N: usize> ZeroizeOnDrop for [Z; N]where\n Z: ZeroizeOnDrop,
Impl [ZeroizeOnDrop] on arrays of types that impl [ZeroizeOnDrop].
\n","ZeroizeOnDrop","iroh_docs::sync::PeerIdBytes"]]
};if (window.register_type_impls) {window.register_type_impls(type_impls);} else {window.pending_type_impls = type_impls;}})()
\ No newline at end of file
Struct iroh_blobs::Hash
pub struct Hash(/* private fields */);Expand description
Hash type used throughout.
-Implementations§
§impl Hash
impl Hash
pub const fn from_bytes(bytes: [u8; 32]) -> Hash
pub const fn from_bytes(bytes: [u8; 32]) -> Hash
Create a Hash from its raw bytes representation.
pub fn fmt_short(&self) -> String
pub fn fmt_short(&self) -> String
Convert to a base32 string limited to the first 10 bytes for a friendly string +
Struct iroh_blobs::Hash
source · pub struct Hash(/* private fields */);Expand description
Hash type used throughout.
+Implementations§
Trait Implementations§
Trait Implementations§
source§impl<'de> Deserialize<'de> for Hash
impl<'de> Deserialize<'de> for Hash
source§fn deserialize<D>(
deserializer: D
) -> Result<Hash, <D as Deserializer<'de>>::Error>where
- D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D
) -> Result<Hash, <D as Deserializer<'de>>::Error>where
- D: Deserializer<'de>,
source§impl FromIterator<Hash> for HashSeq
impl FromIterator<Hash> for HashSeq
§impl Hash for Hash
impl Hash for Hash
§fn hash<__H>(&self, state: &mut __H)where
+ D: Deserializer<'de>,
fn hash<__H>(&self, state: &mut __H)where
+ D: Deserializer<'de>,
source§impl FromIterator<Hash> for HashSeq
impl FromIterator<Hash> for HashSeq
§impl MaxSize for Hash
impl MaxSize for Hash
§const POSTCARD_MAX_SIZE: usize = 32usize
const POSTCARD_MAX_SIZE: usize = 32usize
source§impl MaxSize for Hash
impl MaxSize for Hash
source§const POSTCARD_MAX_SIZE: usize = 32usize
const POSTCARD_MAX_SIZE: usize = 32usize
source§impl Ord for Hash
impl Ord for Hash
source§impl PartialEq for Hash
impl PartialEq for Hash
§impl PartialOrd for Hash
impl PartialOrd for Hash
source§impl PartialOrd for Hash
impl PartialOrd for Hash
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self and other) and is used by the <=
operator. Read moresource§impl Serialize for Hash
impl Serialize for Hash
source§fn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
- S: Serializer,
fn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
- S: Serializer,
§impl Value for Hash
impl Value for Hash
§type SelfType<'a> = Hash
type SelfType<'a> = Hash
type AsBytes<'a> = &'a [u8; 32]
§fn fixed_width() -> Option<usize>
fn fixed_width() -> Option<usize>
§fn from_bytes<'a>(data: &'a [u8]) -> <Hash as Value>::SelfType<'a>where
+ S: Serializer,
fn from_bytes<'a>(data: &'a [u8]) -> <Hash as Value>::SelfType<'a>where
+ S: Serializer,
source§impl Value for Hash
impl Value for Hash
§type SelfType<'a> = Hash
type SelfType<'a> = Hash
type AsBytes<'a> = &'a [u8; 32]
source§fn fixed_width() -> Option<usize>
fn fixed_width() -> Option<usize>
impl Copy for Hash
impl Eq for Hash
impl StructuralPartialEq for Hash
Auto Trait Implementations§
impl Freeze for Hash
impl RefUnwindSafe for Hash
impl Send for Hash
impl Sync for Hash
impl Unpin for Hash
impl UnwindSafe for Hash
Blanket Implementations§
impl Copy for Hash
impl Eq for Hash
impl StructuralPartialEq for Hash
Auto Trait Implementations§
impl Freeze for Hash
impl RefUnwindSafe for Hash
impl Send for Hash
impl Sync for Hash
impl Unpin for Hash
impl UnwindSafe for Hash
Blanket Implementations§
§impl<A, T> AsBits<T> for A
impl<A, T> AsBits<T> for A
§fn as_bits<O>(&self) -> &BitSlice<T, O>where
diff --git a/pr/2595/docs/iroh_blobs/struct.HashAndFormat.html b/pr/2595/docs/iroh_blobs/struct.HashAndFormat.html
index 8eb7ba64d5..421c7e1439 100644
--- a/pr/2595/docs/iroh_blobs/struct.HashAndFormat.html
+++ b/pr/2595/docs/iroh_blobs/struct.HashAndFormat.html
@@ -1,37 +1,37 @@
-HashAndFormat in iroh_blobs - Rust Struct iroh_blobs::HashAndFormat
pub struct HashAndFormat {
+HashAndFormat in iroh_blobs - Rust Struct iroh_blobs::HashAndFormat
source · pub struct HashAndFormat {
pub hash: Hash,
pub format: BlobFormat,
}
Expand description
A hash and format pair
Fields§
§hash: HashThe hash
§format: BlobFormatThe format
-Implementations§
§impl HashAndFormat
pub fn new(hash: Hash, format: BlobFormat) -> HashAndFormat
Create a new hash and format pair.
-pub fn raw(hash: Hash) -> HashAndFormat
Create a new hash and format pair, using the default (raw) format.
-pub fn hash_seq(hash: Hash) -> HashAndFormat
Create a new hash and format pair, using the collection format.
-Trait Implementations§
§impl Clone for HashAndFormat
§fn clone(&self) -> HashAndFormat
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more§impl Debug for HashAndFormat
§impl<'de> Deserialize<'de> for HashAndFormat
§fn deserialize<D>(
+
Implementations§
source§impl HashAndFormat
sourcepub fn new(hash: Hash, format: BlobFormat) -> HashAndFormat
Create a new hash and format pair.
+sourcepub fn raw(hash: Hash) -> HashAndFormat
Create a new hash and format pair, using the default (raw) format.
+sourcepub fn hash_seq(hash: Hash) -> HashAndFormat
Create a new hash and format pair, using the collection format.
+Trait Implementations§
source§impl Clone for HashAndFormat
source§fn clone(&self) -> HashAndFormat
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moresource§impl Debug for HashAndFormat
source§impl<'de> Deserialize<'de> for HashAndFormat
source§fn deserialize<D>(
deserializer: D
) -> Result<HashAndFormat, <D as Deserializer<'de>>::Error>where
- D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more§impl Display for HashAndFormat
source§impl From<DownloadKind> for HashAndFormat
source§fn from(value: DownloadKind) -> Self
Converts to this type from the input type.source§impl From<HashAndFormat> for DownloadKind
source§fn from(value: HashAndFormat) -> Self
Converts to this type from the input type.§impl FromStr for HashAndFormat
§impl Hash for HashAndFormat
§fn hash<__H>(&self, state: &mut __H)where
+ D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl Display for HashAndFormat
source§impl From<DownloadKind> for HashAndFormat
source§fn from(value: DownloadKind) -> Self
Converts to this type from the input type.source§impl From<HashAndFormat> for DownloadKind
source§fn from(value: HashAndFormat) -> Self
Converts to this type from the input type.source§impl FromStr for HashAndFormat
source§impl Hash for HashAndFormat
§impl MaxSize for HashAndFormat
§const POSTCARD_MAX_SIZE: usize = 33usize
The maximum possible size that the serialization of this
-type can have, in bytes.§impl Ord for HashAndFormat
source§impl MaxSize for HashAndFormat
source§const POSTCARD_MAX_SIZE: usize = 33usize
The maximum possible size that the serialization of this
+type can have, in bytes.source§impl Ord for HashAndFormat
source§fn cmp(&self, other: &HashAndFormat) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more§impl PartialEq for HashAndFormat
§fn eq(&self, other: &HashAndFormat) -> bool
Restrict a value to a certain interval. Read moresource§impl PartialEq for HashAndFormat
source§fn eq(&self, other: &HashAndFormat) -> bool
This method tests for self and other values to be equal, and is used
by ==.§impl PartialOrd for HashAndFormat
§fn partial_cmp(&self, other: &HashAndFormat) -> Option<Ordering>
source§impl PartialOrd for HashAndFormat
source§fn partial_cmp(&self, other: &HashAndFormat) -> Option<Ordering>
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 <=
operator. Read moresource§impl Serialize for HashAndFormat
source§fn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
- S: Serializer,
Serialize this value into the given Serde serializer. Read more§impl Value for HashAndFormat
§type SelfType<'a> = HashAndFormat
SelfType<’a> must be the same type as Self with all lifetimes replaced with ’a§type AsBytes<'a> = [u8; 33]
§fn fixed_width() -> Option<usize>
Width of a fixed type, or None for variable width§fn from_bytes<'a>(data: &'a [u8]) -> <HashAndFormat as Value>::SelfType<'a>where
+ S: Serializer,
Serialize this value into the given Serde serializer. Read moresource§impl Value for HashAndFormat
§type SelfType<'a> = HashAndFormat
SelfType<’a> must be the same type as Self with all lifetimes replaced with ’a§type AsBytes<'a> = [u8; 33]
source§fn fixed_width() -> Option<usize>
Width of a fixed type, or None for variable widthsource§fn from_bytes<'a>(data: &'a [u8]) -> <HashAndFormat as Value>::SelfType<'a>where
HashAndFormat: 'a,
Deserializes data
-Implementations may return a view over data, or an owned typesource§fn as_bytes<'a, 'b>(
value: &'a <HashAndFormat as Value>::SelfType<'b>
) -> <HashAndFormat as Value>::AsBytes<'a>where
'b: 'a,
- HashAndFormat: 'a + 'b,
Serialize the value to a slice§impl Copy for HashAndFormat
§impl Eq for HashAndFormat
§impl StructuralPartialEq for HashAndFormat
Auto Trait Implementations§
§impl Freeze for HashAndFormat
§impl RefUnwindSafe for HashAndFormat
§impl Send for HashAndFormat
§impl Sync for HashAndFormat
§impl Unpin for HashAndFormat
§impl UnwindSafe for HashAndFormat
Blanket Implementations§
source§impl<T> Any for Twhere
+ HashAndFormat: 'a + 'b,
Serialize the value to a slicesource§impl Copy for HashAndFormat
source§impl Eq for HashAndFormat
source§impl StructuralPartialEq for HashAndFormat
Auto Trait Implementations§
§impl Freeze for HashAndFormat
§impl RefUnwindSafe for HashAndFormat
§impl Send for HashAndFormat
§impl Sync for HashAndFormat
§impl Unpin for HashAndFormat
§impl UnwindSafe for HashAndFormat
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
diff --git a/pr/2595/docs/iroh_docs/actor/struct.SyncHandle.html b/pr/2595/docs/iroh_docs/actor/struct.SyncHandle.html
index cfd29c2ce8..6c70a0ff39 100644
--- a/pr/2595/docs/iroh_docs/actor/struct.SyncHandle.html
+++ b/pr/2595/docs/iroh_docs/actor/struct.SyncHandle.html
@@ -26,7 +26,7 @@ waiting for the actor to finish happens in an async context, and therefore that
namespace: NamespaceId,
author: AuthorId,
key: Bytes,
- hash: Hash,
+ hash: Hash,
len: u64
) -> Result<()>sourcepub async fn delete_prefix(
&self,
diff --git a/pr/2595/docs/iroh_docs/engine/enum.LiveEvent.html b/pr/2595/docs/iroh_docs/engine/enum.LiveEvent.html
index ceb8545b50..f0d33bcb21 100644
--- a/pr/2595/docs/iroh_docs/engine/enum.LiveEvent.html
+++ b/pr/2595/docs/iroh_docs/engine/enum.LiveEvent.html
@@ -3,34 +3,34 @@
entry: Entry,
},
InsertRemote {
- from: PublicKey,
+ from: PublicKey,
entry: Entry,
content_status: ContentStatus,
},
ContentReady {
- hash: Hash,
+ hash: Hash,
},
PendingContentReady,
- NeighborUp(PublicKey),
- NeighborDown(PublicKey),
+ NeighborUp(PublicKey),
+ NeighborDown(PublicKey),
SyncFinished(SyncEvent),
}Expand description
Events informing about actions of the live sync progress.
Variants§
§InsertLocal
A local insertion.
§InsertRemote
Received a remote insert.
-Fields
§from: PublicKeyThe peer that sent us the entry.
+Fields
§content_status: ContentStatusIf the content is available at the local node
§ContentReady
The content of an entry was downloaded and is now available at the local node
-Fields
§hash: HashThe content hash of the newly available entry content
+§PendingContentReady
All pending content is now ready.
This event signals that all queued content downloads from the last sync run have either
completed or failed.
It will only be emitted after a Self::SyncFinished event, never before.
Receiving this event does not guarantee that all content in the document is available. If
blobs failed to download, this event will still be emitted after all operations completed.
-§NeighborUp(PublicKey)
We have a new neighbor in the swarm.
-§NeighborDown(PublicKey)
We lost a neighbor in the swarm.
+§NeighborUp(PublicKey)
We have a new neighbor in the swarm.
+§NeighborDown(PublicKey)
We lost a neighbor in the swarm.
§SyncFinished(SyncEvent)
A set-reconciliation sync finished.
Trait Implementations§
source§impl<'de> Deserialize<'de> for LiveEvent
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl PartialEq for LiveEvent
source§fn eq(&self, other: &LiveEvent) -> bool
This method tests for self and other values to be equal, and is used
diff --git a/pr/2595/docs/iroh_docs/engine/fn.entry_to_content_status.html b/pr/2595/docs/iroh_docs/engine/fn.entry_to_content_status.html
index 459a6719d2..3b39df6428 100644
--- a/pr/2595/docs/iroh_docs/engine/fn.entry_to_content_status.html
+++ b/pr/2595/docs/iroh_docs/engine/fn.entry_to_content_status.html
@@ -1,2 +1,2 @@
-entry_to_content_status in iroh_docs::engine - Rust Function iroh_docs::engine::entry_to_content_status
source · pub fn entry_to_content_status(entry: Result<EntryStatus>) -> ContentStatus
Expand description
Converts an [EntryStatus] into a [‘ContentStatus’].
+entry_to_content_status in iroh_docs::engine - Rust Function iroh_docs::engine::entry_to_content_status
source · pub fn entry_to_content_status(entry: Result<EntryStatus>) -> ContentStatus
Expand description
Converts an EntryStatus into a [‘ContentStatus’].
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_docs/engine/index.html b/pr/2595/docs/iroh_docs/engine/index.html
index 5f78e23386..622ab4b871 100644
--- a/pr/2595/docs/iroh_docs/engine/index.html
+++ b/pr/2595/docs/iroh_docs/engine/index.html
@@ -1,4 +1,4 @@
iroh_docs::engine - Rust Expand description
Handlers and actors to for live syncing replicas.
crate::Replica is also called documents here.
Structs§
- Persistent default author for a docs engine.
- The sync engine coordinates actors that manage open documents, set-reconciliation syncs with
-peers and a gossip swarm for each syncing document.
- Event emitted when a sync operation completes
Enums§
- Where to persist the default author.
- Events informing about actions of the live sync progress.
- Why we performed a sync exchange
- Why we started a sync request
Functions§
- Converts an [
EntryStatus] into a [‘ContentStatus’].
\ No newline at end of file
+peers and a gossip swarm for each syncing document.Event emitted when a sync operation completes Enums§
- Where to persist the default author.
- Events informing about actions of the live sync progress.
- Why we performed a sync exchange
- Why we started a sync request
Functions§
- Converts an
EntryStatus into a [‘ContentStatus’].
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_docs/engine/struct.Engine.html b/pr/2595/docs/iroh_docs/engine/struct.Engine.html
index 1b88a96726..46cd25179e 100644
--- a/pr/2595/docs/iroh_docs/engine/struct.Engine.html
+++ b/pr/2595/docs/iroh_docs/engine/struct.Engine.html
@@ -8,12 +8,12 @@ peers and a gossip swarm for each syncing document.
Fields§
§endpoint: EndpointEndpoint used by the engine.
§sync: SyncHandleHandle to the actor thread.
The persistent default author for this engine.
-Implementations§
source§impl Engine
Implementations§
source§impl Engine
sourcepub async fn spawn<B: Store>(
endpoint: Endpoint,
- gossip: Gossip,
+ gossip: Gossip,
replica_store: Store,
bao_store: B,
- downloader: Downloader,
+ downloader: Downloader,
default_author_storage: DefaultAuthorStorage
) -> Result<Self>
Start the sync engine.
This will spawn two tokio tasks for the live sync coordination and gossip actors, and a
@@ -21,7 +21,7 @@ thread for the sourcepub async fn start_sync(
&self,
namespace: NamespaceId,
- peers: Vec<NodeAddr>
+ peers: Vec<NodeAddr>
) -> Result<()>
Start to sync a document.
If peers is non-empty, it will both do an initial set-reconciliation sync with each peer,
and join an iroh-gossip swarm with these peers to receive and broadcast document updates.
diff --git a/pr/2595/docs/iroh_docs/engine/struct.SyncEvent.html b/pr/2595/docs/iroh_docs/engine/struct.SyncEvent.html
index 49ba954022..d7eb730d81 100644
--- a/pr/2595/docs/iroh_docs/engine/struct.SyncEvent.html
+++ b/pr/2595/docs/iroh_docs/engine/struct.SyncEvent.html
@@ -1,11 +1,11 @@
SyncEvent in iroh_docs::engine - Rust pub struct SyncEvent {
- pub peer: PublicKey,
+ pub peer: PublicKey,
pub origin: Origin,
pub finished: SystemTime,
pub started: SystemTime,
pub result: Result<SyncDetails, String>,
}
Expand description
Event emitted when a sync operation completes
-Fields§
§peer: PublicKeyPeer we synced with
+Fields§
§peer: PublicKeyPeer we synced with
§origin: OriginOrigin of the sync exchange
§finished: SystemTimeTimestamp when the sync started
§started: SystemTimeTimestamp when the sync finished
diff --git a/pr/2595/docs/iroh_docs/index.html b/pr/2595/docs/iroh_docs/index.html
index a37d30e2a6..41c792c5e5 100644
--- a/pr/2595/docs/iroh_docs/index.html
+++ b/pr/2595/docs/iroh_docs/index.html
@@ -1,7 +1,7 @@
iroh_docs - Rust Expand description
Multi-dimensional key-value documents with an efficient synchronization protocol
The crate operates on Replicas. A replica contains an unlimited number of
Entries. Each entry is identified by a key, its author, and the replica’s
-namespace. Its value is the 32-byte BLAKE3 hash
+namespace. Its value is the 32-byte BLAKE3 hash
of the entry’s content data, the size of this content data, and a timestamp.
The content data itself is not stored or transferred through a replica.
All entries in a replica are signed with two keypairs:
diff --git a/pr/2595/docs/iroh_docs/net/enum.AcceptError.html b/pr/2595/docs/iroh_docs/net/enum.AcceptError.html
index 87e9a07ad3..cf11b5b695 100644
--- a/pr/2595/docs/iroh_docs/net/enum.AcceptError.html
+++ b/pr/2595/docs/iroh_docs/net/enum.AcceptError.html
@@ -3,31 +3,31 @@
error: Error,
},
Open {
- peer: PublicKey,
+ peer: PublicKey,
error: Error,
},
Abort {
- peer: PublicKey,
+ peer: PublicKey,
namespace: NamespaceId,
reason: AbortReason,
},
Sync {
- peer: PublicKey,
+ peer: PublicKey,
namespace: Option<NamespaceId>,
error: Error,
},
Close {
- peer: PublicKey,
+ peer: PublicKey,
namespace: Option<NamespaceId>,
error: Error,
},
}Expand description
Errors that may occur on handling incoming sync connections.
Variants§
§Connect
Failed to establish connection
§Open
Failed to open replica
-§Abort
We aborted the sync request.
-§Sync
Failed to run sync
-§Close
Failed to close
-Implementations§
source§impl AcceptError
Implementations§
Trait Implementations§
source§impl Debug for AcceptError
source§impl Display for AcceptError
source§impl Error for AcceptError
source§fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more1.0.0 · source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()Auto Trait Implementations§
§impl Freeze for AcceptError
§impl RefUnwindSafe for AcceptError
§impl Send for AcceptError
§impl Sync for AcceptError
§impl Unpin for AcceptError
§impl UnwindSafe for AcceptError
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
diff --git a/pr/2595/docs/iroh_docs/net/fn.connect_and_sync.html b/pr/2595/docs/iroh_docs/net/fn.connect_and_sync.html
index 1ee6909d53..7bec313309 100644
--- a/pr/2595/docs/iroh_docs/net/fn.connect_and_sync.html
+++ b/pr/2595/docs/iroh_docs/net/fn.connect_and_sync.html
@@ -2,6 +2,6 @@
endpoint: &Endpoint,
sync: &SyncHandle,
namespace: NamespaceId,
- peer: NodeAddr
+ peer: NodeAddr
) -> Result<SyncFinished, ConnectError>Expand description
Connect to a peer and sync a replica
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_docs/net/fn.handle_connection.html b/pr/2595/docs/iroh_docs/net/fn.handle_connection.html
index 347a0c22bf..e96816b362 100644
--- a/pr/2595/docs/iroh_docs/net/fn.handle_connection.html
+++ b/pr/2595/docs/iroh_docs/net/fn.handle_connection.html
@@ -3,6 +3,6 @@
connecting: Connecting,
accept_cb: F
) -> Result<SyncFinished, AcceptError>where
- F: Fn(NamespaceId, PublicKey) -> Fut,
+ F: Fn(NamespaceId, PublicKey) -> Fut,
Fut: Future<Output = AcceptOutcome>,Expand description
Handle an iroh-docs connection and sync all shared documents in the replica store.
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_docs/net/struct.SyncFinished.html b/pr/2595/docs/iroh_docs/net/struct.SyncFinished.html
index 74ab2f6632..dcd549e6fc 100644
--- a/pr/2595/docs/iroh_docs/net/struct.SyncFinished.html
+++ b/pr/2595/docs/iroh_docs/net/struct.SyncFinished.html
@@ -1,11 +1,11 @@
SyncFinished in iroh_docs::net - Rust Struct iroh_docs::net::SyncFinished
source · pub struct SyncFinished {
pub namespace: NamespaceId,
- pub peer: PublicKey,
+ pub peer: PublicKey,
pub outcome: SyncOutcome,
pub timings: Timings,
}
Expand description
Details of a finished sync operation.
Fields§
§namespace: NamespaceIdThe namespace that was synced.
-§peer: PublicKeyThe peer we syned with.
+§peer: PublicKeyThe peer we syned with.
§outcome: SyncOutcomeThe outcome of the sync operation
§timings: TimingsThe time this operation took
Trait Implementations§
source§impl Clone for SyncFinished
source§fn clone(&self) -> SyncFinished
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moreAuto Trait Implementations§
§impl Freeze for SyncFinished
§impl RefUnwindSafe for SyncFinished
§impl Send for SyncFinished
§impl Sync for SyncFinished
§impl Unpin for SyncFinished
§impl UnwindSafe for SyncFinished
Blanket Implementations§
source§impl<T> Any for Twhere
diff --git a/pr/2595/docs/iroh_docs/store/fs/struct.ContentHashesIterator.html b/pr/2595/docs/iroh_docs/store/fs/struct.ContentHashesIterator.html
index 8bebf68ec6..df1fc8865f 100644
--- a/pr/2595/docs/iroh_docs/store/fs/struct.ContentHashesIterator.html
+++ b/pr/2595/docs/iroh_docs/store/fs/struct.ContentHashesIterator.html
@@ -6,7 +6,7 @@ It needs a copy of a redb::ReadOnlyTable to be self-contained.
Implementations§
Trait Implementations§
source§impl Debug for ContentHashesIterator
Trait Implementations§
source§impl Debug for ContentHashesIterator
source§impl Iterator for ContentHashesIterator
source§fn next(&mut self) -> Option<Self::Item>
Advances the iterator and returns the next value. Read moresource§fn next_chunk<const N: usize>(
&mut self
) -> Result<[Self::Item; N], IntoIter<Self::Item, N>>where
Self: Sized,
🔬This is a nightly-only experimental API. (iter_next_chunk)Advances the iterator and returns an array containing the next N values. Read more1.0.0 · source§fn size_hint(&self) -> (usize, Option<usize>)
Returns the bounds on the remaining length of the iterator. Read more1.0.0 · source§fn count(self) -> usizewhere
diff --git a/pr/2595/docs/iroh_docs/struct.AuthorId.html b/pr/2595/docs/iroh_docs/struct.AuthorId.html
index 7dfa3dea5b..02221b0eb6 100644
--- a/pr/2595/docs/iroh_docs/struct.AuthorId.html
+++ b/pr/2595/docs/iroh_docs/struct.AuthorId.html
@@ -156,6 +156,6 @@ letters are used (e.g. F9B4CA)
Into<Dispatch>, source§fn with_current_subscriber(self) -> WithDispatch<Self>
source§impl<T> DeserializeOwned for Twhere
- T: for<'de> Deserialize<'de>,
§impl<T> PeerIdentity for Twhere
+ T: for<'de> Deserialize<'de>,
source§impl<T> PeerIdentity for T
source§impl<T> RuleType for T
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_docs/struct.AuthorPublicKey.html b/pr/2595/docs/iroh_docs/struct.AuthorPublicKey.html
index 8e72b11c8a..7a83ce68e4 100644
--- a/pr/2595/docs/iroh_docs/struct.AuthorPublicKey.html
+++ b/pr/2595/docs/iroh_docs/struct.AuthorPublicKey.html
@@ -148,6 +148,6 @@ builds. Into<Dispatch>,source§fn with_current_subscriber(self) -> WithDispatch<Self>
source§impl<T> DeserializeOwned for Twhere
- T: for<'de> Deserialize<'de>,
§impl<T> PeerIdentity for Twhere
+ T: for<'de> Deserialize<'de>,
source§impl<T> PeerIdentity for T
source§impl<T> RuleType for T
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_docs/struct.DocTicket.html b/pr/2595/docs/iroh_docs/struct.DocTicket.html
index d53a93c4c4..fd1bb5eb02 100644
--- a/pr/2595/docs/iroh_docs/struct.DocTicket.html
+++ b/pr/2595/docs/iroh_docs/struct.DocTicket.html
@@ -1,13 +1,13 @@
DocTicket in iroh_docs - Rust pub struct DocTicket {
pub capability: Capability,
- pub nodes: Vec<NodeAddr>,
+ pub nodes: Vec<NodeAddr>,
}
Expand description
Contains both a key (either secret or public) to a document, and a list of peers to join.
Fields§
§capability: Capabilityeither a public or private key
-§nodes: Vec<NodeAddr>A list of nodes to contact.
-Implementations§
source§impl DocTicket
sourcepub fn new(capability: Capability, peers: Vec<NodeAddr>) -> Self
Create a new doc ticket
+§nodes: Vec<NodeAddr>A list of nodes to contact.
+Implementations§
Trait Implementations§
source§impl<'de> Deserialize<'de> for DocTicket
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
- __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreAuto Trait Implementations§
§impl Freeze for DocTicket
§impl RefUnwindSafe for DocTicket
§impl Send for DocTicket
§impl Sync for DocTicket
§impl Unpin for DocTicket
§impl UnwindSafe for DocTicket
Blanket Implementations§
source§impl<T> Any for Twhere
+ __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreAuto Trait Implementations§
§impl Freeze for DocTicket
§impl RefUnwindSafe for DocTicket
§impl Send for DocTicket
§impl Sync for DocTicket
§impl Unpin for DocTicket
§impl UnwindSafe for DocTicket
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
diff --git a/pr/2595/docs/iroh_docs/struct.NamespaceId.html b/pr/2595/docs/iroh_docs/struct.NamespaceId.html
index 433d51afc6..f9acda8e94 100644
--- a/pr/2595/docs/iroh_docs/struct.NamespaceId.html
+++ b/pr/2595/docs/iroh_docs/struct.NamespaceId.html
@@ -156,6 +156,6 @@ letters are used (e.g. F9B4CA)
Into<Dispatch>, source§fn with_current_subscriber(self) -> WithDispatch<Self>
source§impl<T> DeserializeOwned for Twhere
- T: for<'de> Deserialize<'de>,
§impl<T> PeerIdentity for Twhere
+ T: for<'de> Deserialize<'de>,
source§impl<T> PeerIdentity for T
source§impl<T> RuleType for T
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_docs/struct.NamespacePublicKey.html b/pr/2595/docs/iroh_docs/struct.NamespacePublicKey.html
index 350dea9049..72b75ed510 100644
--- a/pr/2595/docs/iroh_docs/struct.NamespacePublicKey.html
+++ b/pr/2595/docs/iroh_docs/struct.NamespacePublicKey.html
@@ -147,6 +147,6 @@ builds.Into<Dispatch>,source§fn with_current_subscriber(self) -> WithDispatch<Self>
source§impl<T> DeserializeOwned for Twhere
- T: for<'de> Deserialize<'de>,
§impl<T> PeerIdentity for Twhere
+ T: for<'de> Deserialize<'de>,
source§impl<T> PeerIdentity for T
source§impl<T> RuleType for T
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_docs/sync/struct.Entry.html b/pr/2595/docs/iroh_docs/sync/struct.Entry.html
index 55bf06044f..055a4b6f54 100644
--- a/pr/2595/docs/iroh_docs/sync/struct.Entry.html
+++ b/pr/2595/docs/iroh_docs/sync/struct.Entry.html
@@ -1,6 +1,6 @@
Entry in iroh_docs::sync - Rust pub struct Entry { /* private fields */ }
Expand description
A single entry in a Replica
An entry is identified by a key, its Author, and the Replica’s
-NamespaceSecret. Its value is the 32-byte BLAKE3 hash
+NamespaceSecret. Its value is the 32-byte BLAKE3 hash
of the entry’s content data, the size of this content data, and a timestamp.
Implementations§
source§impl Entry
sourcepub fn new(id: RecordIdentifier, record: Record) -> Self
Create a new entry
sourcepub fn new_empty(id: RecordIdentifier) -> Self
Create a new empty entry with the current timestamp.
@@ -15,7 +15,7 @@ of the entry’s content data, the size of this content data, and a timestamp.
sourcepub fn sign(self, namespace: &NamespaceSecret, author: &Author) -> SignedEntry
Sign this entry with a NamespaceSecret and Author.
Methods from Deref<Target = Record>§
sourcepub fn content_len(&self) -> u64
Get the length of the data addressed by this record’s content hash.
-sourcepub fn content_hash(&self) -> Hash
Get the [struct@Hash] of the content data of this record.
+sourcepub fn content_hash(&self) -> Hash
Get the Hash of the content data of this record.
Trait Implementations§
source§impl<'de> Deserialize<'de> for Entry
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl From<SignedEntry> for Entry
source§fn from(value: SignedEntry) -> Self
Converts to this type from the input type.source§impl Ord for Entry
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
diff --git a/pr/2595/docs/iroh_docs/sync/struct.Record.html b/pr/2595/docs/iroh_docs/sync/struct.Record.html
index 94479a973e..f06cccab52 100644
--- a/pr/2595/docs/iroh_docs/sync/struct.Record.html
+++ b/pr/2595/docs/iroh_docs/sync/struct.Record.html
@@ -1,11 +1,11 @@
Record in iroh_docs::sync - Rust pub struct Record { /* private fields */ }
Expand description
The data part of an entry in a Replica.
-Implementations§
source§impl Record
Implementations§
source§impl Record
sourcepub fn empty_current() -> Self
Create a tombstone record with the timestamp set to now.
sourcepub fn new_current(hash: Hash, len: u64) -> Self
Create a new Record with the timestamp set to now.
+sourcepub fn new_current(hash: Hash, len: u64) -> Self
Create a new Record with the timestamp set to now.
sourcepub fn content_len(&self) -> u64
Get the length of the data addressed by this record’s content hash.
-sourcepub fn content_hash(&self) -> Hash
Get the [struct@Hash] of the content data of this record.
+sourcepub fn content_hash(&self) -> Hash
Get the Hash of the content data of this record.
Trait Implementations§
source§impl<'de> Deserialize<'de> for Record
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl Ord for Record
Ordering for entry values.
diff --git a/pr/2595/docs/iroh_docs/sync/struct.Replica.html b/pr/2595/docs/iroh_docs/sync/struct.Replica.html
index 23a9798651..c4e161f3c3 100644
--- a/pr/2595/docs/iroh_docs/sync/struct.Replica.html
+++ b/pr/2595/docs/iroh_docs/sync/struct.Replica.html
@@ -5,7 +5,7 @@
&mut self,
key: impl AsRef<[u8]>,
author: &Author,
- hash: Hash,
+ hash: Hash,
len: u64
) -> Result<usize, InsertError>Insert a new record at the given key.
The entry will by signed by the provided author.
@@ -35,7 +35,7 @@ or an error if the entry failed to validate or if a store operation failed.
key: impl AsRef<[u8]>,
author: &Author,
data: impl AsRef<[u8]>
-) -> Result<Hash, InsertError>Hashes the given data and inserts it.
+) -> Result<Hash, InsertError>Hashes the given data and inserts it.
This does not store the content, just the record of it.
Returns the calculated hash.
sourcepub fn record_id(
diff --git a/pr/2595/docs/iroh_docs/sync/struct.SignedEntry.html b/pr/2595/docs/iroh_docs/sync/struct.SignedEntry.html
index 21644eacb1..9ef5e98134 100644
--- a/pr/2595/docs/iroh_docs/sync/struct.SignedEntry.html
+++ b/pr/2595/docs/iroh_docs/sync/struct.SignedEntry.html
@@ -14,7 +14,7 @@
sourcepub fn signature(&self) -> &EntrySignature
Get the signature.
sourcepub fn validate_empty(&self) -> Result<(), ValidationFailure>
Validate that the entry has the empty hash if the length is 0, or a non-zero length.
sourcepub fn content_hash(&self) -> Hash
Get the content [struct@Hash] of the entry.
+sourcepub fn content_hash(&self) -> Hash
Get the content Hash of the entry.
sourcepub fn content_len(&self) -> u64
Get the content length of the entry.
Get the author bytes of this entry.
Methods from Deref<Target = Record>§
sourcepub fn content_len(&self) -> u64
Get the length of the data addressed by this record’s content hash.
-sourcepub fn content_hash(&self) -> Hash
Get the [struct@Hash] of the content data of this record.
+sourcepub fn content_hash(&self) -> Hash
Get the Hash of the content data of this record.
Trait Implementations§
source§impl Clone for SignedEntry
source§fn clone(&self) -> SignedEntry
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moresource§impl Debug for SignedEntry
source§impl Deref for SignedEntry
source§impl<'de> Deserialize<'de> for SignedEntry
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl From<SignedEntry> for Entry
source§fn from(value: SignedEntry) -> Self
Converts to this type from the input type.source§impl Ord for SignedEntry
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
diff --git a/pr/2595/docs/iroh_docs/sync/type.ContentStatusCallback.html b/pr/2595/docs/iroh_docs/sync/type.ContentStatusCallback.html
index 46d5a5a49c..84ffdbe8ee 100644
--- a/pr/2595/docs/iroh_docs/sync/type.ContentStatusCallback.html
+++ b/pr/2595/docs/iroh_docs/sync/type.ContentStatusCallback.html
@@ -1,2 +1,2 @@
-ContentStatusCallback in iroh_docs::sync - Rust Type Alias iroh_docs::sync::ContentStatusCallback
source · pub type ContentStatusCallback = Arc<dyn Fn(Hash) -> ContentStatus + Send + Sync + 'static>;
Expand description
Callback that may be set on a replica to determine the availability status for a content hash.
+ContentStatusCallback in iroh_docs::sync - Rust Type Alias iroh_docs::sync::ContentStatusCallback
source · pub type ContentStatusCallback = Arc<dyn Fn(Hash) -> ContentStatus + Send + Sync + 'static>;
Expand description
Callback that may be set on a replica to determine the availability status for a content hash.
Aliased Type§
struct ContentStatusCallback { /* private fields */ }
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_net/discovery/dns/index.html b/pr/2595/docs/iroh_net/discovery/dns/index.html
index 5a80538422..a752b49d78 100644
--- a/pr/2595/docs/iroh_net/discovery/dns/index.html
+++ b/pr/2595/docs/iroh_net/discovery/dns/index.html
@@ -1,2 +1,2 @@
-iroh_net::discovery::dns - Rust Expand description
DNS node discovery for iroh-net
+iroh_net::discovery::dns - Rust Expand description
DNS node discovery for iroh-net
Structs§
- DNS node discovery
Constants§
- The n0 testing DNS node origin, for production.
- The n0 testing DNS node origin, for testing.
- Testing DNS node origin, must run server from
crate::test_utils::DnsPkarrServer.
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_net/discovery/dns/struct.DnsDiscovery.html b/pr/2595/docs/iroh_net/discovery/dns/struct.DnsDiscovery.html
index 3e7d5d71cc..7628fb45a9 100644
--- a/pr/2595/docs/iroh_net/discovery/dns/struct.DnsDiscovery.html
+++ b/pr/2595/docs/iroh_net/discovery/dns/struct.DnsDiscovery.html
@@ -28,7 +28,7 @@ custom discovery mechanism.
For testing it is also possible to use the N0_DNS_NODE_ORIGIN_STAGING domain
with DnsDiscovery::new. This would then use a hosted discovery service again,
but for testing purposes.
-Trait Implementations§
Trait Implementations§
source§impl Debug for DnsDiscovery
source§impl Discovery for DnsDiscovery
source§fn resolve(
&self,
ep: Endpoint,
node_id: NodeId
diff --git a/pr/2595/docs/iroh_net/discovery/trait.Discovery.html b/pr/2595/docs/iroh_net/discovery/trait.Discovery.html
index a53a618708..d3832a56b5 100644
--- a/pr/2595/docs/iroh_net/discovery/trait.Discovery.html
+++ b/pr/2595/docs/iroh_net/discovery/trait.Discovery.html
@@ -29,4 +29,4 @@ These tasks will be run on the runtime of the Option<BoxStream<Result<DiscoveryItem>>>
Implementors§
source§impl Discovery for DnsDiscovery
source§impl Discovery for LocalSwarmDiscovery
source§impl Discovery for PkarrPublisher
source§impl Discovery for PkarrResolver
source§impl Discovery for ConcurrentDiscovery
\ No newline at end of file
+
Implementors§
source§impl Discovery for DnsDiscovery
source§impl Discovery for LocalSwarmDiscovery
source§impl Discovery for PkarrPublisher
source§impl Discovery for PkarrResolver
source§impl Discovery for ConcurrentDiscovery
\ No newline at end of file
diff --git a/pr/2595/docs/src/iroh_net/discovery/dns.rs.html b/pr/2595/docs/src/iroh_net/discovery/dns.rs.html
index dd1a279fb3..1d32545ed3 100644
--- a/pr/2595/docs/src/iroh_net/discovery/dns.rs.html
+++ b/pr/2595/docs/src/iroh_net/discovery/dns.rs.html
@@ -97,6 +97,10 @@
97
98
99
+100
+101
+102
+103
//! DNS node discovery for iroh-net
use anyhow::Result;
@@ -182,6 +186,10 @@
fn resolve(&self, ep: Endpoint, node_id: NodeId) -> Option<BoxStream<Result<DiscoveryItem>>> {
let resolver = ep.dns_resolver().clone();
let origin_domain = self.origin_domain.clone();
+ #[cfg(any(test, feature = "test-utils"))]
+ if origin_domain.contains(&TEST_DNS_NODE_ORIGIN.to_string()) {
+ panic!("wait. THIS IS ILLEGAL!");
+ }
let fut = async move {
let node_addr = resolver
.lookup_by_id_staggered(&node_id, &origin_domain, DNS_STAGGERING_MS)
diff --git a/pr/2595/docs/trait.impl/iroh_base/ticket/trait.Ticket.js b/pr/2595/docs/trait.impl/iroh_base/ticket/trait.Ticket.js
index 12fa1e3ee5..5d209fabd2 100644
--- a/pr/2595/docs/trait.impl/iroh_base/ticket/trait.Ticket.js
+++ b/pr/2595/docs/trait.impl/iroh_base/ticket/trait.Ticket.js
@@ -1,5 +1,5 @@
(function() {var implementors = {
"iroh":[],
"iroh_base":[],
-"iroh_docs":[["impl Ticket for DocTicket"]]
+"iroh_docs":[["impl Ticket for DocTicket"]]
};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
diff --git a/pr/2595/docs/type.impl/std/primitive.array.js b/pr/2595/docs/type.impl/std/primitive.array.js
index 588a8b53a3..3006964922 100644
--- a/pr/2595/docs/type.impl/std/primitive.array.js
+++ b/pr/2595/docs/type.impl/std/primitive.array.js
@@ -1,4 +1,4 @@
(function() {var type_impls = {
"iroh":[["source§impl<T, const N: usize> [T; N]
1.55.0 · sourcepub fn map<F, U>(self, f: F) -> [U; N]where\n F: FnMut(T) -> U,
Returns an array of the same size as self, with function f applied to each element\nin order.
\nIf you don’t necessarily need a new fixed-size array, consider using\nIterator::map instead.
\n§Note on performance and stack usage
\nUnfortunately, usages of this method are currently not always optimized\nas well as they could be. This mainly concerns large arrays, as mapping\nover small arrays seem to be optimized just fine. Also note that in\ndebug mode (i.e. without any optimizations), this method can use a lot\nof stack space (a few times the size of the array or more).
\nTherefore, in performance-critical code, try to avoid using this method\non large arrays or check the emitted code. Also try to avoid chained\nmaps (e.g. arr.map(...).map(...)).
\nIn many cases, you can instead use Iterator::map by calling .iter()\nor .into_iter() on your array. [T; N]::map is only necessary if you\nreally need a new array of the same size as the result. Rust’s lazy\niterators tend to get optimized very well.
\n§Examples
\nlet x = [1, 2, 3];\nlet y = x.map(|v| v + 1);\nassert_eq!(y, [2, 3, 4]);\n\nlet x = [1, 2, 3];\nlet mut temp = 0;\nlet y = x.map(|v| { temp += 1; v * temp });\nassert_eq!(y, [1, 4, 9]);\n\nlet x = [\"Ferris\", \"Bueller's\", \"Day\", \"Off\"];\nlet y = x.map(|v| v.len());\nassert_eq!(y, [6, 9, 3, 3]);
\nsourcepub fn try_map<F, R>(\n self,\n f: F\n) -> <<R as Try>::Residual as Residual<[<R as Try>::Output; N]>>::TryType
🔬This is a nightly-only experimental API. (array_try_map)
A fallible function f applied to each element on array self in order to\nreturn an array the same size as self or the first error encountered.
\nThe return type of this function depends on the return type of the closure.\nIf you return Result<T, E> from the closure, you’ll get a Result<[T; N], E>.\nIf you return Option<T> from the closure, you’ll get an Option<[T; N]>.
\n§Examples
\n#![feature(array_try_map)]\n\nlet a = [\"1\", \"2\", \"3\"];\nlet b = a.try_map(|v| v.parse::<u32>()).unwrap().map(|v| v + 1);\nassert_eq!(b, [2, 3, 4]);\n\nlet a = [\"1\", \"2a\", \"3\"];\nlet b = a.try_map(|v| v.parse::<u32>());\nassert!(b.is_err());\n\nuse std::num::NonZero;\n\nlet z = [1, 2, 0, 3, 4];\nassert_eq!(z.try_map(NonZero::new), None);\n\nlet a = [1, 2, 3];\nlet b = a.try_map(NonZero::new);\nlet c = b.map(|x| x.map(NonZero::get));\nassert_eq!(c, Some(a));
\n1.57.0 (const: 1.57.0) · sourcepub const fn as_slice(&self) -> &[T]
Returns a slice containing the entire array. Equivalent to &s[..].
\n1.57.0 · sourcepub fn as_mut_slice(&mut self) -> &mut [T]
Returns a mutable slice containing the entire array. Equivalent to\n&mut s[..].
\n1.77.0 · sourcepub fn each_ref(&self) -> [&T; N]
Borrows each element and returns an array of references with the same\nsize as self.
\n§Example
\nlet floats = [3.1, 2.7, -1.0];\nlet float_refs: [&f64; 3] = floats.each_ref();\nassert_eq!(float_refs, [&3.1, &2.7, &-1.0]);
\nThis method is particularly useful if combined with other methods, like\nmap. This way, you can avoid moving the original\narray if its elements are not Copy.
\n\nlet strings = [\"Ferris\".to_string(), \"♥\".to_string(), \"Rust\".to_string()];\nlet is_ascii = strings.each_ref().map(|s| s.is_ascii());\nassert_eq!(is_ascii, [true, false, true]);\n\n// We can still access the original array: it has not been moved.\nassert_eq!(strings.len(), 3);
\n1.77.0 · sourcepub fn each_mut(&mut self) -> [&mut T; N]
Borrows each element mutably and returns an array of mutable references\nwith the same size as self.
\n§Example
\n\nlet mut floats = [3.1, 2.7, -1.0];\nlet float_refs: [&mut f64; 3] = floats.each_mut();\n*float_refs[0] = 0.0;\nassert_eq!(float_refs, [&mut 0.0, &mut 2.7, &mut -1.0]);\nassert_eq!(floats, [0.0, 2.7, -1.0]);
\nsourcepub fn split_array_ref<const M: usize>(&self) -> (&[T; M], &[T])
🔬This is a nightly-only experimental API. (split_array)
Divides one array reference into two at an index.
\nThe first will contain all indices from [0, M) (excluding\nthe index M itself) and the second will contain all\nindices from [M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet v = [1, 2, 3, 4, 5, 6];\n\n{\n let (left, right) = v.split_array_ref::<0>();\n assert_eq!(left, &[]);\n assert_eq!(right, &[1, 2, 3, 4, 5, 6]);\n}\n\n{\n let (left, right) = v.split_array_ref::<2>();\n assert_eq!(left, &[1, 2]);\n assert_eq!(right, &[3, 4, 5, 6]);\n}\n\n{\n let (left, right) = v.split_array_ref::<6>();\n assert_eq!(left, &[1, 2, 3, 4, 5, 6]);\n assert_eq!(right, &[]);\n}
\nsourcepub fn split_array_mut<const M: usize>(&mut self) -> (&mut [T; M], &mut [T])
🔬This is a nightly-only experimental API. (split_array)
Divides one mutable array reference into two at an index.
\nThe first will contain all indices from [0, M) (excluding\nthe index M itself) and the second will contain all\nindices from [M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet mut v = [1, 0, 3, 0, 5, 6];\nlet (left, right) = v.split_array_mut::<2>();\nassert_eq!(left, &mut [1, 0][..]);\nassert_eq!(right, &mut [3, 0, 5, 6]);\nleft[1] = 2;\nright[1] = 4;\nassert_eq!(v, [1, 2, 3, 4, 5, 6]);
\nsourcepub fn rsplit_array_ref<const M: usize>(&self) -> (&[T], &[T; M])
🔬This is a nightly-only experimental API. (split_array)
Divides one array reference into two at an index from the end.
\nThe first will contain all indices from [0, N - M) (excluding\nthe index N - M itself) and the second will contain all\nindices from [N - M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet v = [1, 2, 3, 4, 5, 6];\n\n{\n let (left, right) = v.rsplit_array_ref::<0>();\n assert_eq!(left, &[1, 2, 3, 4, 5, 6]);\n assert_eq!(right, &[]);\n}\n\n{\n let (left, right) = v.rsplit_array_ref::<2>();\n assert_eq!(left, &[1, 2, 3, 4]);\n assert_eq!(right, &[5, 6]);\n}\n\n{\n let (left, right) = v.rsplit_array_ref::<6>();\n assert_eq!(left, &[]);\n assert_eq!(right, &[1, 2, 3, 4, 5, 6]);\n}
\nsourcepub fn rsplit_array_mut<const M: usize>(&mut self) -> (&mut [T], &mut [T; M])
🔬This is a nightly-only experimental API. (split_array)
Divides one mutable array reference into two at an index from the end.
\nThe first will contain all indices from [0, N - M) (excluding\nthe index N - M itself) and the second will contain all\nindices from [N - M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet mut v = [1, 0, 3, 0, 5, 6];\nlet (left, right) = v.rsplit_array_mut::<4>();\nassert_eq!(left, &mut [1, 0]);\nassert_eq!(right, &mut [3, 0, 5, 6][..]);\nleft[1] = 2;\nright[1] = 4;\nassert_eq!(v, [1, 2, 3, 4, 5, 6]);
\n",0,"iroh::docs::PeerIdBytes"],["source§impl<const N: usize> [u8; N]
sourcepub const fn as_ascii(&self) -> Option<&[AsciiChar; N]>
🔬This is a nightly-only experimental API. (ascii_char)
Converts this array of bytes into a array of ASCII characters,\nor returns None if any of the characters is non-ASCII.
\n§Examples
\n#![feature(ascii_char)]\n#![feature(const_option)]\n\nconst HEX_DIGITS: [std::ascii::Char; 16] =\n *b\"0123456789abcdef\".as_ascii().unwrap();\n\nassert_eq!(HEX_DIGITS[1].as_str(), \"1\");\nassert_eq!(HEX_DIGITS[10].as_str(), \"a\");
\nsourcepub const unsafe fn as_ascii_unchecked(&self) -> &[AsciiChar; N]
🔬This is a nightly-only experimental API. (ascii_char)
Converts this array of bytes into a array of ASCII characters,\nwithout checking whether they’re valid.
\n§Safety
\nEvery byte in the array must be in 0..=127, or else this is UB.
\n",0,"iroh::docs::PeerIdBytes"],["§impl<T> Array for [T; 32]where\n T: Default,
§fn as_slice_mut(&mut self) -> &mut [T]
Gives a unique slice over the whole thing. Read more","Array","iroh::docs::PeerIdBytes"],["","Array","iroh::docs::PeerIdBytes"],["§impl<const N: usize, T> AsBytes for [T; N]where\n T: AsBytes,
§fn write_to_prefix(&self, bytes: &mut [u8]) -> Option<()>
","AsBytes","iroh::docs::PeerIdBytes"],["","AsBytes","iroh::docs::PeerIdBytes"],["","AsMut<[T]>","iroh::docs::PeerIdBytes"],["","AsRef<[T]>","iroh::docs::PeerIdBytes"],["§impl<T, const N: usize> BitView for [T; N]where\n T: BitStore,
Note that overly-large arrays may cause the conversions to fail.
\n§fn view_bits<O>(&self) -> &BitSlice<T, O>where\n O: BitOrder,
Views a memory region as an immutable bit-slice.§fn try_view_bits<O>(&self) -> Result<&BitSlice<T, O>, BitSpanError<T>>where\n O: BitOrder,
Attempts to view a memory region as an immutable bit-slice. Read more§fn view_bits_mut<O>(&mut self) -> &mut BitSlice<T, O>where\n O: BitOrder,
Views a memory region as a mutable bit-slice.§fn try_view_bits_mut<O>(\n &mut self\n) -> Result<&mut BitSlice<T, O>, BitSpanError<T>>where\n O: BitOrder,
Attempts to view a memory region as a mutable bit-slice. Read more","BitView","iroh::docs::PeerIdBytes"],["§impl<T, const N: usize> BitViewSized for [T; N]where\n T: BitStore,
§fn as_raw_slice(&self) -> &[<[T; N] as BitView>::Store]
Views the type as a slice of its elements.§fn as_raw_mut_slice(&mut self) -> &mut [<[T; N] as BitView>::Store]
Views the type as a mutable slice of its elements.§fn into_bitarray<O>(self) -> BitArray<Self, O>where\n O: BitOrder,
Wraps self in a BitArray.","BitViewSized","iroh::docs::PeerIdBytes"],["","Borrow<[T]>","iroh::docs::PeerIdBytes"],["1.4.0 · source§impl<T, const N: usize> BorrowMut<[T]> for [T; N]
source§fn borrow_mut(&mut self) -> &mut [T]
Mutably borrows from an owned value. Read more","BorrowMut<[T]>","iroh::docs::PeerIdBytes"],["","Chain","iroh::docs::PeerIdBytes"],["","Clone","iroh::docs::PeerIdBytes"],["","Debug","iroh::docs::PeerIdBytes"],["§impl<const N: usize> Decode for [u8; N]
Decodes a byte array from byte[n] as described in RFC4251 § 5:
\n\nA byte represents an arbitrary 8-bit value (octet). Fixed length\ndata is sometimes represented as an array of bytes, written\nbyte[n], where n is the number of bytes in the array.
\n
\n","Decode","iroh::docs::PeerIdBytes"],["§impl<'a, T, const N: usize> DecodeValue<'a> for [T; N]where\n T: Decode<'a>,
§fn decode_value<R>(reader: &mut R, header: Header) -> Result<[T; N], Error>where\n R: Reader<'a>,
Attempt to decode this message using the provided [Reader].","DecodeValue<'a>","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["source§impl<'de, T> Deserialize<'de> for [T; 32]where\n T: Deserialize<'de>,
source§fn deserialize<D>(\n deserializer: D\n) -> Result<[T; 32], <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more","Deserialize<'de>","iroh::docs::PeerIdBytes"],["source§impl<'de, const N: usize> Deserialize<'de> for [u8; N]
source§fn deserialize<D>(\n deserializer: D\n) -> Result<[u8; N], <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
","Deserialize<'de>","iroh::docs::PeerIdBytes"],["§impl<const N: usize> Encode for [u8; N]
Encodes [u8; N] into byte[n] as described in RFC4251 § 5:
\n\nA byte represents an arbitrary 8-bit value (octet). Fixed length\ndata is sometimes represented as an array of bytes, written\nbyte[n], where n is the number of bytes in the array.
\n
\n§fn encoded_len(&self) -> Result<usize, Error>
Get the length of this type encoded in bytes, prior to Base64 encoding.§fn encode(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value using the provided [Writer].§fn encoded_len_prefixed(&self) -> Result<usize, Error>
Return the length of this type after encoding when prepended with a\nuint32 length prefix.§fn encode_prefixed(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value, first prepending a uint32 length prefix\nset to [Encode::encoded_len].","Encode","iroh::docs::PeerIdBytes"],["","EncodeLabelSet","iroh::docs::PeerIdBytes"],["§impl<T, const N: usize> EncodeValue for [T; N]where\n T: Encode,
","EncodeValue","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["§impl<'a> FindToken<&'a u8> for [u8; 32]
§fn find_token(&self, token: &u8) -> bool
Returns true if self contains the token","FindToken<&'a u8>","iroh::docs::PeerIdBytes"],["§impl FindToken<u8> for [u8; 32]
§fn find_token(&self, token: u8) -> bool
Returns true if self contains the token","FindToken","iroh::docs::PeerIdBytes"],["","FixedTag","iroh::docs::PeerIdBytes"],["","From<&Signature>","iroh::docs::PeerIdBytes"],["","From","iroh::docs::PeerIdBytes"],["§impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>>> for [T; 32]
","From, B0>, B0>, B0>, B0>, B0>>>","iroh::docs::PeerIdBytes"],["","From","iroh::docs::PeerIdBytes"],["","From","iroh::docs::PeerIdBytes"],["","From>","iroh::docs::PeerIdBytes"],["","From","iroh::docs::PeerIdBytes"],["","From","iroh::docs::PeerIdBytes"],["","From","iroh::docs::PeerIdBytes"],["","From>","iroh::docs::PeerIdBytes"],["§impl<const N: usize, T> FromBytes for [T; N]where\n T: FromBytes,
§fn slice_from_prefix(bytes: &[u8], count: usize) -> Option<(&[Self], &[u8])>where\n Self: Sized,
Interprets the prefix of the given bytes as a &[Self] with length\nequal to count without copying. Read more§fn slice_from_suffix(bytes: &[u8], count: usize) -> Option<(&[u8], &[Self])>where\n Self: Sized,
Interprets the suffix of the given bytes as a &[Self] with length\nequal to count without copying. Read more§fn read_from_prefix(bytes: &[u8]) -> Option<Self>where\n Self: Sized,
","FromBytes","iroh::docs::PeerIdBytes"],["","FromHex","iroh::docs::PeerIdBytes"],["","FromZeroes","iroh::docs::PeerIdBytes"],["","Hash","iroh::docs::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Hash for [T; N]where\n T: Hash,
The hash of an array is the same as that of the corresponding slice,\nas required by the Borrow implementation.
\n\nuse std::hash::BuildHasher;\n\nlet b = std::hash::RandomState::new();\nlet a: [u8; 3] = [0xa8, 0x3c, 0x09];\nlet s: &[u8] = &[0xa8, 0x3c, 0x09];\nassert_eq!(b.hash_one(a), b.hash_one(s));
\n","Hash","iroh::docs::PeerIdBytes"],["","Index","iroh::docs::PeerIdBytes"],["","IndexMut","iroh::docs::PeerIdBytes"],["","InputLength","iroh::docs::PeerIdBytes"],["1.53.0 · source§impl<T, const N: usize> IntoIterator for [T; N]
source§fn into_iter(self) -> <[T; N] as IntoIterator>::IntoIter
Creates a consuming iterator, that is, one that moves each value out of\nthe array (from start to end). The array cannot be used after calling\nthis unless T implements Copy, so the whole array is copied.
\nArrays have special behavior when calling .into_iter() prior to the\n2021 edition – see the array Editions section for more information.
\n","IntoIterator","iroh::docs::PeerIdBytes"],["§impl<const N: usize> IntoResponse for [u8; N]
§fn into_response(self) -> Response<Body>
Create a response.","IntoResponse","iroh::docs::PeerIdBytes"],["§impl<Fut, const N: usize> Join for [Fut; N]where\n Fut: IntoFuture,
§type Output = [<Fut as IntoFuture>::Output; N]
The resulting output type.§type Future = Join<<Fut as IntoFuture>::IntoFuture, N>
The Future implementation returned by this method.","Join","iroh::docs::PeerIdBytes"],["","Key","iroh::docs::PeerIdBytes"],["§impl<T, const N: usize> MaxSize for [T; N]where\n T: MaxSize,
§const POSTCARD_MAX_SIZE: usize = _
The maximum possible size that the serialization of this\ntype can have, in bytes.","MaxSize","iroh::docs::PeerIdBytes"],["","Merge","iroh::docs::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Ord for [T; N]where\n T: Ord,
Implements comparison of arrays lexicographically.
\n1.21.0 · source§fn max(self, other: Self) -> Selfwhere\n Self: Sized,
Compares and returns the maximum of two values. Read more","Ord","iroh::docs::PeerIdBytes"],["","PartialEq<&[U]>","iroh::docs::PeerIdBytes"],["1.0.0 · source§impl<T, U, const N: usize> PartialEq<&mut [U]> for [T; N]where\n T: PartialEq<U>,
","PartialEq<&mut [U]>","iroh::docs::PeerIdBytes"],["","PartialEq<[U]>","iroh::docs::PeerIdBytes"],["","PartialEq<[U; N]>","iroh::docs::PeerIdBytes"],["","PartialEq","iroh::docs::PeerIdBytes"],["§impl<A, B, const N: usize, const M: usize> PartialEq<Vec<A, N>> for [B; M]where\n A: PartialEq<B>,
","PartialEq>","iroh::docs::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> PartialOrd for [T; N]where\n T: PartialOrd,
Implements comparison of arrays lexicographically.
\nsource§fn le(&self, other: &[T; N]) -> bool
This method tests less than or equal to (for self and other) and is used by the <=\noperator. Read more","PartialOrd","iroh::docs::PeerIdBytes"],["§impl<Fut, const N: usize> Race for [Fut; N]where\n Fut: IntoFuture,
§type Output = <Fut as IntoFuture>::Output
The resulting output type.§type Future = Race<<Fut as IntoFuture>::IntoFuture, N>
Which kind of future are we turning this into?","Race","iroh::docs::PeerIdBytes"],["§impl<Fut, T, E, const N: usize> RaceOk for [Fut; N]where\n Fut: IntoFuture<Output = Result<T, E>>,
§type Future = RaceOk<<Fut as IntoFuture>::IntoFuture, T, E, N>
Which kind of future are we turning this into?","RaceOk","iroh::docs::PeerIdBytes"],["","Schema","iroh::docs::PeerIdBytes"],["source§impl<T> Serialize for [T; 32]where\n T: 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","iroh::docs::PeerIdBytes"],["source§impl<const N: usize> Serialize for [u8; N]
source§fn serialize<S>(\n &self,\n serializer: S\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where\n S: Serializer,
","Serialize","iroh::docs::PeerIdBytes"],["1.51.0 · source§impl<T, const N: usize> SlicePattern for [T; N]
","SlicePattern","iroh::docs::PeerIdBytes"],["1.34.0 · source§impl<T, const N: usize> TryFrom<&[T]> for [T; N]where\n T: Copy,
Tries to create an array [T; N] by copying from a slice &[T]. Succeeds if\nslice.len() == N.
\n\nlet bytes: [u8; 3] = [1, 0, 2];\n\nlet bytes_head: [u8; 2] = <[u8; 2]>::try_from(&bytes[0..2]).unwrap();\nassert_eq!(1, u16::from_le_bytes(bytes_head));\n\nlet bytes_tail: [u8; 2] = bytes[1..3].try_into().unwrap();\nassert_eq!(512, u16::from_le_bytes(bytes_tail));
\n§type Error = TryFromSliceError
The type returned in the event of a conversion error.","TryFrom<&[T]>","iroh::docs::PeerIdBytes"],["1.59.0 · source§impl<T, const N: usize> TryFrom<&mut [T]> for [T; N]where\n T: Copy,
Tries to create an array [T; N] by copying from a mutable slice &mut [T].\nSucceeds if slice.len() == N.
\n\nlet mut bytes: [u8; 3] = [1, 0, 2];\n\nlet bytes_head: [u8; 2] = <[u8; 2]>::try_from(&mut bytes[0..2]).unwrap();\nassert_eq!(1, u16::from_le_bytes(bytes_head));\n\nlet bytes_tail: [u8; 2] = (&mut bytes[1..3]).try_into().unwrap();\nassert_eq!(512, u16::from_le_bytes(bytes_tail));
\n§type Error = TryFromSliceError
The type returned in the event of a conversion error.","TryFrom<&mut [T]>","iroh::docs::PeerIdBytes"],["§impl<T, A, const N: usize> TryFrom<Vec<T, A>> for [T; N]where\n A: Allocator,
§fn try_from(vec: Vec<T, A>) -> Result<[T; N], Vec<T, A>>
Gets the entire contents of the Vec<T> as an array,\nif its size exactly matches that of the requested array.
\n§Examples
\nassert_eq!(vec![1, 2, 3].try_into(), Ok([1, 2, 3]));\nassert_eq!(<Vec<i32>>::new().try_into(), Ok([]));
\nIf the length doesn’t match, the input comes back in Err:
\n\nlet r: Result<[i32; 4], _> = (0..10).collect::<Vec<_>>().try_into();\nassert_eq!(r, Err(vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9]));
\nIf you’re fine with just getting a prefix of the Vec<T>,\nyou can call .truncate(N) first.
\n\nlet mut v = String::from(\"hello world\").into_bytes();\nv.sort();\nv.truncate(2);\nlet [a, b]: [_; 2] = v.try_into().unwrap();\nassert_eq!(a, b' ');\nassert_eq!(b, b'd');
\n","TryFrom>","iroh::docs::PeerIdBytes"],["1.48.0 · source§impl<T, A, const N: usize> TryFrom<Vec<T, A>> for [T; N]where\n A: Allocator,
source§fn try_from(vec: Vec<T, A>) -> Result<[T; N], Vec<T, A>>
Gets the entire contents of the Vec<T> as an array,\nif its size exactly matches that of the requested array.
\n§Examples
\nassert_eq!(vec![1, 2, 3].try_into(), Ok([1, 2, 3]));\nassert_eq!(<Vec<i32>>::new().try_into(), Ok([]));
\nIf the length doesn’t match, the input comes back in Err:
\n\nlet r: Result<[i32; 4], _> = (0..10).collect::<Vec<_>>().try_into();\nassert_eq!(r, Err(vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9]));
\nIf you’re fine with just getting a prefix of the Vec<T>,\nyou can call .truncate(N) first.
\n\nlet mut v = String::from(\"hello world\").into_bytes();\nv.sort();\nv.truncate(2);\nlet [a, b]: [_; 2] = v.try_into().unwrap();\nassert_eq!(a, b' ');\nassert_eq!(b, b'd');
\n","TryFrom>","iroh::docs::PeerIdBytes"],["§impl<Fut, T, E, const N: usize> TryJoin for [Fut; N]where\n Fut: IntoFuture<Output = Result<T, E>>,
§type Future = TryJoin<<Fut as IntoFuture>::IntoFuture, T, E, N>
Which kind of future are we turning this into?","TryJoin","iroh::docs::PeerIdBytes"],["§impl<const N: usize, T> Value for [T; N]where\n T: Value,
§type SelfType<'a> = [<T as Value>::SelfType<'a>; N]\nwhere\n [T; N]: 'a
SelfType<’a> must be the same type as Self with all lifetimes replaced with ’a§type AsBytes<'a> = Vec<u8>\nwhere\n [T; N]: 'a
§fn fixed_width() -> Option<usize>
Width of a fixed type, or None for variable width§fn from_bytes<'a>(data: &'a [u8]) -> [<T as Value>::SelfType<'a>; N]where\n [T; N]: 'a,
Deserializes data\nImplementations may return a view over data, or an owned type","Value","iroh::docs::PeerIdBytes"],["","ValueOrd","iroh::docs::PeerIdBytes"],["§impl<Z, const N: usize> Zeroize for [Z; N]where\n Z: Zeroize,
Impl [Zeroize] on arrays of types that impl [Zeroize].
\n","Zeroize","iroh::docs::PeerIdBytes"],["","Zip","iroh::docs::PeerIdBytes"],["source§impl<T, const N: usize> ConstParamTy for [T; N]where\n T: ConstParamTy,
","ConstParamTy","iroh::docs::PeerIdBytes"],["1.58.0 · source§impl<T, const N: usize> Copy for [T; N]where\n T: Copy,
","Copy","iroh::docs::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Eq for [T; N]where\n T: Eq,
","Eq","iroh::docs::PeerIdBytes"],["source§impl<T, const N: usize> StructuralPartialEq for [T; N]
","StructuralPartialEq","iroh::docs::PeerIdBytes"],["§impl<const N: usize, T> Unaligned for [T; N]where\n T: Unaligned,
","Unaligned","iroh::docs::PeerIdBytes"],["§impl<Z, const N: usize> ZeroizeOnDrop for [Z; N]where\n Z: ZeroizeOnDrop,
Impl [ZeroizeOnDrop] on arrays of types that impl [ZeroizeOnDrop].
\n","ZeroizeOnDrop","iroh::docs::PeerIdBytes"]],
-"iroh_docs":[["source§impl<T, const N: usize> [T; N]
1.55.0 · sourcepub fn map<F, U>(self, f: F) -> [U; N]where\n F: FnMut(T) -> U,
Returns an array of the same size as self, with function f applied to each element\nin order.
\nIf you don’t necessarily need a new fixed-size array, consider using\nIterator::map instead.
\n§Note on performance and stack usage
\nUnfortunately, usages of this method are currently not always optimized\nas well as they could be. This mainly concerns large arrays, as mapping\nover small arrays seem to be optimized just fine. Also note that in\ndebug mode (i.e. without any optimizations), this method can use a lot\nof stack space (a few times the size of the array or more).
\nTherefore, in performance-critical code, try to avoid using this method\non large arrays or check the emitted code. Also try to avoid chained\nmaps (e.g. arr.map(...).map(...)).
\nIn many cases, you can instead use Iterator::map by calling .iter()\nor .into_iter() on your array. [T; N]::map is only necessary if you\nreally need a new array of the same size as the result. Rust’s lazy\niterators tend to get optimized very well.
\n§Examples
\nlet x = [1, 2, 3];\nlet y = x.map(|v| v + 1);\nassert_eq!(y, [2, 3, 4]);\n\nlet x = [1, 2, 3];\nlet mut temp = 0;\nlet y = x.map(|v| { temp += 1; v * temp });\nassert_eq!(y, [1, 4, 9]);\n\nlet x = [\"Ferris\", \"Bueller's\", \"Day\", \"Off\"];\nlet y = x.map(|v| v.len());\nassert_eq!(y, [6, 9, 3, 3]);
\nsourcepub fn try_map<F, R>(\n self,\n f: F\n) -> <<R as Try>::Residual as Residual<[<R as Try>::Output; N]>>::TryType
🔬This is a nightly-only experimental API. (array_try_map)
A fallible function f applied to each element on array self in order to\nreturn an array the same size as self or the first error encountered.
\nThe return type of this function depends on the return type of the closure.\nIf you return Result<T, E> from the closure, you’ll get a Result<[T; N], E>.\nIf you return Option<T> from the closure, you’ll get an Option<[T; N]>.
\n§Examples
\n#![feature(array_try_map)]\n\nlet a = [\"1\", \"2\", \"3\"];\nlet b = a.try_map(|v| v.parse::<u32>()).unwrap().map(|v| v + 1);\nassert_eq!(b, [2, 3, 4]);\n\nlet a = [\"1\", \"2a\", \"3\"];\nlet b = a.try_map(|v| v.parse::<u32>());\nassert!(b.is_err());\n\nuse std::num::NonZero;\n\nlet z = [1, 2, 0, 3, 4];\nassert_eq!(z.try_map(NonZero::new), None);\n\nlet a = [1, 2, 3];\nlet b = a.try_map(NonZero::new);\nlet c = b.map(|x| x.map(NonZero::get));\nassert_eq!(c, Some(a));
\n1.57.0 (const: 1.57.0) · sourcepub const fn as_slice(&self) -> &[T]
Returns a slice containing the entire array. Equivalent to &s[..].
\n1.57.0 · sourcepub fn as_mut_slice(&mut self) -> &mut [T]
Returns a mutable slice containing the entire array. Equivalent to\n&mut s[..].
\n1.77.0 · sourcepub fn each_ref(&self) -> [&T; N]
Borrows each element and returns an array of references with the same\nsize as self.
\n§Example
\nlet floats = [3.1, 2.7, -1.0];\nlet float_refs: [&f64; 3] = floats.each_ref();\nassert_eq!(float_refs, [&3.1, &2.7, &-1.0]);
\nThis method is particularly useful if combined with other methods, like\nmap. This way, you can avoid moving the original\narray if its elements are not Copy.
\n\nlet strings = [\"Ferris\".to_string(), \"♥\".to_string(), \"Rust\".to_string()];\nlet is_ascii = strings.each_ref().map(|s| s.is_ascii());\nassert_eq!(is_ascii, [true, false, true]);\n\n// We can still access the original array: it has not been moved.\nassert_eq!(strings.len(), 3);
\n1.77.0 · sourcepub fn each_mut(&mut self) -> [&mut T; N]
Borrows each element mutably and returns an array of mutable references\nwith the same size as self.
\n§Example
\n\nlet mut floats = [3.1, 2.7, -1.0];\nlet float_refs: [&mut f64; 3] = floats.each_mut();\n*float_refs[0] = 0.0;\nassert_eq!(float_refs, [&mut 0.0, &mut 2.7, &mut -1.0]);\nassert_eq!(floats, [0.0, 2.7, -1.0]);
\nsourcepub fn split_array_ref<const M: usize>(&self) -> (&[T; M], &[T])
🔬This is a nightly-only experimental API. (split_array)
Divides one array reference into two at an index.
\nThe first will contain all indices from [0, M) (excluding\nthe index M itself) and the second will contain all\nindices from [M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet v = [1, 2, 3, 4, 5, 6];\n\n{\n let (left, right) = v.split_array_ref::<0>();\n assert_eq!(left, &[]);\n assert_eq!(right, &[1, 2, 3, 4, 5, 6]);\n}\n\n{\n let (left, right) = v.split_array_ref::<2>();\n assert_eq!(left, &[1, 2]);\n assert_eq!(right, &[3, 4, 5, 6]);\n}\n\n{\n let (left, right) = v.split_array_ref::<6>();\n assert_eq!(left, &[1, 2, 3, 4, 5, 6]);\n assert_eq!(right, &[]);\n}
\nsourcepub fn split_array_mut<const M: usize>(&mut self) -> (&mut [T; M], &mut [T])
🔬This is a nightly-only experimental API. (split_array)
Divides one mutable array reference into two at an index.
\nThe first will contain all indices from [0, M) (excluding\nthe index M itself) and the second will contain all\nindices from [M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet mut v = [1, 0, 3, 0, 5, 6];\nlet (left, right) = v.split_array_mut::<2>();\nassert_eq!(left, &mut [1, 0][..]);\nassert_eq!(right, &mut [3, 0, 5, 6]);\nleft[1] = 2;\nright[1] = 4;\nassert_eq!(v, [1, 2, 3, 4, 5, 6]);
\nsourcepub fn rsplit_array_ref<const M: usize>(&self) -> (&[T], &[T; M])
🔬This is a nightly-only experimental API. (split_array)
Divides one array reference into two at an index from the end.
\nThe first will contain all indices from [0, N - M) (excluding\nthe index N - M itself) and the second will contain all\nindices from [N - M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet v = [1, 2, 3, 4, 5, 6];\n\n{\n let (left, right) = v.rsplit_array_ref::<0>();\n assert_eq!(left, &[1, 2, 3, 4, 5, 6]);\n assert_eq!(right, &[]);\n}\n\n{\n let (left, right) = v.rsplit_array_ref::<2>();\n assert_eq!(left, &[1, 2, 3, 4]);\n assert_eq!(right, &[5, 6]);\n}\n\n{\n let (left, right) = v.rsplit_array_ref::<6>();\n assert_eq!(left, &[]);\n assert_eq!(right, &[1, 2, 3, 4, 5, 6]);\n}
\nsourcepub fn rsplit_array_mut<const M: usize>(&mut self) -> (&mut [T], &mut [T; M])
🔬This is a nightly-only experimental API. (split_array)
Divides one mutable array reference into two at an index from the end.
\nThe first will contain all indices from [0, N - M) (excluding\nthe index N - M itself) and the second will contain all\nindices from [N - M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet mut v = [1, 0, 3, 0, 5, 6];\nlet (left, right) = v.rsplit_array_mut::<4>();\nassert_eq!(left, &mut [1, 0]);\nassert_eq!(right, &mut [3, 0, 5, 6][..]);\nleft[1] = 2;\nright[1] = 4;\nassert_eq!(v, [1, 2, 3, 4, 5, 6]);
\n",0,"iroh_docs::sync::PeerIdBytes"],["source§impl<const N: usize> [u8; N]
sourcepub const fn as_ascii(&self) -> Option<&[AsciiChar; N]>
🔬This is a nightly-only experimental API. (ascii_char)
Converts this array of bytes into a array of ASCII characters,\nor returns None if any of the characters is non-ASCII.
\n§Examples
\n#![feature(ascii_char)]\n#![feature(const_option)]\n\nconst HEX_DIGITS: [std::ascii::Char; 16] =\n *b\"0123456789abcdef\".as_ascii().unwrap();\n\nassert_eq!(HEX_DIGITS[1].as_str(), \"1\");\nassert_eq!(HEX_DIGITS[10].as_str(), \"a\");
\nsourcepub const unsafe fn as_ascii_unchecked(&self) -> &[AsciiChar; N]
🔬This is a nightly-only experimental API. (ascii_char)
Converts this array of bytes into a array of ASCII characters,\nwithout checking whether they’re valid.
\n§Safety
\nEvery byte in the array must be in 0..=127, or else this is UB.
\n",0,"iroh_docs::sync::PeerIdBytes"],["§impl<T> Array for [T; 32]where\n T: Default,
§fn as_slice_mut(&mut self) -> &mut [T]
Gives a unique slice over the whole thing. Read more","Array","iroh_docs::sync::PeerIdBytes"],["","Array","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> AsBytes for [T; N]where\n T: AsBytes,
§fn write_to_prefix(&self, bytes: &mut [u8]) -> Option<()>
","AsBytes","iroh_docs::sync::PeerIdBytes"],["","AsBytes","iroh_docs::sync::PeerIdBytes"],["","AsMut<[T]>","iroh_docs::sync::PeerIdBytes"],["","AsRef<[T]>","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> BitView for [T; N]where\n T: BitStore,
Note that overly-large arrays may cause the conversions to fail.
\n§fn view_bits<O>(&self) -> &BitSlice<T, O>where\n O: BitOrder,
Views a memory region as an immutable bit-slice.§fn try_view_bits<O>(&self) -> Result<&BitSlice<T, O>, BitSpanError<T>>where\n O: BitOrder,
Attempts to view a memory region as an immutable bit-slice. Read more§fn view_bits_mut<O>(&mut self) -> &mut BitSlice<T, O>where\n O: BitOrder,
Views a memory region as a mutable bit-slice.§fn try_view_bits_mut<O>(\n &mut self\n) -> Result<&mut BitSlice<T, O>, BitSpanError<T>>where\n O: BitOrder,
Attempts to view a memory region as a mutable bit-slice. Read more","BitView","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> BitViewSized for [T; N]where\n T: BitStore,
§fn as_raw_slice(&self) -> &[<[T; N] as BitView>::Store]
Views the type as a slice of its elements.§fn as_raw_mut_slice(&mut self) -> &mut [<[T; N] as BitView>::Store]
Views the type as a mutable slice of its elements.§fn into_bitarray<O>(self) -> BitArray<Self, O>where\n O: BitOrder,
Wraps self in a BitArray.","BitViewSized","iroh_docs::sync::PeerIdBytes"],["","Borrow<[T]>","iroh_docs::sync::PeerIdBytes"],["1.4.0 · source§impl<T, const N: usize> BorrowMut<[T]> for [T; N]
source§fn borrow_mut(&mut self) -> &mut [T]
Mutably borrows from an owned value. Read more","BorrowMut<[T]>","iroh_docs::sync::PeerIdBytes"],["","Chain","iroh_docs::sync::PeerIdBytes"],["","Clone","iroh_docs::sync::PeerIdBytes"],["","Debug","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize> Decode for [u8; N]
Decodes a byte array from byte[n] as described in RFC4251 § 5:
\n\nA byte represents an arbitrary 8-bit value (octet). Fixed length\ndata is sometimes represented as an array of bytes, written\nbyte[n], where n is the number of bytes in the array.
\n
\n","Decode","iroh_docs::sync::PeerIdBytes"],["§impl<'a, T, const N: usize> DecodeValue<'a> for [T; N]where\n T: Decode<'a>,
§fn decode_value<R>(reader: &mut R, header: Header) -> Result<[T; N], Error>where\n R: Reader<'a>,
Attempt to decode this message using the provided [Reader].","DecodeValue<'a>","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["source§impl<'de, T> Deserialize<'de> for [T; 32]where\n T: Deserialize<'de>,
source§fn deserialize<D>(\n deserializer: D\n) -> Result<[T; 32], <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more","Deserialize<'de>","iroh_docs::sync::PeerIdBytes"],["source§impl<'de, const N: usize> Deserialize<'de> for [u8; N]
source§fn deserialize<D>(\n deserializer: D\n) -> Result<[u8; N], <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
","Deserialize<'de>","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize> Encode for [u8; N]
Encodes [u8; N] into byte[n] as described in RFC4251 § 5:
\n\nA byte represents an arbitrary 8-bit value (octet). Fixed length\ndata is sometimes represented as an array of bytes, written\nbyte[n], where n is the number of bytes in the array.
\n
\n§fn encoded_len(&self) -> Result<usize, Error>
Get the length of this type encoded in bytes, prior to Base64 encoding.§fn encode(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value using the provided [Writer].§fn encoded_len_prefixed(&self) -> Result<usize, Error>
Return the length of this type after encoding when prepended with a\nuint32 length prefix.§fn encode_prefixed(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value, first prepending a uint32 length prefix\nset to [Encode::encoded_len].","Encode","iroh_docs::sync::PeerIdBytes"],["","EncodeLabelSet","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> EncodeValue for [T; N]where\n T: Encode,
","EncodeValue","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["§impl<'a> FindToken<&'a u8> for [u8; 32]
§fn find_token(&self, token: &u8) -> bool
Returns true if self contains the token","FindToken<&'a u8>","iroh_docs::sync::PeerIdBytes"],["§impl FindToken<u8> for [u8; 32]
§fn find_token(&self, token: u8) -> bool
Returns true if self contains the token","FindToken","iroh_docs::sync::PeerIdBytes"],["","FixedTag","iroh_docs::sync::PeerIdBytes"],["","From<&Signature>","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["§impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>>> for [T; 32]
","From, B0>, B0>, B0>, B0>, B0>>>","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["","From>","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["source§impl From<NamespaceId> for [u8; 32]
source§fn from(value: NamespaceId) -> Self
Converts to this type from the input type.","From","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["","From>","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> FromBytes for [T; N]where\n T: FromBytes,
§fn slice_from_prefix(bytes: &[u8], count: usize) -> Option<(&[Self], &[u8])>where\n Self: Sized,
Interprets the prefix of the given bytes as a &[Self] with length\nequal to count without copying. Read more§fn slice_from_suffix(bytes: &[u8], count: usize) -> Option<(&[u8], &[Self])>where\n Self: Sized,
Interprets the suffix of the given bytes as a &[Self] with length\nequal to count without copying. Read more§fn read_from_prefix(bytes: &[u8]) -> Option<Self>where\n Self: Sized,
","FromBytes","iroh_docs::sync::PeerIdBytes"],["","FromHex","iroh_docs::sync::PeerIdBytes"],["","FromZeroes","iroh_docs::sync::PeerIdBytes"],["","Hash","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Hash for [T; N]where\n T: Hash,
The hash of an array is the same as that of the corresponding slice,\nas required by the Borrow implementation.
\n\nuse std::hash::BuildHasher;\n\nlet b = std::hash::RandomState::new();\nlet a: [u8; 3] = [0xa8, 0x3c, 0x09];\nlet s: &[u8] = &[0xa8, 0x3c, 0x09];\nassert_eq!(b.hash_one(a), b.hash_one(s));
\n","Hash","iroh_docs::sync::PeerIdBytes"],["","Index","iroh_docs::sync::PeerIdBytes"],["","IndexMut","iroh_docs::sync::PeerIdBytes"],["","InputLength","iroh_docs::sync::PeerIdBytes"],["1.53.0 · source§impl<T, const N: usize> IntoIterator for [T; N]
source§fn into_iter(self) -> <[T; N] as IntoIterator>::IntoIter
Creates a consuming iterator, that is, one that moves each value out of\nthe array (from start to end). The array cannot be used after calling\nthis unless T implements Copy, so the whole array is copied.
\nArrays have special behavior when calling .into_iter() prior to the\n2021 edition – see the array Editions section for more information.
\n","IntoIterator","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize> IntoResponse for [u8; N]
§fn into_response(self) -> Response<Body>
Create a response.","IntoResponse","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, const N: usize> Join for [Fut; N]where\n Fut: IntoFuture,
§type Output = [<Fut as IntoFuture>::Output; N]
The resulting output type.§type Future = Join<<Fut as IntoFuture>::IntoFuture, N>
The Future implementation returned by this method.","Join","iroh_docs::sync::PeerIdBytes"],["","Key","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> MaxSize for [T; N]where\n T: MaxSize,
§const POSTCARD_MAX_SIZE: usize = _
The maximum possible size that the serialization of this\ntype can have, in bytes.","MaxSize","iroh_docs::sync::PeerIdBytes"],["","Merge","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Ord for [T; N]where\n T: Ord,
Implements comparison of arrays lexicographically.
\n1.21.0 · source§fn max(self, other: Self) -> Selfwhere\n Self: Sized,
Compares and returns the maximum of two values. Read more","Ord","iroh_docs::sync::PeerIdBytes"],["","PartialEq<&[U]>","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, U, const N: usize> PartialEq<&mut [U]> for [T; N]where\n T: PartialEq<U>,
","PartialEq<&mut [U]>","iroh_docs::sync::PeerIdBytes"],["","PartialEq<[U]>","iroh_docs::sync::PeerIdBytes"],["","PartialEq<[U; N]>","iroh_docs::sync::PeerIdBytes"],["","PartialEq","iroh_docs::sync::PeerIdBytes"],["§impl<A, B, const N: usize, const M: usize> PartialEq<Vec<A, N>> for [B; M]where\n A: PartialEq<B>,
","PartialEq>","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> PartialOrd for [T; N]where\n T: PartialOrd,
Implements comparison of arrays lexicographically.
\nsource§fn le(&self, other: &[T; N]) -> bool
This method tests less than or equal to (for self and other) and is used by the <=\noperator. Read more","PartialOrd","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, const N: usize> Race for [Fut; N]where\n Fut: IntoFuture,
§type Output = <Fut as IntoFuture>::Output
The resulting output type.§type Future = Race<<Fut as IntoFuture>::IntoFuture, N>
Which kind of future are we turning this into?","Race","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, T, E, const N: usize> RaceOk for [Fut; N]where\n Fut: IntoFuture<Output = Result<T, E>>,
§type Future = RaceOk<<Fut as IntoFuture>::IntoFuture, T, E, N>
Which kind of future are we turning this into?","RaceOk","iroh_docs::sync::PeerIdBytes"],["","Schema","iroh_docs::sync::PeerIdBytes"],["source§impl<T> Serialize for [T; 32]where\n T: 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","iroh_docs::sync::PeerIdBytes"],["source§impl<const N: usize> Serialize for [u8; N]
source§fn serialize<S>(\n &self,\n serializer: S\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where\n S: Serializer,
","Serialize","iroh_docs::sync::PeerIdBytes"],["1.51.0 · source§impl<T, const N: usize> SlicePattern for [T; N]
","SlicePattern","iroh_docs::sync::PeerIdBytes"],["1.34.0 · source§impl<T, const N: usize> TryFrom<&[T]> for [T; N]where\n T: Copy,
Tries to create an array [T; N] by copying from a slice &[T]. Succeeds if\nslice.len() == N.
\n\nlet bytes: [u8; 3] = [1, 0, 2];\n\nlet bytes_head: [u8; 2] = <[u8; 2]>::try_from(&bytes[0..2]).unwrap();\nassert_eq!(1, u16::from_le_bytes(bytes_head));\n\nlet bytes_tail: [u8; 2] = bytes[1..3].try_into().unwrap();\nassert_eq!(512, u16::from_le_bytes(bytes_tail));
\n§type Error = TryFromSliceError
The type returned in the event of a conversion error.","TryFrom<&[T]>","iroh_docs::sync::PeerIdBytes"],["1.59.0 · source§impl<T, const N: usize> TryFrom<&mut [T]> for [T; N]where\n T: Copy,
Tries to create an array [T; N] by copying from a mutable slice &mut [T].\nSucceeds if slice.len() == N.
\n\nlet mut bytes: [u8; 3] = [1, 0, 2];\n\nlet bytes_head: [u8; 2] = <[u8; 2]>::try_from(&mut bytes[0..2]).unwrap();\nassert_eq!(1, u16::from_le_bytes(bytes_head));\n\nlet bytes_tail: [u8; 2] = (&mut bytes[1..3]).try_into().unwrap();\nassert_eq!(512, u16::from_le_bytes(bytes_tail));
\n§type Error = TryFromSliceError
The type returned in the event of a conversion error.","TryFrom<&mut [T]>","iroh_docs::sync::PeerIdBytes"],["§impl<T, A, const N: usize> TryFrom<Vec<T, A>> for [T; N]where\n A: Allocator,
§fn try_from(vec: Vec<T, A>) -> Result<[T; N], Vec<T, A>>
Gets the entire contents of the Vec<T> as an array,\nif its size exactly matches that of the requested array.
\n§Examples
\nassert_eq!(vec![1, 2, 3].try_into(), Ok([1, 2, 3]));\nassert_eq!(<Vec<i32>>::new().try_into(), Ok([]));
\nIf the length doesn’t match, the input comes back in Err:
\n\nlet r: Result<[i32; 4], _> = (0..10).collect::<Vec<_>>().try_into();\nassert_eq!(r, Err(vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9]));
\nIf you’re fine with just getting a prefix of the Vec<T>,\nyou can call .truncate(N) first.
\n\nlet mut v = String::from(\"hello world\").into_bytes();\nv.sort();\nv.truncate(2);\nlet [a, b]: [_; 2] = v.try_into().unwrap();\nassert_eq!(a, b' ');\nassert_eq!(b, b'd');
\n","TryFrom>","iroh_docs::sync::PeerIdBytes"],["1.48.0 · source§impl<T, A, const N: usize> TryFrom<Vec<T, A>> for [T; N]where\n A: Allocator,
source§fn try_from(vec: Vec<T, A>) -> Result<[T; N], Vec<T, A>>
Gets the entire contents of the Vec<T> as an array,\nif its size exactly matches that of the requested array.
\n§Examples
\nassert_eq!(vec![1, 2, 3].try_into(), Ok([1, 2, 3]));\nassert_eq!(<Vec<i32>>::new().try_into(), Ok([]));
\nIf the length doesn’t match, the input comes back in Err:
\n\nlet r: Result<[i32; 4], _> = (0..10).collect::<Vec<_>>().try_into();\nassert_eq!(r, Err(vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9]));
\nIf you’re fine with just getting a prefix of the Vec<T>,\nyou can call .truncate(N) first.
\n\nlet mut v = String::from(\"hello world\").into_bytes();\nv.sort();\nv.truncate(2);\nlet [a, b]: [_; 2] = v.try_into().unwrap();\nassert_eq!(a, b' ');\nassert_eq!(b, b'd');
\n","TryFrom>","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, T, E, const N: usize> TryJoin for [Fut; N]where\n Fut: IntoFuture<Output = Result<T, E>>,
§type Future = TryJoin<<Fut as IntoFuture>::IntoFuture, T, E, N>
Which kind of future are we turning this into?","TryJoin","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> Value for [T; N]where\n T: Value,
§type SelfType<'a> = [<T as Value>::SelfType<'a>; N]\nwhere\n [T; N]: 'a
SelfType<’a> must be the same type as Self with all lifetimes replaced with ’a§type AsBytes<'a> = Vec<u8>\nwhere\n [T; N]: 'a
§fn fixed_width() -> Option<usize>
Width of a fixed type, or None for variable width§fn from_bytes<'a>(data: &'a [u8]) -> [<T as Value>::SelfType<'a>; N]where\n [T; N]: 'a,
Deserializes data\nImplementations may return a view over data, or an owned type","Value","iroh_docs::sync::PeerIdBytes"],["","ValueOrd","iroh_docs::sync::PeerIdBytes"],["§impl<Z, const N: usize> Zeroize for [Z; N]where\n Z: Zeroize,
Impl [Zeroize] on arrays of types that impl [Zeroize].
\n","Zeroize","iroh_docs::sync::PeerIdBytes"],["","Zip","iroh_docs::sync::PeerIdBytes"],["source§impl<T, const N: usize> ConstParamTy for [T; N]where\n T: ConstParamTy,
","ConstParamTy","iroh_docs::sync::PeerIdBytes"],["1.58.0 · source§impl<T, const N: usize> Copy for [T; N]where\n T: Copy,
","Copy","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Eq for [T; N]where\n T: Eq,
","Eq","iroh_docs::sync::PeerIdBytes"],["source§impl<T, const N: usize> StructuralPartialEq for [T; N]
","StructuralPartialEq","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> Unaligned for [T; N]where\n T: Unaligned,
","Unaligned","iroh_docs::sync::PeerIdBytes"],["§impl<Z, const N: usize> ZeroizeOnDrop for [Z; N]where\n Z: ZeroizeOnDrop,
Impl [ZeroizeOnDrop] on arrays of types that impl [ZeroizeOnDrop].
\n","ZeroizeOnDrop","iroh_docs::sync::PeerIdBytes"]]
+"iroh_docs":[["source§impl<T, const N: usize> [T; N]
1.55.0 · sourcepub fn map<F, U>(self, f: F) -> [U; N]where\n F: FnMut(T) -> U,
Returns an array of the same size as self, with function f applied to each element\nin order.
\nIf you don’t necessarily need a new fixed-size array, consider using\nIterator::map instead.
\n§Note on performance and stack usage
\nUnfortunately, usages of this method are currently not always optimized\nas well as they could be. This mainly concerns large arrays, as mapping\nover small arrays seem to be optimized just fine. Also note that in\ndebug mode (i.e. without any optimizations), this method can use a lot\nof stack space (a few times the size of the array or more).
\nTherefore, in performance-critical code, try to avoid using this method\non large arrays or check the emitted code. Also try to avoid chained\nmaps (e.g. arr.map(...).map(...)).
\nIn many cases, you can instead use Iterator::map by calling .iter()\nor .into_iter() on your array. [T; N]::map is only necessary if you\nreally need a new array of the same size as the result. Rust’s lazy\niterators tend to get optimized very well.
\n§Examples
\nlet x = [1, 2, 3];\nlet y = x.map(|v| v + 1);\nassert_eq!(y, [2, 3, 4]);\n\nlet x = [1, 2, 3];\nlet mut temp = 0;\nlet y = x.map(|v| { temp += 1; v * temp });\nassert_eq!(y, [1, 4, 9]);\n\nlet x = [\"Ferris\", \"Bueller's\", \"Day\", \"Off\"];\nlet y = x.map(|v| v.len());\nassert_eq!(y, [6, 9, 3, 3]);
\nsourcepub fn try_map<F, R>(\n self,\n f: F\n) -> <<R as Try>::Residual as Residual<[<R as Try>::Output; N]>>::TryType
🔬This is a nightly-only experimental API. (array_try_map)
A fallible function f applied to each element on array self in order to\nreturn an array the same size as self or the first error encountered.
\nThe return type of this function depends on the return type of the closure.\nIf you return Result<T, E> from the closure, you’ll get a Result<[T; N], E>.\nIf you return Option<T> from the closure, you’ll get an Option<[T; N]>.
\n§Examples
\n#![feature(array_try_map)]\n\nlet a = [\"1\", \"2\", \"3\"];\nlet b = a.try_map(|v| v.parse::<u32>()).unwrap().map(|v| v + 1);\nassert_eq!(b, [2, 3, 4]);\n\nlet a = [\"1\", \"2a\", \"3\"];\nlet b = a.try_map(|v| v.parse::<u32>());\nassert!(b.is_err());\n\nuse std::num::NonZero;\n\nlet z = [1, 2, 0, 3, 4];\nassert_eq!(z.try_map(NonZero::new), None);\n\nlet a = [1, 2, 3];\nlet b = a.try_map(NonZero::new);\nlet c = b.map(|x| x.map(NonZero::get));\nassert_eq!(c, Some(a));
\n1.57.0 (const: 1.57.0) · sourcepub const fn as_slice(&self) -> &[T]
Returns a slice containing the entire array. Equivalent to &s[..].
\n1.57.0 · sourcepub fn as_mut_slice(&mut self) -> &mut [T]
Returns a mutable slice containing the entire array. Equivalent to\n&mut s[..].
\n1.77.0 · sourcepub fn each_ref(&self) -> [&T; N]
Borrows each element and returns an array of references with the same\nsize as self.
\n§Example
\nlet floats = [3.1, 2.7, -1.0];\nlet float_refs: [&f64; 3] = floats.each_ref();\nassert_eq!(float_refs, [&3.1, &2.7, &-1.0]);
\nThis method is particularly useful if combined with other methods, like\nmap. This way, you can avoid moving the original\narray if its elements are not Copy.
\n\nlet strings = [\"Ferris\".to_string(), \"♥\".to_string(), \"Rust\".to_string()];\nlet is_ascii = strings.each_ref().map(|s| s.is_ascii());\nassert_eq!(is_ascii, [true, false, true]);\n\n// We can still access the original array: it has not been moved.\nassert_eq!(strings.len(), 3);
\n1.77.0 · sourcepub fn each_mut(&mut self) -> [&mut T; N]
Borrows each element mutably and returns an array of mutable references\nwith the same size as self.
\n§Example
\n\nlet mut floats = [3.1, 2.7, -1.0];\nlet float_refs: [&mut f64; 3] = floats.each_mut();\n*float_refs[0] = 0.0;\nassert_eq!(float_refs, [&mut 0.0, &mut 2.7, &mut -1.0]);\nassert_eq!(floats, [0.0, 2.7, -1.0]);
\nsourcepub fn split_array_ref<const M: usize>(&self) -> (&[T; M], &[T])
🔬This is a nightly-only experimental API. (split_array)
Divides one array reference into two at an index.
\nThe first will contain all indices from [0, M) (excluding\nthe index M itself) and the second will contain all\nindices from [M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet v = [1, 2, 3, 4, 5, 6];\n\n{\n let (left, right) = v.split_array_ref::<0>();\n assert_eq!(left, &[]);\n assert_eq!(right, &[1, 2, 3, 4, 5, 6]);\n}\n\n{\n let (left, right) = v.split_array_ref::<2>();\n assert_eq!(left, &[1, 2]);\n assert_eq!(right, &[3, 4, 5, 6]);\n}\n\n{\n let (left, right) = v.split_array_ref::<6>();\n assert_eq!(left, &[1, 2, 3, 4, 5, 6]);\n assert_eq!(right, &[]);\n}
\nsourcepub fn split_array_mut<const M: usize>(&mut self) -> (&mut [T; M], &mut [T])
🔬This is a nightly-only experimental API. (split_array)
Divides one mutable array reference into two at an index.
\nThe first will contain all indices from [0, M) (excluding\nthe index M itself) and the second will contain all\nindices from [M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet mut v = [1, 0, 3, 0, 5, 6];\nlet (left, right) = v.split_array_mut::<2>();\nassert_eq!(left, &mut [1, 0][..]);\nassert_eq!(right, &mut [3, 0, 5, 6]);\nleft[1] = 2;\nright[1] = 4;\nassert_eq!(v, [1, 2, 3, 4, 5, 6]);
\nsourcepub fn rsplit_array_ref<const M: usize>(&self) -> (&[T], &[T; M])
🔬This is a nightly-only experimental API. (split_array)
Divides one array reference into two at an index from the end.
\nThe first will contain all indices from [0, N - M) (excluding\nthe index N - M itself) and the second will contain all\nindices from [N - M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet v = [1, 2, 3, 4, 5, 6];\n\n{\n let (left, right) = v.rsplit_array_ref::<0>();\n assert_eq!(left, &[1, 2, 3, 4, 5, 6]);\n assert_eq!(right, &[]);\n}\n\n{\n let (left, right) = v.rsplit_array_ref::<2>();\n assert_eq!(left, &[1, 2, 3, 4]);\n assert_eq!(right, &[5, 6]);\n}\n\n{\n let (left, right) = v.rsplit_array_ref::<6>();\n assert_eq!(left, &[]);\n assert_eq!(right, &[1, 2, 3, 4, 5, 6]);\n}
\nsourcepub fn rsplit_array_mut<const M: usize>(&mut self) -> (&mut [T], &mut [T; M])
🔬This is a nightly-only experimental API. (split_array)
Divides one mutable array reference into two at an index from the end.
\nThe first will contain all indices from [0, N - M) (excluding\nthe index N - M itself) and the second will contain all\nindices from [N - M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet mut v = [1, 0, 3, 0, 5, 6];\nlet (left, right) = v.rsplit_array_mut::<4>();\nassert_eq!(left, &mut [1, 0]);\nassert_eq!(right, &mut [3, 0, 5, 6][..]);\nleft[1] = 2;\nright[1] = 4;\nassert_eq!(v, [1, 2, 3, 4, 5, 6]);
\n",0,"iroh_docs::sync::PeerIdBytes"],["source§impl<const N: usize> [u8; N]
sourcepub const fn as_ascii(&self) -> Option<&[AsciiChar; N]>
🔬This is a nightly-only experimental API. (ascii_char)
Converts this array of bytes into a array of ASCII characters,\nor returns None if any of the characters is non-ASCII.
\n§Examples
\n#![feature(ascii_char)]\n#![feature(const_option)]\n\nconst HEX_DIGITS: [std::ascii::Char; 16] =\n *b\"0123456789abcdef\".as_ascii().unwrap();\n\nassert_eq!(HEX_DIGITS[1].as_str(), \"1\");\nassert_eq!(HEX_DIGITS[10].as_str(), \"a\");
\nsourcepub const unsafe fn as_ascii_unchecked(&self) -> &[AsciiChar; N]
🔬This is a nightly-only experimental API. (ascii_char)
Converts this array of bytes into a array of ASCII characters,\nwithout checking whether they’re valid.
\n§Safety
\nEvery byte in the array must be in 0..=127, or else this is UB.
\n",0,"iroh_docs::sync::PeerIdBytes"],["§impl<T> Array for [T; 32]where\n T: Default,
§fn as_slice_mut(&mut self) -> &mut [T]
Gives a unique slice over the whole thing. Read more","Array","iroh_docs::sync::PeerIdBytes"],["","Array","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> AsBytes for [T; N]where\n T: AsBytes,
§fn write_to_prefix(&self, bytes: &mut [u8]) -> Option<()>
","AsBytes","iroh_docs::sync::PeerIdBytes"],["","AsBytes","iroh_docs::sync::PeerIdBytes"],["","AsMut<[T]>","iroh_docs::sync::PeerIdBytes"],["","AsRef<[T]>","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> BitView for [T; N]where\n T: BitStore,
Note that overly-large arrays may cause the conversions to fail.
\n§fn view_bits<O>(&self) -> &BitSlice<T, O>where\n O: BitOrder,
Views a memory region as an immutable bit-slice.§fn try_view_bits<O>(&self) -> Result<&BitSlice<T, O>, BitSpanError<T>>where\n O: BitOrder,
Attempts to view a memory region as an immutable bit-slice. Read more§fn view_bits_mut<O>(&mut self) -> &mut BitSlice<T, O>where\n O: BitOrder,
Views a memory region as a mutable bit-slice.§fn try_view_bits_mut<O>(\n &mut self\n) -> Result<&mut BitSlice<T, O>, BitSpanError<T>>where\n O: BitOrder,
Attempts to view a memory region as a mutable bit-slice. Read more","BitView","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> BitViewSized for [T; N]where\n T: BitStore,
§fn as_raw_slice(&self) -> &[<[T; N] as BitView>::Store]
Views the type as a slice of its elements.§fn as_raw_mut_slice(&mut self) -> &mut [<[T; N] as BitView>::Store]
Views the type as a mutable slice of its elements.§fn into_bitarray<O>(self) -> BitArray<Self, O>where\n O: BitOrder,
Wraps self in a BitArray.","BitViewSized","iroh_docs::sync::PeerIdBytes"],["","Borrow<[T]>","iroh_docs::sync::PeerIdBytes"],["1.4.0 · source§impl<T, const N: usize> BorrowMut<[T]> for [T; N]
source§fn borrow_mut(&mut self) -> &mut [T]
Mutably borrows from an owned value. Read more","BorrowMut<[T]>","iroh_docs::sync::PeerIdBytes"],["","Chain","iroh_docs::sync::PeerIdBytes"],["","Clone","iroh_docs::sync::PeerIdBytes"],["","Debug","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize> Decode for [u8; N]
Decodes a byte array from byte[n] as described in RFC4251 § 5:
\n\nA byte represents an arbitrary 8-bit value (octet). Fixed length\ndata is sometimes represented as an array of bytes, written\nbyte[n], where n is the number of bytes in the array.
\n
\n","Decode","iroh_docs::sync::PeerIdBytes"],["§impl<'a, T, const N: usize> DecodeValue<'a> for [T; N]where\n T: Decode<'a>,
§fn decode_value<R>(reader: &mut R, header: Header) -> Result<[T; N], Error>where\n R: Reader<'a>,
Attempt to decode this message using the provided [Reader].","DecodeValue<'a>","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["source§impl<'de, T> Deserialize<'de> for [T; 32]where\n T: Deserialize<'de>,
source§fn deserialize<D>(\n deserializer: D\n) -> Result<[T; 32], <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more","Deserialize<'de>","iroh_docs::sync::PeerIdBytes"],["source§impl<'de, const N: usize> Deserialize<'de> for [u8; N]
source§fn deserialize<D>(\n deserializer: D\n) -> Result<[u8; N], <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
","Deserialize<'de>","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize> Encode for [u8; N]
Encodes [u8; N] into byte[n] as described in RFC4251 § 5:
\n\nA byte represents an arbitrary 8-bit value (octet). Fixed length\ndata is sometimes represented as an array of bytes, written\nbyte[n], where n is the number of bytes in the array.
\n
\n§fn encoded_len(&self) -> Result<usize, Error>
Get the length of this type encoded in bytes, prior to Base64 encoding.§fn encode(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value using the provided [Writer].§fn encoded_len_prefixed(&self) -> Result<usize, Error>
Return the length of this type after encoding when prepended with a\nuint32 length prefix.§fn encode_prefixed(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value, first prepending a uint32 length prefix\nset to [Encode::encoded_len].","Encode","iroh_docs::sync::PeerIdBytes"],["","EncodeLabelSet","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> EncodeValue for [T; N]where\n T: Encode,
","EncodeValue","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["§impl<'a> FindToken<&'a u8> for [u8; 32]
§fn find_token(&self, token: &u8) -> bool
Returns true if self contains the token","FindToken<&'a u8>","iroh_docs::sync::PeerIdBytes"],["§impl FindToken<u8> for [u8; 32]
§fn find_token(&self, token: u8) -> bool
Returns true if self contains the token","FindToken","iroh_docs::sync::PeerIdBytes"],["","FixedTag","iroh_docs::sync::PeerIdBytes"],["","From<&Signature>","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["§impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>>> for [T; 32]
","From, B0>, B0>, B0>, B0>, B0>>>","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["","From>","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["source§impl From<NamespaceId> for [u8; 32]
source§fn from(value: NamespaceId) -> Self
Converts to this type from the input type.","From","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["","From>","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> FromBytes for [T; N]where\n T: FromBytes,
§fn slice_from_prefix(bytes: &[u8], count: usize) -> Option<(&[Self], &[u8])>where\n Self: Sized,
Interprets the prefix of the given bytes as a &[Self] with length\nequal to count without copying. Read more§fn slice_from_suffix(bytes: &[u8], count: usize) -> Option<(&[u8], &[Self])>where\n Self: Sized,
Interprets the suffix of the given bytes as a &[Self] with length\nequal to count without copying. Read more§fn read_from_prefix(bytes: &[u8]) -> Option<Self>where\n Self: Sized,
","FromBytes","iroh_docs::sync::PeerIdBytes"],["","FromHex","iroh_docs::sync::PeerIdBytes"],["","FromZeroes","iroh_docs::sync::PeerIdBytes"],["","Hash","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Hash for [T; N]where\n T: Hash,
The hash of an array is the same as that of the corresponding slice,\nas required by the Borrow implementation.
\n\nuse std::hash::BuildHasher;\n\nlet b = std::hash::RandomState::new();\nlet a: [u8; 3] = [0xa8, 0x3c, 0x09];\nlet s: &[u8] = &[0xa8, 0x3c, 0x09];\nassert_eq!(b.hash_one(a), b.hash_one(s));
\n","Hash","iroh_docs::sync::PeerIdBytes"],["","Index","iroh_docs::sync::PeerIdBytes"],["","IndexMut","iroh_docs::sync::PeerIdBytes"],["","InputLength","iroh_docs::sync::PeerIdBytes"],["1.53.0 · source§impl<T, const N: usize> IntoIterator for [T; N]
source§fn into_iter(self) -> <[T; N] as IntoIterator>::IntoIter
Creates a consuming iterator, that is, one that moves each value out of\nthe array (from start to end). The array cannot be used after calling\nthis unless T implements Copy, so the whole array is copied.
\nArrays have special behavior when calling .into_iter() prior to the\n2021 edition – see the array Editions section for more information.
\n","IntoIterator","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize> IntoResponse for [u8; N]
§fn into_response(self) -> Response<Body>
Create a response.","IntoResponse","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, const N: usize> Join for [Fut; N]where\n Fut: IntoFuture,
§type Output = [<Fut as IntoFuture>::Output; N]
The resulting output type.§type Future = Join<<Fut as IntoFuture>::IntoFuture, N>
The Future implementation returned by this method.","Join","iroh_docs::sync::PeerIdBytes"],["","Key","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> MaxSize for [T; N]where\n T: MaxSize,
§const POSTCARD_MAX_SIZE: usize = _
The maximum possible size that the serialization of this\ntype can have, in bytes.","MaxSize","iroh_docs::sync::PeerIdBytes"],["","Merge","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Ord for [T; N]where\n T: Ord,
Implements comparison of arrays lexicographically.
\n1.21.0 · source§fn max(self, other: Self) -> Selfwhere\n Self: Sized,
Compares and returns the maximum of two values. Read more","Ord","iroh_docs::sync::PeerIdBytes"],["","PartialEq<&[U]>","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, U, const N: usize> PartialEq<&mut [U]> for [T; N]where\n T: PartialEq<U>,
","PartialEq<&mut [U]>","iroh_docs::sync::PeerIdBytes"],["","PartialEq<[U]>","iroh_docs::sync::PeerIdBytes"],["","PartialEq<[U; N]>","iroh_docs::sync::PeerIdBytes"],["","PartialEq","iroh_docs::sync::PeerIdBytes"],["§impl<A, B, const N: usize, const M: usize> PartialEq<Vec<A, N>> for [B; M]where\n A: PartialEq<B>,
","PartialEq>","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> PartialOrd for [T; N]where\n T: PartialOrd,
Implements comparison of arrays lexicographically.
\nsource§fn le(&self, other: &[T; N]) -> bool
This method tests less than or equal to (for self and other) and is used by the <=\noperator. Read more","PartialOrd","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, const N: usize> Race for [Fut; N]where\n Fut: IntoFuture,
§type Output = <Fut as IntoFuture>::Output
The resulting output type.§type Future = Race<<Fut as IntoFuture>::IntoFuture, N>
Which kind of future are we turning this into?","Race","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, T, E, const N: usize> RaceOk for [Fut; N]where\n Fut: IntoFuture<Output = Result<T, E>>,
§type Future = RaceOk<<Fut as IntoFuture>::IntoFuture, T, E, N>
Which kind of future are we turning this into?","RaceOk","iroh_docs::sync::PeerIdBytes"],["","Schema","iroh_docs::sync::PeerIdBytes"],["source§impl<T> Serialize for [T; 32]where\n T: 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","iroh_docs::sync::PeerIdBytes"],["source§impl<const N: usize> Serialize for [u8; N]
source§fn serialize<S>(\n &self,\n serializer: S\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where\n S: Serializer,
","Serialize","iroh_docs::sync::PeerIdBytes"],["1.51.0 · source§impl<T, const N: usize> SlicePattern for [T; N]
","SlicePattern","iroh_docs::sync::PeerIdBytes"],["1.34.0 · source§impl<T, const N: usize> TryFrom<&[T]> for [T; N]where\n T: Copy,
Tries to create an array [T; N] by copying from a slice &[T]. Succeeds if\nslice.len() == N.
\n\nlet bytes: [u8; 3] = [1, 0, 2];\n\nlet bytes_head: [u8; 2] = <[u8; 2]>::try_from(&bytes[0..2]).unwrap();\nassert_eq!(1, u16::from_le_bytes(bytes_head));\n\nlet bytes_tail: [u8; 2] = bytes[1..3].try_into().unwrap();\nassert_eq!(512, u16::from_le_bytes(bytes_tail));
\n§type Error = TryFromSliceError
The type returned in the event of a conversion error.","TryFrom<&[T]>","iroh_docs::sync::PeerIdBytes"],["1.59.0 · source§impl<T, const N: usize> TryFrom<&mut [T]> for [T; N]where\n T: Copy,
Tries to create an array [T; N] by copying from a mutable slice &mut [T].\nSucceeds if slice.len() == N.
\n\nlet mut bytes: [u8; 3] = [1, 0, 2];\n\nlet bytes_head: [u8; 2] = <[u8; 2]>::try_from(&mut bytes[0..2]).unwrap();\nassert_eq!(1, u16::from_le_bytes(bytes_head));\n\nlet bytes_tail: [u8; 2] = (&mut bytes[1..3]).try_into().unwrap();\nassert_eq!(512, u16::from_le_bytes(bytes_tail));
\n§type Error = TryFromSliceError
The type returned in the event of a conversion error.","TryFrom<&mut [T]>","iroh_docs::sync::PeerIdBytes"],["§impl<T, A, const N: usize> TryFrom<Vec<T, A>> for [T; N]where\n A: Allocator,
§fn try_from(vec: Vec<T, A>) -> Result<[T; N], Vec<T, A>>
Gets the entire contents of the Vec<T> as an array,\nif its size exactly matches that of the requested array.
\n§Examples
\nassert_eq!(vec![1, 2, 3].try_into(), Ok([1, 2, 3]));\nassert_eq!(<Vec<i32>>::new().try_into(), Ok([]));
\nIf the length doesn’t match, the input comes back in Err:
\n\nlet r: Result<[i32; 4], _> = (0..10).collect::<Vec<_>>().try_into();\nassert_eq!(r, Err(vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9]));
\nIf you’re fine with just getting a prefix of the Vec<T>,\nyou can call .truncate(N) first.
\n\nlet mut v = String::from(\"hello world\").into_bytes();\nv.sort();\nv.truncate(2);\nlet [a, b]: [_; 2] = v.try_into().unwrap();\nassert_eq!(a, b' ');\nassert_eq!(b, b'd');
\n","TryFrom>","iroh_docs::sync::PeerIdBytes"],["1.48.0 · source§impl<T, A, const N: usize> TryFrom<Vec<T, A>> for [T; N]where\n A: Allocator,
source§fn try_from(vec: Vec<T, A>) -> Result<[T; N], Vec<T, A>>
Gets the entire contents of the Vec<T> as an array,\nif its size exactly matches that of the requested array.
\n§Examples
\nassert_eq!(vec![1, 2, 3].try_into(), Ok([1, 2, 3]));\nassert_eq!(<Vec<i32>>::new().try_into(), Ok([]));
\nIf the length doesn’t match, the input comes back in Err:
\n\nlet r: Result<[i32; 4], _> = (0..10).collect::<Vec<_>>().try_into();\nassert_eq!(r, Err(vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9]));
\nIf you’re fine with just getting a prefix of the Vec<T>,\nyou can call .truncate(N) first.
\n\nlet mut v = String::from(\"hello world\").into_bytes();\nv.sort();\nv.truncate(2);\nlet [a, b]: [_; 2] = v.try_into().unwrap();\nassert_eq!(a, b' ');\nassert_eq!(b, b'd');
\n","TryFrom>","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, T, E, const N: usize> TryJoin for [Fut; N]where\n Fut: IntoFuture<Output = Result<T, E>>,
§type Future = TryJoin<<Fut as IntoFuture>::IntoFuture, T, E, N>
Which kind of future are we turning this into?","TryJoin","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> Value for [T; N]where\n T: Value,
§type SelfType<'a> = [<T as Value>::SelfType<'a>; N]\nwhere\n [T; N]: 'a
SelfType<’a> must be the same type as Self with all lifetimes replaced with ’a§type AsBytes<'a> = Vec<u8>\nwhere\n [T; N]: 'a
§fn fixed_width() -> Option<usize>
Width of a fixed type, or None for variable width§fn from_bytes<'a>(data: &'a [u8]) -> [<T as Value>::SelfType<'a>; N]where\n [T; N]: 'a,
Deserializes data\nImplementations may return a view over data, or an owned type","Value","iroh_docs::sync::PeerIdBytes"],["","ValueOrd","iroh_docs::sync::PeerIdBytes"],["§impl<Z, const N: usize> Zeroize for [Z; N]where\n Z: Zeroize,
Impl [Zeroize] on arrays of types that impl [Zeroize].
\n","Zeroize","iroh_docs::sync::PeerIdBytes"],["","Zip","iroh_docs::sync::PeerIdBytes"],["source§impl<T, const N: usize> ConstParamTy for [T; N]where\n T: ConstParamTy,
","ConstParamTy","iroh_docs::sync::PeerIdBytes"],["1.58.0 · source§impl<T, const N: usize> Copy for [T; N]where\n T: Copy,
","Copy","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Eq for [T; N]where\n T: Eq,
","Eq","iroh_docs::sync::PeerIdBytes"],["source§impl<T, const N: usize> StructuralPartialEq for [T; N]
","StructuralPartialEq","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> Unaligned for [T; N]where\n T: Unaligned,
","Unaligned","iroh_docs::sync::PeerIdBytes"],["§impl<Z, const N: usize> ZeroizeOnDrop for [Z; N]where\n Z: ZeroizeOnDrop,
Impl [ZeroizeOnDrop] on arrays of types that impl [ZeroizeOnDrop].
\n","ZeroizeOnDrop","iroh_docs::sync::PeerIdBytes"]]
};if (window.register_type_impls) {window.register_type_impls(type_impls);} else {window.pending_type_impls = type_impls;}})()
\ No newline at end of file
fn as_bits<O>(&self) -> &BitSlice<T, O>where
diff --git a/pr/2595/docs/iroh_blobs/struct.HashAndFormat.html b/pr/2595/docs/iroh_blobs/struct.HashAndFormat.html
index 8eb7ba64d5..421c7e1439 100644
--- a/pr/2595/docs/iroh_blobs/struct.HashAndFormat.html
+++ b/pr/2595/docs/iroh_blobs/struct.HashAndFormat.html
@@ -1,37 +1,37 @@
-HashAndFormat in iroh_blobs - Rust Struct iroh_blobs::HashAndFormat
pub struct HashAndFormat {
+HashAndFormat in iroh_blobs - Rust Struct iroh_blobs::HashAndFormat
source · pub struct HashAndFormat {
pub hash: Hash,
pub format: BlobFormat,
}
Expand description
A hash and format pair
Fields§
§hash: HashThe hash
§format: BlobFormatThe format
-Implementations§
§impl HashAndFormat
pub fn new(hash: Hash, format: BlobFormat) -> HashAndFormat
Create a new hash and format pair.
-pub fn raw(hash: Hash) -> HashAndFormat
Create a new hash and format pair, using the default (raw) format.
-pub fn hash_seq(hash: Hash) -> HashAndFormat
Create a new hash and format pair, using the collection format.
-Trait Implementations§
§impl Clone for HashAndFormat
§fn clone(&self) -> HashAndFormat
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more§impl Debug for HashAndFormat
§impl<'de> Deserialize<'de> for HashAndFormat
§fn deserialize<D>(
+
Implementations§
source§impl HashAndFormat
sourcepub fn new(hash: Hash, format: BlobFormat) -> HashAndFormat
Create a new hash and format pair.
+sourcepub fn raw(hash: Hash) -> HashAndFormat
Create a new hash and format pair, using the default (raw) format.
+sourcepub fn hash_seq(hash: Hash) -> HashAndFormat
Create a new hash and format pair, using the collection format.
+Trait Implementations§
source§impl Clone for HashAndFormat
source§fn clone(&self) -> HashAndFormat
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moresource§impl Debug for HashAndFormat
source§impl<'de> Deserialize<'de> for HashAndFormat
source§fn deserialize<D>(
deserializer: D
) -> Result<HashAndFormat, <D as Deserializer<'de>>::Error>where
- D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more§impl Display for HashAndFormat
source§impl From<DownloadKind> for HashAndFormat
source§fn from(value: DownloadKind) -> Self
Converts to this type from the input type.source§impl From<HashAndFormat> for DownloadKind
source§fn from(value: HashAndFormat) -> Self
Converts to this type from the input type.§impl FromStr for HashAndFormat
§impl Hash for HashAndFormat
§fn hash<__H>(&self, state: &mut __H)where
+ D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl Display for HashAndFormat
source§impl From<DownloadKind> for HashAndFormat
source§fn from(value: DownloadKind) -> Self
Converts to this type from the input type.source§impl From<HashAndFormat> for DownloadKind
source§fn from(value: HashAndFormat) -> Self
Converts to this type from the input type.source§impl FromStr for HashAndFormat
source§impl Hash for HashAndFormat
§impl MaxSize for HashAndFormat
§const POSTCARD_MAX_SIZE: usize = 33usize
The maximum possible size that the serialization of this
-type can have, in bytes.§impl Ord for HashAndFormat
source§impl MaxSize for HashAndFormat
source§const POSTCARD_MAX_SIZE: usize = 33usize
The maximum possible size that the serialization of this
+type can have, in bytes.source§impl Ord for HashAndFormat
source§fn cmp(&self, other: &HashAndFormat) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more§impl PartialEq for HashAndFormat
§fn eq(&self, other: &HashAndFormat) -> bool
Restrict a value to a certain interval. Read moresource§impl PartialEq for HashAndFormat
source§fn eq(&self, other: &HashAndFormat) -> bool
This method tests for self and other values to be equal, and is used
by ==.§impl PartialOrd for HashAndFormat
§fn partial_cmp(&self, other: &HashAndFormat) -> Option<Ordering>
source§impl PartialOrd for HashAndFormat
source§fn partial_cmp(&self, other: &HashAndFormat) -> Option<Ordering>
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 <=
operator. Read moresource§impl Serialize for HashAndFormat
source§fn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
- S: Serializer,
Serialize this value into the given Serde serializer. Read more§impl Value for HashAndFormat
§type SelfType<'a> = HashAndFormat
SelfType<’a> must be the same type as Self with all lifetimes replaced with ’a§type AsBytes<'a> = [u8; 33]
§fn fixed_width() -> Option<usize>
Width of a fixed type, or None for variable width§fn from_bytes<'a>(data: &'a [u8]) -> <HashAndFormat as Value>::SelfType<'a>where
+ S: Serializer,
Serialize this value into the given Serde serializer. Read moresource§impl Value for HashAndFormat
§type SelfType<'a> = HashAndFormat
SelfType<’a> must be the same type as Self with all lifetimes replaced with ’a§type AsBytes<'a> = [u8; 33]
source§fn fixed_width() -> Option<usize>
Width of a fixed type, or None for variable widthsource§fn from_bytes<'a>(data: &'a [u8]) -> <HashAndFormat as Value>::SelfType<'a>where
HashAndFormat: 'a,
Deserializes data
-Implementations may return a view over data, or an owned typesource§fn as_bytes<'a, 'b>(
value: &'a <HashAndFormat as Value>::SelfType<'b>
) -> <HashAndFormat as Value>::AsBytes<'a>where
'b: 'a,
- HashAndFormat: 'a + 'b,
Serialize the value to a slice§impl Copy for HashAndFormat
§impl Eq for HashAndFormat
§impl StructuralPartialEq for HashAndFormat
Auto Trait Implementations§
§impl Freeze for HashAndFormat
§impl RefUnwindSafe for HashAndFormat
§impl Send for HashAndFormat
§impl Sync for HashAndFormat
§impl Unpin for HashAndFormat
§impl UnwindSafe for HashAndFormat
Blanket Implementations§
source§impl<T> Any for Twhere
+ HashAndFormat: 'a + 'b,
Serialize the value to a slicesource§impl Copy for HashAndFormat
source§impl Eq for HashAndFormat
source§impl StructuralPartialEq for HashAndFormat
Auto Trait Implementations§
§impl Freeze for HashAndFormat
§impl RefUnwindSafe for HashAndFormat
§impl Send for HashAndFormat
§impl Sync for HashAndFormat
§impl Unpin for HashAndFormat
§impl UnwindSafe for HashAndFormat
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
diff --git a/pr/2595/docs/iroh_docs/actor/struct.SyncHandle.html b/pr/2595/docs/iroh_docs/actor/struct.SyncHandle.html
index cfd29c2ce8..6c70a0ff39 100644
--- a/pr/2595/docs/iroh_docs/actor/struct.SyncHandle.html
+++ b/pr/2595/docs/iroh_docs/actor/struct.SyncHandle.html
@@ -26,7 +26,7 @@ waiting for the actor to finish happens in an async context, and therefore that
namespace: NamespaceId,
author: AuthorId,
key: Bytes,
- hash: Hash,
+ hash: Hash,
len: u64
) -> Result<()>sourcepub async fn delete_prefix(
&self,
diff --git a/pr/2595/docs/iroh_docs/engine/enum.LiveEvent.html b/pr/2595/docs/iroh_docs/engine/enum.LiveEvent.html
index ceb8545b50..f0d33bcb21 100644
--- a/pr/2595/docs/iroh_docs/engine/enum.LiveEvent.html
+++ b/pr/2595/docs/iroh_docs/engine/enum.LiveEvent.html
@@ -3,34 +3,34 @@
entry: Entry,
},
InsertRemote {
- from: PublicKey,
+ from: PublicKey,
entry: Entry,
content_status: ContentStatus,
},
ContentReady {
- hash: Hash,
+ hash: Hash,
},
PendingContentReady,
- NeighborUp(PublicKey),
- NeighborDown(PublicKey),
+ NeighborUp(PublicKey),
+ NeighborDown(PublicKey),
SyncFinished(SyncEvent),
}Expand description
Events informing about actions of the live sync progress.
Variants§
§InsertLocal
A local insertion.
§InsertRemote
Received a remote insert.
-Fields
§from: PublicKeyThe peer that sent us the entry.
+Fields
§content_status: ContentStatusIf the content is available at the local node
§ContentReady
The content of an entry was downloaded and is now available at the local node
-Fields
§hash: HashThe content hash of the newly available entry content
+§PendingContentReady
All pending content is now ready.
This event signals that all queued content downloads from the last sync run have either
completed or failed.
It will only be emitted after a Self::SyncFinished event, never before.
Receiving this event does not guarantee that all content in the document is available. If
blobs failed to download, this event will still be emitted after all operations completed.
-§NeighborUp(PublicKey)
We have a new neighbor in the swarm.
-§NeighborDown(PublicKey)
We lost a neighbor in the swarm.
+§NeighborUp(PublicKey)
We have a new neighbor in the swarm.
+§NeighborDown(PublicKey)
We lost a neighbor in the swarm.
§SyncFinished(SyncEvent)
A set-reconciliation sync finished.
Trait Implementations§
source§impl<'de> Deserialize<'de> for LiveEvent
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl PartialEq for LiveEvent
source§fn eq(&self, other: &LiveEvent) -> bool
This method tests for self and other values to be equal, and is used
diff --git a/pr/2595/docs/iroh_docs/engine/fn.entry_to_content_status.html b/pr/2595/docs/iroh_docs/engine/fn.entry_to_content_status.html
index 459a6719d2..3b39df6428 100644
--- a/pr/2595/docs/iroh_docs/engine/fn.entry_to_content_status.html
+++ b/pr/2595/docs/iroh_docs/engine/fn.entry_to_content_status.html
@@ -1,2 +1,2 @@
-entry_to_content_status in iroh_docs::engine - Rust Function iroh_docs::engine::entry_to_content_status
source · pub fn entry_to_content_status(entry: Result<EntryStatus>) -> ContentStatus
Expand description
Converts an [EntryStatus] into a [‘ContentStatus’].
+entry_to_content_status in iroh_docs::engine - Rust Function iroh_docs::engine::entry_to_content_status
source · pub fn entry_to_content_status(entry: Result<EntryStatus>) -> ContentStatus
Expand description
Converts an EntryStatus into a [‘ContentStatus’].
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_docs/engine/index.html b/pr/2595/docs/iroh_docs/engine/index.html
index 5f78e23386..622ab4b871 100644
--- a/pr/2595/docs/iroh_docs/engine/index.html
+++ b/pr/2595/docs/iroh_docs/engine/index.html
@@ -1,4 +1,4 @@
iroh_docs::engine - Rust Expand description
Handlers and actors to for live syncing replicas.
crate::Replica is also called documents here.
Structs§
- Persistent default author for a docs engine.
- The sync engine coordinates actors that manage open documents, set-reconciliation syncs with
-peers and a gossip swarm for each syncing document.
- Event emitted when a sync operation completes
Enums§
- Where to persist the default author.
- Events informing about actions of the live sync progress.
- Why we performed a sync exchange
- Why we started a sync request
Functions§
- Converts an [
EntryStatus] into a [‘ContentStatus’].
\ No newline at end of file
+peers and a gossip swarm for each syncing document.Event emitted when a sync operation completes Enums§
- Where to persist the default author.
- Events informing about actions of the live sync progress.
- Why we performed a sync exchange
- Why we started a sync request
Functions§
- Converts an
EntryStatus into a [‘ContentStatus’].
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_docs/engine/struct.Engine.html b/pr/2595/docs/iroh_docs/engine/struct.Engine.html
index 1b88a96726..46cd25179e 100644
--- a/pr/2595/docs/iroh_docs/engine/struct.Engine.html
+++ b/pr/2595/docs/iroh_docs/engine/struct.Engine.html
@@ -8,12 +8,12 @@ peers and a gossip swarm for each syncing document.
Fields§
§endpoint: EndpointEndpoint used by the engine.
§sync: SyncHandleHandle to the actor thread.
The persistent default author for this engine.
-Implementations§
source§impl Engine
Implementations§
source§impl Engine
sourcepub async fn spawn<B: Store>(
endpoint: Endpoint,
- gossip: Gossip,
+ gossip: Gossip,
replica_store: Store,
bao_store: B,
- downloader: Downloader,
+ downloader: Downloader,
default_author_storage: DefaultAuthorStorage
) -> Result<Self>
Start the sync engine.
This will spawn two tokio tasks for the live sync coordination and gossip actors, and a
@@ -21,7 +21,7 @@ thread for the sourcepub async fn start_sync(
&self,
namespace: NamespaceId,
- peers: Vec<NodeAddr>
+ peers: Vec<NodeAddr>
) -> Result<()>
Start to sync a document.
If peers is non-empty, it will both do an initial set-reconciliation sync with each peer,
and join an iroh-gossip swarm with these peers to receive and broadcast document updates.
diff --git a/pr/2595/docs/iroh_docs/engine/struct.SyncEvent.html b/pr/2595/docs/iroh_docs/engine/struct.SyncEvent.html
index 49ba954022..d7eb730d81 100644
--- a/pr/2595/docs/iroh_docs/engine/struct.SyncEvent.html
+++ b/pr/2595/docs/iroh_docs/engine/struct.SyncEvent.html
@@ -1,11 +1,11 @@
SyncEvent in iroh_docs::engine - Rust pub struct SyncEvent {
- pub peer: PublicKey,
+ pub peer: PublicKey,
pub origin: Origin,
pub finished: SystemTime,
pub started: SystemTime,
pub result: Result<SyncDetails, String>,
}
Expand description
Event emitted when a sync operation completes
-Fields§
§peer: PublicKeyPeer we synced with
+Fields§
§peer: PublicKeyPeer we synced with
§origin: OriginOrigin of the sync exchange
§finished: SystemTimeTimestamp when the sync started
§started: SystemTimeTimestamp when the sync finished
diff --git a/pr/2595/docs/iroh_docs/index.html b/pr/2595/docs/iroh_docs/index.html
index a37d30e2a6..41c792c5e5 100644
--- a/pr/2595/docs/iroh_docs/index.html
+++ b/pr/2595/docs/iroh_docs/index.html
@@ -1,7 +1,7 @@
iroh_docs - Rust Expand description
Multi-dimensional key-value documents with an efficient synchronization protocol
The crate operates on Replicas. A replica contains an unlimited number of
Entries. Each entry is identified by a key, its author, and the replica’s
-namespace. Its value is the 32-byte BLAKE3 hash
+namespace. Its value is the 32-byte BLAKE3 hash
of the entry’s content data, the size of this content data, and a timestamp.
The content data itself is not stored or transferred through a replica.
All entries in a replica are signed with two keypairs:
diff --git a/pr/2595/docs/iroh_docs/net/enum.AcceptError.html b/pr/2595/docs/iroh_docs/net/enum.AcceptError.html
index 87e9a07ad3..cf11b5b695 100644
--- a/pr/2595/docs/iroh_docs/net/enum.AcceptError.html
+++ b/pr/2595/docs/iroh_docs/net/enum.AcceptError.html
@@ -3,31 +3,31 @@
error: Error,
},
Open {
- peer: PublicKey,
+ peer: PublicKey,
error: Error,
},
Abort {
- peer: PublicKey,
+ peer: PublicKey,
namespace: NamespaceId,
reason: AbortReason,
},
Sync {
- peer: PublicKey,
+ peer: PublicKey,
namespace: Option<NamespaceId>,
error: Error,
},
Close {
- peer: PublicKey,
+ peer: PublicKey,
namespace: Option<NamespaceId>,
error: Error,
},
}Expand description
Errors that may occur on handling incoming sync connections.
Variants§
§Connect
Failed to establish connection
§Open
Failed to open replica
-§Abort
We aborted the sync request.
-§Sync
Failed to run sync
-§Close
Failed to close
-Implementations§
source§impl AcceptError
Implementations§
Trait Implementations§
source§impl Debug for AcceptError
source§impl Display for AcceptError
source§impl Error for AcceptError
source§fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more1.0.0 · source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()Auto Trait Implementations§
§impl Freeze for AcceptError
§impl RefUnwindSafe for AcceptError
§impl Send for AcceptError
§impl Sync for AcceptError
§impl Unpin for AcceptError
§impl UnwindSafe for AcceptError
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
diff --git a/pr/2595/docs/iroh_docs/net/fn.connect_and_sync.html b/pr/2595/docs/iroh_docs/net/fn.connect_and_sync.html
index 1ee6909d53..7bec313309 100644
--- a/pr/2595/docs/iroh_docs/net/fn.connect_and_sync.html
+++ b/pr/2595/docs/iroh_docs/net/fn.connect_and_sync.html
@@ -2,6 +2,6 @@
endpoint: &Endpoint,
sync: &SyncHandle,
namespace: NamespaceId,
- peer: NodeAddr
+ peer: NodeAddr
) -> Result<SyncFinished, ConnectError>Expand description
Connect to a peer and sync a replica
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_docs/net/fn.handle_connection.html b/pr/2595/docs/iroh_docs/net/fn.handle_connection.html
index 347a0c22bf..e96816b362 100644
--- a/pr/2595/docs/iroh_docs/net/fn.handle_connection.html
+++ b/pr/2595/docs/iroh_docs/net/fn.handle_connection.html
@@ -3,6 +3,6 @@
connecting: Connecting,
accept_cb: F
) -> Result<SyncFinished, AcceptError>where
- F: Fn(NamespaceId, PublicKey) -> Fut,
+ F: Fn(NamespaceId, PublicKey) -> Fut,
Fut: Future<Output = AcceptOutcome>,Expand description
Handle an iroh-docs connection and sync all shared documents in the replica store.
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_docs/net/struct.SyncFinished.html b/pr/2595/docs/iroh_docs/net/struct.SyncFinished.html
index 74ab2f6632..dcd549e6fc 100644
--- a/pr/2595/docs/iroh_docs/net/struct.SyncFinished.html
+++ b/pr/2595/docs/iroh_docs/net/struct.SyncFinished.html
@@ -1,11 +1,11 @@
SyncFinished in iroh_docs::net - Rust Struct iroh_docs::net::SyncFinished
source · pub struct SyncFinished {
pub namespace: NamespaceId,
- pub peer: PublicKey,
+ pub peer: PublicKey,
pub outcome: SyncOutcome,
pub timings: Timings,
}
Expand description
Details of a finished sync operation.
Fields§
§namespace: NamespaceIdThe namespace that was synced.
-§peer: PublicKeyThe peer we syned with.
+§peer: PublicKeyThe peer we syned with.
§outcome: SyncOutcomeThe outcome of the sync operation
§timings: TimingsThe time this operation took
Trait Implementations§
source§impl Clone for SyncFinished
source§fn clone(&self) -> SyncFinished
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moreAuto Trait Implementations§
§impl Freeze for SyncFinished
§impl RefUnwindSafe for SyncFinished
§impl Send for SyncFinished
§impl Sync for SyncFinished
§impl Unpin for SyncFinished
§impl UnwindSafe for SyncFinished
Blanket Implementations§
source§impl<T> Any for Twhere
diff --git a/pr/2595/docs/iroh_docs/store/fs/struct.ContentHashesIterator.html b/pr/2595/docs/iroh_docs/store/fs/struct.ContentHashesIterator.html
index 8bebf68ec6..df1fc8865f 100644
--- a/pr/2595/docs/iroh_docs/store/fs/struct.ContentHashesIterator.html
+++ b/pr/2595/docs/iroh_docs/store/fs/struct.ContentHashesIterator.html
@@ -6,7 +6,7 @@ It needs a copy of a redb::ReadOnlyTable to be self-contained.
Implementations§
Trait Implementations§
source§impl Debug for ContentHashesIterator
Trait Implementations§
source§impl Debug for ContentHashesIterator
source§impl Iterator for ContentHashesIterator
source§fn next(&mut self) -> Option<Self::Item>
Advances the iterator and returns the next value. Read moresource§fn next_chunk<const N: usize>(
&mut self
) -> Result<[Self::Item; N], IntoIter<Self::Item, N>>where
Self: Sized,
🔬This is a nightly-only experimental API. (iter_next_chunk)Advances the iterator and returns an array containing the next N values. Read more1.0.0 · source§fn size_hint(&self) -> (usize, Option<usize>)
Returns the bounds on the remaining length of the iterator. Read more1.0.0 · source§fn count(self) -> usizewhere
diff --git a/pr/2595/docs/iroh_docs/struct.AuthorId.html b/pr/2595/docs/iroh_docs/struct.AuthorId.html
index 7dfa3dea5b..02221b0eb6 100644
--- a/pr/2595/docs/iroh_docs/struct.AuthorId.html
+++ b/pr/2595/docs/iroh_docs/struct.AuthorId.html
@@ -156,6 +156,6 @@ letters are used (e.g. F9B4CA)
Into<Dispatch>, source§fn with_current_subscriber(self) -> WithDispatch<Self>
source§impl<T> DeserializeOwned for Twhere
- T: for<'de> Deserialize<'de>,
§impl<T> PeerIdentity for Twhere
+ T: for<'de> Deserialize<'de>,
source§impl<T> PeerIdentity for T
source§impl<T> RuleType for T
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_docs/struct.AuthorPublicKey.html b/pr/2595/docs/iroh_docs/struct.AuthorPublicKey.html
index 8e72b11c8a..7a83ce68e4 100644
--- a/pr/2595/docs/iroh_docs/struct.AuthorPublicKey.html
+++ b/pr/2595/docs/iroh_docs/struct.AuthorPublicKey.html
@@ -148,6 +148,6 @@ builds. Into<Dispatch>,source§fn with_current_subscriber(self) -> WithDispatch<Self>
source§impl<T> DeserializeOwned for Twhere
- T: for<'de> Deserialize<'de>,
§impl<T> PeerIdentity for Twhere
+ T: for<'de> Deserialize<'de>,
source§impl<T> PeerIdentity for T
source§impl<T> RuleType for T
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_docs/struct.DocTicket.html b/pr/2595/docs/iroh_docs/struct.DocTicket.html
index d53a93c4c4..fd1bb5eb02 100644
--- a/pr/2595/docs/iroh_docs/struct.DocTicket.html
+++ b/pr/2595/docs/iroh_docs/struct.DocTicket.html
@@ -1,13 +1,13 @@
DocTicket in iroh_docs - Rust pub struct DocTicket {
pub capability: Capability,
- pub nodes: Vec<NodeAddr>,
+ pub nodes: Vec<NodeAddr>,
}
Expand description
Contains both a key (either secret or public) to a document, and a list of peers to join.
Fields§
§capability: Capabilityeither a public or private key
-§nodes: Vec<NodeAddr>A list of nodes to contact.
-Implementations§
source§impl DocTicket
sourcepub fn new(capability: Capability, peers: Vec<NodeAddr>) -> Self
Create a new doc ticket
+§nodes: Vec<NodeAddr>A list of nodes to contact.
+Implementations§
Trait Implementations§
source§impl<'de> Deserialize<'de> for DocTicket
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
- __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreAuto Trait Implementations§
§impl Freeze for DocTicket
§impl RefUnwindSafe for DocTicket
§impl Send for DocTicket
§impl Sync for DocTicket
§impl Unpin for DocTicket
§impl UnwindSafe for DocTicket
Blanket Implementations§
source§impl<T> Any for Twhere
+ __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreAuto Trait Implementations§
§impl Freeze for DocTicket
§impl RefUnwindSafe for DocTicket
§impl Send for DocTicket
§impl Sync for DocTicket
§impl Unpin for DocTicket
§impl UnwindSafe for DocTicket
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
diff --git a/pr/2595/docs/iroh_docs/struct.NamespaceId.html b/pr/2595/docs/iroh_docs/struct.NamespaceId.html
index 433d51afc6..f9acda8e94 100644
--- a/pr/2595/docs/iroh_docs/struct.NamespaceId.html
+++ b/pr/2595/docs/iroh_docs/struct.NamespaceId.html
@@ -156,6 +156,6 @@ letters are used (e.g. F9B4CA)
Into<Dispatch>, source§fn with_current_subscriber(self) -> WithDispatch<Self>
source§impl<T> DeserializeOwned for Twhere
- T: for<'de> Deserialize<'de>,
§impl<T> PeerIdentity for Twhere
+ T: for<'de> Deserialize<'de>,
source§impl<T> PeerIdentity for T
source§impl<T> RuleType for T
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_docs/struct.NamespacePublicKey.html b/pr/2595/docs/iroh_docs/struct.NamespacePublicKey.html
index 350dea9049..72b75ed510 100644
--- a/pr/2595/docs/iroh_docs/struct.NamespacePublicKey.html
+++ b/pr/2595/docs/iroh_docs/struct.NamespacePublicKey.html
@@ -147,6 +147,6 @@ builds.Into<Dispatch>,source§fn with_current_subscriber(self) -> WithDispatch<Self>
source§impl<T> DeserializeOwned for Twhere
- T: for<'de> Deserialize<'de>,
§impl<T> PeerIdentity for Twhere
+ T: for<'de> Deserialize<'de>,
source§impl<T> PeerIdentity for T
source§impl<T> RuleType for T
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_docs/sync/struct.Entry.html b/pr/2595/docs/iroh_docs/sync/struct.Entry.html
index 55bf06044f..055a4b6f54 100644
--- a/pr/2595/docs/iroh_docs/sync/struct.Entry.html
+++ b/pr/2595/docs/iroh_docs/sync/struct.Entry.html
@@ -1,6 +1,6 @@
Entry in iroh_docs::sync - Rust pub struct Entry { /* private fields */ }
Expand description
A single entry in a Replica
An entry is identified by a key, its Author, and the Replica’s
-NamespaceSecret. Its value is the 32-byte BLAKE3 hash
+NamespaceSecret. Its value is the 32-byte BLAKE3 hash
of the entry’s content data, the size of this content data, and a timestamp.
Implementations§
source§impl Entry
sourcepub fn new(id: RecordIdentifier, record: Record) -> Self
Create a new entry
sourcepub fn new_empty(id: RecordIdentifier) -> Self
Create a new empty entry with the current timestamp.
@@ -15,7 +15,7 @@ of the entry’s content data, the size of this content data, and a timestamp.
sourcepub fn sign(self, namespace: &NamespaceSecret, author: &Author) -> SignedEntry
Sign this entry with a NamespaceSecret and Author.
Methods from Deref<Target = Record>§
sourcepub fn content_len(&self) -> u64
Get the length of the data addressed by this record’s content hash.
-sourcepub fn content_hash(&self) -> Hash
Get the [struct@Hash] of the content data of this record.
+sourcepub fn content_hash(&self) -> Hash
Get the Hash of the content data of this record.
Trait Implementations§
source§impl<'de> Deserialize<'de> for Entry
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl From<SignedEntry> for Entry
source§fn from(value: SignedEntry) -> Self
Converts to this type from the input type.source§impl Ord for Entry
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
diff --git a/pr/2595/docs/iroh_docs/sync/struct.Record.html b/pr/2595/docs/iroh_docs/sync/struct.Record.html
index 94479a973e..f06cccab52 100644
--- a/pr/2595/docs/iroh_docs/sync/struct.Record.html
+++ b/pr/2595/docs/iroh_docs/sync/struct.Record.html
@@ -1,11 +1,11 @@
Record in iroh_docs::sync - Rust pub struct Record { /* private fields */ }
Expand description
The data part of an entry in a Replica.
-Implementations§
source§impl Record
Implementations§
source§impl Record
sourcepub fn empty_current() -> Self
Create a tombstone record with the timestamp set to now.
sourcepub fn new_current(hash: Hash, len: u64) -> Self
Create a new Record with the timestamp set to now.
+sourcepub fn new_current(hash: Hash, len: u64) -> Self
Create a new Record with the timestamp set to now.
sourcepub fn content_len(&self) -> u64
Get the length of the data addressed by this record’s content hash.
-sourcepub fn content_hash(&self) -> Hash
Get the [struct@Hash] of the content data of this record.
+sourcepub fn content_hash(&self) -> Hash
Get the Hash of the content data of this record.
Trait Implementations§
source§impl<'de> Deserialize<'de> for Record
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl Ord for Record
Ordering for entry values.
diff --git a/pr/2595/docs/iroh_docs/sync/struct.Replica.html b/pr/2595/docs/iroh_docs/sync/struct.Replica.html
index 23a9798651..c4e161f3c3 100644
--- a/pr/2595/docs/iroh_docs/sync/struct.Replica.html
+++ b/pr/2595/docs/iroh_docs/sync/struct.Replica.html
@@ -5,7 +5,7 @@
&mut self,
key: impl AsRef<[u8]>,
author: &Author,
- hash: Hash,
+ hash: Hash,
len: u64
) -> Result<usize, InsertError>Insert a new record at the given key.
The entry will by signed by the provided author.
@@ -35,7 +35,7 @@ or an error if the entry failed to validate or if a store operation failed.
key: impl AsRef<[u8]>,
author: &Author,
data: impl AsRef<[u8]>
-) -> Result<Hash, InsertError>Hashes the given data and inserts it.
+) -> Result<Hash, InsertError>Hashes the given data and inserts it.
This does not store the content, just the record of it.
Returns the calculated hash.
sourcepub fn record_id(
diff --git a/pr/2595/docs/iroh_docs/sync/struct.SignedEntry.html b/pr/2595/docs/iroh_docs/sync/struct.SignedEntry.html
index 21644eacb1..9ef5e98134 100644
--- a/pr/2595/docs/iroh_docs/sync/struct.SignedEntry.html
+++ b/pr/2595/docs/iroh_docs/sync/struct.SignedEntry.html
@@ -14,7 +14,7 @@
sourcepub fn signature(&self) -> &EntrySignature
Get the signature.
sourcepub fn validate_empty(&self) -> Result<(), ValidationFailure>
Validate that the entry has the empty hash if the length is 0, or a non-zero length.
sourcepub fn content_hash(&self) -> Hash
Get the content [struct@Hash] of the entry.
+sourcepub fn content_hash(&self) -> Hash
Get the content Hash of the entry.
sourcepub fn content_len(&self) -> u64
Get the content length of the entry.
Get the author bytes of this entry.
Methods from Deref<Target = Record>§
sourcepub fn content_len(&self) -> u64
Get the length of the data addressed by this record’s content hash.
-sourcepub fn content_hash(&self) -> Hash
Get the [struct@Hash] of the content data of this record.
+sourcepub fn content_hash(&self) -> Hash
Get the Hash of the content data of this record.
Trait Implementations§
source§impl Clone for SignedEntry
source§fn clone(&self) -> SignedEntry
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moresource§impl Debug for SignedEntry
source§impl Deref for SignedEntry
source§impl<'de> Deserialize<'de> for SignedEntry
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl From<SignedEntry> for Entry
source§fn from(value: SignedEntry) -> Self
Converts to this type from the input type.source§impl Ord for SignedEntry
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
diff --git a/pr/2595/docs/iroh_docs/sync/type.ContentStatusCallback.html b/pr/2595/docs/iroh_docs/sync/type.ContentStatusCallback.html
index 46d5a5a49c..84ffdbe8ee 100644
--- a/pr/2595/docs/iroh_docs/sync/type.ContentStatusCallback.html
+++ b/pr/2595/docs/iroh_docs/sync/type.ContentStatusCallback.html
@@ -1,2 +1,2 @@
-ContentStatusCallback in iroh_docs::sync - Rust Type Alias iroh_docs::sync::ContentStatusCallback
source · pub type ContentStatusCallback = Arc<dyn Fn(Hash) -> ContentStatus + Send + Sync + 'static>;
Expand description
Callback that may be set on a replica to determine the availability status for a content hash.
+ContentStatusCallback in iroh_docs::sync - Rust Type Alias iroh_docs::sync::ContentStatusCallback
source · pub type ContentStatusCallback = Arc<dyn Fn(Hash) -> ContentStatus + Send + Sync + 'static>;
Expand description
Callback that may be set on a replica to determine the availability status for a content hash.
Aliased Type§
struct ContentStatusCallback { /* private fields */ }
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_net/discovery/dns/index.html b/pr/2595/docs/iroh_net/discovery/dns/index.html
index 5a80538422..a752b49d78 100644
--- a/pr/2595/docs/iroh_net/discovery/dns/index.html
+++ b/pr/2595/docs/iroh_net/discovery/dns/index.html
@@ -1,2 +1,2 @@
-iroh_net::discovery::dns - Rust Expand description
DNS node discovery for iroh-net
+iroh_net::discovery::dns - Rust Expand description
DNS node discovery for iroh-net
Structs§
- DNS node discovery
Constants§
- The n0 testing DNS node origin, for production.
- The n0 testing DNS node origin, for testing.
- Testing DNS node origin, must run server from
crate::test_utils::DnsPkarrServer.
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_net/discovery/dns/struct.DnsDiscovery.html b/pr/2595/docs/iroh_net/discovery/dns/struct.DnsDiscovery.html
index 3e7d5d71cc..7628fb45a9 100644
--- a/pr/2595/docs/iroh_net/discovery/dns/struct.DnsDiscovery.html
+++ b/pr/2595/docs/iroh_net/discovery/dns/struct.DnsDiscovery.html
@@ -28,7 +28,7 @@ custom discovery mechanism.
For testing it is also possible to use the N0_DNS_NODE_ORIGIN_STAGING domain
with DnsDiscovery::new. This would then use a hosted discovery service again,
but for testing purposes.
-Trait Implementations§
Trait Implementations§
source§impl Debug for DnsDiscovery
source§impl Discovery for DnsDiscovery
source§fn resolve(
&self,
ep: Endpoint,
node_id: NodeId
diff --git a/pr/2595/docs/iroh_net/discovery/trait.Discovery.html b/pr/2595/docs/iroh_net/discovery/trait.Discovery.html
index a53a618708..d3832a56b5 100644
--- a/pr/2595/docs/iroh_net/discovery/trait.Discovery.html
+++ b/pr/2595/docs/iroh_net/discovery/trait.Discovery.html
@@ -29,4 +29,4 @@ These tasks will be run on the runtime of the Option<BoxStream<Result<DiscoveryItem>>>
Implementors§
source§impl Discovery for DnsDiscovery
source§impl Discovery for LocalSwarmDiscovery
source§impl Discovery for PkarrPublisher
source§impl Discovery for PkarrResolver
source§impl Discovery for ConcurrentDiscovery
\ No newline at end of file
+
Implementors§
source§impl Discovery for DnsDiscovery
source§impl Discovery for LocalSwarmDiscovery
source§impl Discovery for PkarrPublisher
source§impl Discovery for PkarrResolver
source§impl Discovery for ConcurrentDiscovery
\ No newline at end of file
diff --git a/pr/2595/docs/src/iroh_net/discovery/dns.rs.html b/pr/2595/docs/src/iroh_net/discovery/dns.rs.html
index dd1a279fb3..1d32545ed3 100644
--- a/pr/2595/docs/src/iroh_net/discovery/dns.rs.html
+++ b/pr/2595/docs/src/iroh_net/discovery/dns.rs.html
@@ -97,6 +97,10 @@
97
98
99
+100
+101
+102
+103
//! DNS node discovery for iroh-net
use anyhow::Result;
@@ -182,6 +186,10 @@
fn resolve(&self, ep: Endpoint, node_id: NodeId) -> Option<BoxStream<Result<DiscoveryItem>>> {
let resolver = ep.dns_resolver().clone();
let origin_domain = self.origin_domain.clone();
+ #[cfg(any(test, feature = "test-utils"))]
+ if origin_domain.contains(&TEST_DNS_NODE_ORIGIN.to_string()) {
+ panic!("wait. THIS IS ILLEGAL!");
+ }
let fut = async move {
let node_addr = resolver
.lookup_by_id_staggered(&node_id, &origin_domain, DNS_STAGGERING_MS)
diff --git a/pr/2595/docs/trait.impl/iroh_base/ticket/trait.Ticket.js b/pr/2595/docs/trait.impl/iroh_base/ticket/trait.Ticket.js
index 12fa1e3ee5..5d209fabd2 100644
--- a/pr/2595/docs/trait.impl/iroh_base/ticket/trait.Ticket.js
+++ b/pr/2595/docs/trait.impl/iroh_base/ticket/trait.Ticket.js
@@ -1,5 +1,5 @@
(function() {var implementors = {
"iroh":[],
"iroh_base":[],
-"iroh_docs":[["impl Ticket for DocTicket"]]
+"iroh_docs":[["impl Ticket for DocTicket"]]
};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
diff --git a/pr/2595/docs/type.impl/std/primitive.array.js b/pr/2595/docs/type.impl/std/primitive.array.js
index 588a8b53a3..3006964922 100644
--- a/pr/2595/docs/type.impl/std/primitive.array.js
+++ b/pr/2595/docs/type.impl/std/primitive.array.js
@@ -1,4 +1,4 @@
(function() {var type_impls = {
"iroh":[["source§impl<T, const N: usize> [T; N]
1.55.0 · sourcepub fn map<F, U>(self, f: F) -> [U; N]where\n F: FnMut(T) -> U,
Returns an array of the same size as self, with function f applied to each element\nin order.
\nIf you don’t necessarily need a new fixed-size array, consider using\nIterator::map instead.
\n§Note on performance and stack usage
\nUnfortunately, usages of this method are currently not always optimized\nas well as they could be. This mainly concerns large arrays, as mapping\nover small arrays seem to be optimized just fine. Also note that in\ndebug mode (i.e. without any optimizations), this method can use a lot\nof stack space (a few times the size of the array or more).
\nTherefore, in performance-critical code, try to avoid using this method\non large arrays or check the emitted code. Also try to avoid chained\nmaps (e.g. arr.map(...).map(...)).
\nIn many cases, you can instead use Iterator::map by calling .iter()\nor .into_iter() on your array. [T; N]::map is only necessary if you\nreally need a new array of the same size as the result. Rust’s lazy\niterators tend to get optimized very well.
\n§Examples
\nlet x = [1, 2, 3];\nlet y = x.map(|v| v + 1);\nassert_eq!(y, [2, 3, 4]);\n\nlet x = [1, 2, 3];\nlet mut temp = 0;\nlet y = x.map(|v| { temp += 1; v * temp });\nassert_eq!(y, [1, 4, 9]);\n\nlet x = [\"Ferris\", \"Bueller's\", \"Day\", \"Off\"];\nlet y = x.map(|v| v.len());\nassert_eq!(y, [6, 9, 3, 3]);
\nsourcepub fn try_map<F, R>(\n self,\n f: F\n) -> <<R as Try>::Residual as Residual<[<R as Try>::Output; N]>>::TryType
🔬This is a nightly-only experimental API. (array_try_map)
A fallible function f applied to each element on array self in order to\nreturn an array the same size as self or the first error encountered.
\nThe return type of this function depends on the return type of the closure.\nIf you return Result<T, E> from the closure, you’ll get a Result<[T; N], E>.\nIf you return Option<T> from the closure, you’ll get an Option<[T; N]>.
\n§Examples
\n#![feature(array_try_map)]\n\nlet a = [\"1\", \"2\", \"3\"];\nlet b = a.try_map(|v| v.parse::<u32>()).unwrap().map(|v| v + 1);\nassert_eq!(b, [2, 3, 4]);\n\nlet a = [\"1\", \"2a\", \"3\"];\nlet b = a.try_map(|v| v.parse::<u32>());\nassert!(b.is_err());\n\nuse std::num::NonZero;\n\nlet z = [1, 2, 0, 3, 4];\nassert_eq!(z.try_map(NonZero::new), None);\n\nlet a = [1, 2, 3];\nlet b = a.try_map(NonZero::new);\nlet c = b.map(|x| x.map(NonZero::get));\nassert_eq!(c, Some(a));
\n1.57.0 (const: 1.57.0) · sourcepub const fn as_slice(&self) -> &[T]
Returns a slice containing the entire array. Equivalent to &s[..].
\n1.57.0 · sourcepub fn as_mut_slice(&mut self) -> &mut [T]
Returns a mutable slice containing the entire array. Equivalent to\n&mut s[..].
\n1.77.0 · sourcepub fn each_ref(&self) -> [&T; N]
Borrows each element and returns an array of references with the same\nsize as self.
\n§Example
\nlet floats = [3.1, 2.7, -1.0];\nlet float_refs: [&f64; 3] = floats.each_ref();\nassert_eq!(float_refs, [&3.1, &2.7, &-1.0]);
\nThis method is particularly useful if combined with other methods, like\nmap. This way, you can avoid moving the original\narray if its elements are not Copy.
\n\nlet strings = [\"Ferris\".to_string(), \"♥\".to_string(), \"Rust\".to_string()];\nlet is_ascii = strings.each_ref().map(|s| s.is_ascii());\nassert_eq!(is_ascii, [true, false, true]);\n\n// We can still access the original array: it has not been moved.\nassert_eq!(strings.len(), 3);
\n1.77.0 · sourcepub fn each_mut(&mut self) -> [&mut T; N]
Borrows each element mutably and returns an array of mutable references\nwith the same size as self.
\n§Example
\n\nlet mut floats = [3.1, 2.7, -1.0];\nlet float_refs: [&mut f64; 3] = floats.each_mut();\n*float_refs[0] = 0.0;\nassert_eq!(float_refs, [&mut 0.0, &mut 2.7, &mut -1.0]);\nassert_eq!(floats, [0.0, 2.7, -1.0]);
\nsourcepub fn split_array_ref<const M: usize>(&self) -> (&[T; M], &[T])
🔬This is a nightly-only experimental API. (split_array)
Divides one array reference into two at an index.
\nThe first will contain all indices from [0, M) (excluding\nthe index M itself) and the second will contain all\nindices from [M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet v = [1, 2, 3, 4, 5, 6];\n\n{\n let (left, right) = v.split_array_ref::<0>();\n assert_eq!(left, &[]);\n assert_eq!(right, &[1, 2, 3, 4, 5, 6]);\n}\n\n{\n let (left, right) = v.split_array_ref::<2>();\n assert_eq!(left, &[1, 2]);\n assert_eq!(right, &[3, 4, 5, 6]);\n}\n\n{\n let (left, right) = v.split_array_ref::<6>();\n assert_eq!(left, &[1, 2, 3, 4, 5, 6]);\n assert_eq!(right, &[]);\n}
\nsourcepub fn split_array_mut<const M: usize>(&mut self) -> (&mut [T; M], &mut [T])
🔬This is a nightly-only experimental API. (split_array)
Divides one mutable array reference into two at an index.
\nThe first will contain all indices from [0, M) (excluding\nthe index M itself) and the second will contain all\nindices from [M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet mut v = [1, 0, 3, 0, 5, 6];\nlet (left, right) = v.split_array_mut::<2>();\nassert_eq!(left, &mut [1, 0][..]);\nassert_eq!(right, &mut [3, 0, 5, 6]);\nleft[1] = 2;\nright[1] = 4;\nassert_eq!(v, [1, 2, 3, 4, 5, 6]);
\nsourcepub fn rsplit_array_ref<const M: usize>(&self) -> (&[T], &[T; M])
🔬This is a nightly-only experimental API. (split_array)
Divides one array reference into two at an index from the end.
\nThe first will contain all indices from [0, N - M) (excluding\nthe index N - M itself) and the second will contain all\nindices from [N - M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet v = [1, 2, 3, 4, 5, 6];\n\n{\n let (left, right) = v.rsplit_array_ref::<0>();\n assert_eq!(left, &[1, 2, 3, 4, 5, 6]);\n assert_eq!(right, &[]);\n}\n\n{\n let (left, right) = v.rsplit_array_ref::<2>();\n assert_eq!(left, &[1, 2, 3, 4]);\n assert_eq!(right, &[5, 6]);\n}\n\n{\n let (left, right) = v.rsplit_array_ref::<6>();\n assert_eq!(left, &[]);\n assert_eq!(right, &[1, 2, 3, 4, 5, 6]);\n}
\nsourcepub fn rsplit_array_mut<const M: usize>(&mut self) -> (&mut [T], &mut [T; M])
🔬This is a nightly-only experimental API. (split_array)
Divides one mutable array reference into two at an index from the end.
\nThe first will contain all indices from [0, N - M) (excluding\nthe index N - M itself) and the second will contain all\nindices from [N - M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet mut v = [1, 0, 3, 0, 5, 6];\nlet (left, right) = v.rsplit_array_mut::<4>();\nassert_eq!(left, &mut [1, 0]);\nassert_eq!(right, &mut [3, 0, 5, 6][..]);\nleft[1] = 2;\nright[1] = 4;\nassert_eq!(v, [1, 2, 3, 4, 5, 6]);
\n",0,"iroh::docs::PeerIdBytes"],["source§impl<const N: usize> [u8; N]
sourcepub const fn as_ascii(&self) -> Option<&[AsciiChar; N]>
🔬This is a nightly-only experimental API. (ascii_char)
Converts this array of bytes into a array of ASCII characters,\nor returns None if any of the characters is non-ASCII.
\n§Examples
\n#![feature(ascii_char)]\n#![feature(const_option)]\n\nconst HEX_DIGITS: [std::ascii::Char; 16] =\n *b\"0123456789abcdef\".as_ascii().unwrap();\n\nassert_eq!(HEX_DIGITS[1].as_str(), \"1\");\nassert_eq!(HEX_DIGITS[10].as_str(), \"a\");
\nsourcepub const unsafe fn as_ascii_unchecked(&self) -> &[AsciiChar; N]
🔬This is a nightly-only experimental API. (ascii_char)
Converts this array of bytes into a array of ASCII characters,\nwithout checking whether they’re valid.
\n§Safety
\nEvery byte in the array must be in 0..=127, or else this is UB.
\n",0,"iroh::docs::PeerIdBytes"],["§impl<T> Array for [T; 32]where\n T: Default,
§fn as_slice_mut(&mut self) -> &mut [T]
Gives a unique slice over the whole thing. Read more","Array","iroh::docs::PeerIdBytes"],["","Array","iroh::docs::PeerIdBytes"],["§impl<const N: usize, T> AsBytes for [T; N]where\n T: AsBytes,
§fn write_to_prefix(&self, bytes: &mut [u8]) -> Option<()>
","AsBytes","iroh::docs::PeerIdBytes"],["","AsBytes","iroh::docs::PeerIdBytes"],["","AsMut<[T]>","iroh::docs::PeerIdBytes"],["","AsRef<[T]>","iroh::docs::PeerIdBytes"],["§impl<T, const N: usize> BitView for [T; N]where\n T: BitStore,
Note that overly-large arrays may cause the conversions to fail.
\n§fn view_bits<O>(&self) -> &BitSlice<T, O>where\n O: BitOrder,
Views a memory region as an immutable bit-slice.§fn try_view_bits<O>(&self) -> Result<&BitSlice<T, O>, BitSpanError<T>>where\n O: BitOrder,
Attempts to view a memory region as an immutable bit-slice. Read more§fn view_bits_mut<O>(&mut self) -> &mut BitSlice<T, O>where\n O: BitOrder,
Views a memory region as a mutable bit-slice.§fn try_view_bits_mut<O>(\n &mut self\n) -> Result<&mut BitSlice<T, O>, BitSpanError<T>>where\n O: BitOrder,
Attempts to view a memory region as a mutable bit-slice. Read more","BitView","iroh::docs::PeerIdBytes"],["§impl<T, const N: usize> BitViewSized for [T; N]where\n T: BitStore,
§fn as_raw_slice(&self) -> &[<[T; N] as BitView>::Store]
Views the type as a slice of its elements.§fn as_raw_mut_slice(&mut self) -> &mut [<[T; N] as BitView>::Store]
Views the type as a mutable slice of its elements.§fn into_bitarray<O>(self) -> BitArray<Self, O>where\n O: BitOrder,
Wraps self in a BitArray.","BitViewSized","iroh::docs::PeerIdBytes"],["","Borrow<[T]>","iroh::docs::PeerIdBytes"],["1.4.0 · source§impl<T, const N: usize> BorrowMut<[T]> for [T; N]
source§fn borrow_mut(&mut self) -> &mut [T]
Mutably borrows from an owned value. Read more","BorrowMut<[T]>","iroh::docs::PeerIdBytes"],["","Chain","iroh::docs::PeerIdBytes"],["","Clone","iroh::docs::PeerIdBytes"],["","Debug","iroh::docs::PeerIdBytes"],["§impl<const N: usize> Decode for [u8; N]
Decodes a byte array from byte[n] as described in RFC4251 § 5:
\n\nA byte represents an arbitrary 8-bit value (octet). Fixed length\ndata is sometimes represented as an array of bytes, written\nbyte[n], where n is the number of bytes in the array.
\n
\n","Decode","iroh::docs::PeerIdBytes"],["§impl<'a, T, const N: usize> DecodeValue<'a> for [T; N]where\n T: Decode<'a>,
§fn decode_value<R>(reader: &mut R, header: Header) -> Result<[T; N], Error>where\n R: Reader<'a>,
Attempt to decode this message using the provided [Reader].","DecodeValue<'a>","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["source§impl<'de, T> Deserialize<'de> for [T; 32]where\n T: Deserialize<'de>,
source§fn deserialize<D>(\n deserializer: D\n) -> Result<[T; 32], <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more","Deserialize<'de>","iroh::docs::PeerIdBytes"],["source§impl<'de, const N: usize> Deserialize<'de> for [u8; N]
source§fn deserialize<D>(\n deserializer: D\n) -> Result<[u8; N], <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
","Deserialize<'de>","iroh::docs::PeerIdBytes"],["§impl<const N: usize> Encode for [u8; N]
Encodes [u8; N] into byte[n] as described in RFC4251 § 5:
\n\nA byte represents an arbitrary 8-bit value (octet). Fixed length\ndata is sometimes represented as an array of bytes, written\nbyte[n], where n is the number of bytes in the array.
\n
\n§fn encoded_len(&self) -> Result<usize, Error>
Get the length of this type encoded in bytes, prior to Base64 encoding.§fn encode(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value using the provided [Writer].§fn encoded_len_prefixed(&self) -> Result<usize, Error>
Return the length of this type after encoding when prepended with a\nuint32 length prefix.§fn encode_prefixed(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value, first prepending a uint32 length prefix\nset to [Encode::encoded_len].","Encode","iroh::docs::PeerIdBytes"],["","EncodeLabelSet","iroh::docs::PeerIdBytes"],["§impl<T, const N: usize> EncodeValue for [T; N]where\n T: Encode,
","EncodeValue","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["§impl<'a> FindToken<&'a u8> for [u8; 32]
§fn find_token(&self, token: &u8) -> bool
Returns true if self contains the token","FindToken<&'a u8>","iroh::docs::PeerIdBytes"],["§impl FindToken<u8> for [u8; 32]
§fn find_token(&self, token: u8) -> bool
Returns true if self contains the token","FindToken","iroh::docs::PeerIdBytes"],["","FixedTag","iroh::docs::PeerIdBytes"],["","From<&Signature>","iroh::docs::PeerIdBytes"],["","From","iroh::docs::PeerIdBytes"],["§impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>>> for [T; 32]
","From, B0>, B0>, B0>, B0>, B0>>>","iroh::docs::PeerIdBytes"],["","From","iroh::docs::PeerIdBytes"],["","From","iroh::docs::PeerIdBytes"],["","From>","iroh::docs::PeerIdBytes"],["","From","iroh::docs::PeerIdBytes"],["","From","iroh::docs::PeerIdBytes"],["","From","iroh::docs::PeerIdBytes"],["","From>","iroh::docs::PeerIdBytes"],["§impl<const N: usize, T> FromBytes for [T; N]where\n T: FromBytes,
§fn slice_from_prefix(bytes: &[u8], count: usize) -> Option<(&[Self], &[u8])>where\n Self: Sized,
Interprets the prefix of the given bytes as a &[Self] with length\nequal to count without copying. Read more§fn slice_from_suffix(bytes: &[u8], count: usize) -> Option<(&[u8], &[Self])>where\n Self: Sized,
Interprets the suffix of the given bytes as a &[Self] with length\nequal to count without copying. Read more§fn read_from_prefix(bytes: &[u8]) -> Option<Self>where\n Self: Sized,
","FromBytes","iroh::docs::PeerIdBytes"],["","FromHex","iroh::docs::PeerIdBytes"],["","FromZeroes","iroh::docs::PeerIdBytes"],["","Hash","iroh::docs::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Hash for [T; N]where\n T: Hash,
The hash of an array is the same as that of the corresponding slice,\nas required by the Borrow implementation.
\n\nuse std::hash::BuildHasher;\n\nlet b = std::hash::RandomState::new();\nlet a: [u8; 3] = [0xa8, 0x3c, 0x09];\nlet s: &[u8] = &[0xa8, 0x3c, 0x09];\nassert_eq!(b.hash_one(a), b.hash_one(s));
\n","Hash","iroh::docs::PeerIdBytes"],["","Index","iroh::docs::PeerIdBytes"],["","IndexMut","iroh::docs::PeerIdBytes"],["","InputLength","iroh::docs::PeerIdBytes"],["1.53.0 · source§impl<T, const N: usize> IntoIterator for [T; N]
source§fn into_iter(self) -> <[T; N] as IntoIterator>::IntoIter
Creates a consuming iterator, that is, one that moves each value out of\nthe array (from start to end). The array cannot be used after calling\nthis unless T implements Copy, so the whole array is copied.
\nArrays have special behavior when calling .into_iter() prior to the\n2021 edition – see the array Editions section for more information.
\n","IntoIterator","iroh::docs::PeerIdBytes"],["§impl<const N: usize> IntoResponse for [u8; N]
§fn into_response(self) -> Response<Body>
Create a response.","IntoResponse","iroh::docs::PeerIdBytes"],["§impl<Fut, const N: usize> Join for [Fut; N]where\n Fut: IntoFuture,
§type Output = [<Fut as IntoFuture>::Output; N]
The resulting output type.§type Future = Join<<Fut as IntoFuture>::IntoFuture, N>
The Future implementation returned by this method.","Join","iroh::docs::PeerIdBytes"],["","Key","iroh::docs::PeerIdBytes"],["§impl<T, const N: usize> MaxSize for [T; N]where\n T: MaxSize,
§const POSTCARD_MAX_SIZE: usize = _
The maximum possible size that the serialization of this\ntype can have, in bytes.","MaxSize","iroh::docs::PeerIdBytes"],["","Merge","iroh::docs::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Ord for [T; N]where\n T: Ord,
Implements comparison of arrays lexicographically.
\n1.21.0 · source§fn max(self, other: Self) -> Selfwhere\n Self: Sized,
Compares and returns the maximum of two values. Read more","Ord","iroh::docs::PeerIdBytes"],["","PartialEq<&[U]>","iroh::docs::PeerIdBytes"],["1.0.0 · source§impl<T, U, const N: usize> PartialEq<&mut [U]> for [T; N]where\n T: PartialEq<U>,
","PartialEq<&mut [U]>","iroh::docs::PeerIdBytes"],["","PartialEq<[U]>","iroh::docs::PeerIdBytes"],["","PartialEq<[U; N]>","iroh::docs::PeerIdBytes"],["","PartialEq","iroh::docs::PeerIdBytes"],["§impl<A, B, const N: usize, const M: usize> PartialEq<Vec<A, N>> for [B; M]where\n A: PartialEq<B>,
","PartialEq>","iroh::docs::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> PartialOrd for [T; N]where\n T: PartialOrd,
Implements comparison of arrays lexicographically.
\nsource§fn le(&self, other: &[T; N]) -> bool
This method tests less than or equal to (for self and other) and is used by the <=\noperator. Read more","PartialOrd","iroh::docs::PeerIdBytes"],["§impl<Fut, const N: usize> Race for [Fut; N]where\n Fut: IntoFuture,
§type Output = <Fut as IntoFuture>::Output
The resulting output type.§type Future = Race<<Fut as IntoFuture>::IntoFuture, N>
Which kind of future are we turning this into?","Race","iroh::docs::PeerIdBytes"],["§impl<Fut, T, E, const N: usize> RaceOk for [Fut; N]where\n Fut: IntoFuture<Output = Result<T, E>>,
§type Future = RaceOk<<Fut as IntoFuture>::IntoFuture, T, E, N>
Which kind of future are we turning this into?","RaceOk","iroh::docs::PeerIdBytes"],["","Schema","iroh::docs::PeerIdBytes"],["source§impl<T> Serialize for [T; 32]where\n T: 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","iroh::docs::PeerIdBytes"],["source§impl<const N: usize> Serialize for [u8; N]
source§fn serialize<S>(\n &self,\n serializer: S\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where\n S: Serializer,
","Serialize","iroh::docs::PeerIdBytes"],["1.51.0 · source§impl<T, const N: usize> SlicePattern for [T; N]
","SlicePattern","iroh::docs::PeerIdBytes"],["1.34.0 · source§impl<T, const N: usize> TryFrom<&[T]> for [T; N]where\n T: Copy,
Tries to create an array [T; N] by copying from a slice &[T]. Succeeds if\nslice.len() == N.
\n\nlet bytes: [u8; 3] = [1, 0, 2];\n\nlet bytes_head: [u8; 2] = <[u8; 2]>::try_from(&bytes[0..2]).unwrap();\nassert_eq!(1, u16::from_le_bytes(bytes_head));\n\nlet bytes_tail: [u8; 2] = bytes[1..3].try_into().unwrap();\nassert_eq!(512, u16::from_le_bytes(bytes_tail));
\n§type Error = TryFromSliceError
The type returned in the event of a conversion error.","TryFrom<&[T]>","iroh::docs::PeerIdBytes"],["1.59.0 · source§impl<T, const N: usize> TryFrom<&mut [T]> for [T; N]where\n T: Copy,
Tries to create an array [T; N] by copying from a mutable slice &mut [T].\nSucceeds if slice.len() == N.
\n\nlet mut bytes: [u8; 3] = [1, 0, 2];\n\nlet bytes_head: [u8; 2] = <[u8; 2]>::try_from(&mut bytes[0..2]).unwrap();\nassert_eq!(1, u16::from_le_bytes(bytes_head));\n\nlet bytes_tail: [u8; 2] = (&mut bytes[1..3]).try_into().unwrap();\nassert_eq!(512, u16::from_le_bytes(bytes_tail));
\n§type Error = TryFromSliceError
The type returned in the event of a conversion error.","TryFrom<&mut [T]>","iroh::docs::PeerIdBytes"],["§impl<T, A, const N: usize> TryFrom<Vec<T, A>> for [T; N]where\n A: Allocator,
§fn try_from(vec: Vec<T, A>) -> Result<[T; N], Vec<T, A>>
Gets the entire contents of the Vec<T> as an array,\nif its size exactly matches that of the requested array.
\n§Examples
\nassert_eq!(vec![1, 2, 3].try_into(), Ok([1, 2, 3]));\nassert_eq!(<Vec<i32>>::new().try_into(), Ok([]));
\nIf the length doesn’t match, the input comes back in Err:
\n\nlet r: Result<[i32; 4], _> = (0..10).collect::<Vec<_>>().try_into();\nassert_eq!(r, Err(vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9]));
\nIf you’re fine with just getting a prefix of the Vec<T>,\nyou can call .truncate(N) first.
\n\nlet mut v = String::from(\"hello world\").into_bytes();\nv.sort();\nv.truncate(2);\nlet [a, b]: [_; 2] = v.try_into().unwrap();\nassert_eq!(a, b' ');\nassert_eq!(b, b'd');
\n","TryFrom>","iroh::docs::PeerIdBytes"],["1.48.0 · source§impl<T, A, const N: usize> TryFrom<Vec<T, A>> for [T; N]where\n A: Allocator,
source§fn try_from(vec: Vec<T, A>) -> Result<[T; N], Vec<T, A>>
Gets the entire contents of the Vec<T> as an array,\nif its size exactly matches that of the requested array.
\n§Examples
\nassert_eq!(vec![1, 2, 3].try_into(), Ok([1, 2, 3]));\nassert_eq!(<Vec<i32>>::new().try_into(), Ok([]));
\nIf the length doesn’t match, the input comes back in Err:
\n\nlet r: Result<[i32; 4], _> = (0..10).collect::<Vec<_>>().try_into();\nassert_eq!(r, Err(vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9]));
\nIf you’re fine with just getting a prefix of the Vec<T>,\nyou can call .truncate(N) first.
\n\nlet mut v = String::from(\"hello world\").into_bytes();\nv.sort();\nv.truncate(2);\nlet [a, b]: [_; 2] = v.try_into().unwrap();\nassert_eq!(a, b' ');\nassert_eq!(b, b'd');
\n","TryFrom>","iroh::docs::PeerIdBytes"],["§impl<Fut, T, E, const N: usize> TryJoin for [Fut; N]where\n Fut: IntoFuture<Output = Result<T, E>>,
§type Future = TryJoin<<Fut as IntoFuture>::IntoFuture, T, E, N>
Which kind of future are we turning this into?","TryJoin","iroh::docs::PeerIdBytes"],["§impl<const N: usize, T> Value for [T; N]where\n T: Value,
§type SelfType<'a> = [<T as Value>::SelfType<'a>; N]\nwhere\n [T; N]: 'a
SelfType<’a> must be the same type as Self with all lifetimes replaced with ’a§type AsBytes<'a> = Vec<u8>\nwhere\n [T; N]: 'a
§fn fixed_width() -> Option<usize>
Width of a fixed type, or None for variable width§fn from_bytes<'a>(data: &'a [u8]) -> [<T as Value>::SelfType<'a>; N]where\n [T; N]: 'a,
Deserializes data\nImplementations may return a view over data, or an owned type","Value","iroh::docs::PeerIdBytes"],["","ValueOrd","iroh::docs::PeerIdBytes"],["§impl<Z, const N: usize> Zeroize for [Z; N]where\n Z: Zeroize,
Impl [Zeroize] on arrays of types that impl [Zeroize].
\n","Zeroize","iroh::docs::PeerIdBytes"],["","Zip","iroh::docs::PeerIdBytes"],["source§impl<T, const N: usize> ConstParamTy for [T; N]where\n T: ConstParamTy,
","ConstParamTy","iroh::docs::PeerIdBytes"],["1.58.0 · source§impl<T, const N: usize> Copy for [T; N]where\n T: Copy,
","Copy","iroh::docs::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Eq for [T; N]where\n T: Eq,
","Eq","iroh::docs::PeerIdBytes"],["source§impl<T, const N: usize> StructuralPartialEq for [T; N]
","StructuralPartialEq","iroh::docs::PeerIdBytes"],["§impl<const N: usize, T> Unaligned for [T; N]where\n T: Unaligned,
","Unaligned","iroh::docs::PeerIdBytes"],["§impl<Z, const N: usize> ZeroizeOnDrop for [Z; N]where\n Z: ZeroizeOnDrop,
Impl [ZeroizeOnDrop] on arrays of types that impl [ZeroizeOnDrop].
\n","ZeroizeOnDrop","iroh::docs::PeerIdBytes"]],
-"iroh_docs":[["source§impl<T, const N: usize> [T; N]
1.55.0 · sourcepub fn map<F, U>(self, f: F) -> [U; N]where\n F: FnMut(T) -> U,
Returns an array of the same size as self, with function f applied to each element\nin order.
\nIf you don’t necessarily need a new fixed-size array, consider using\nIterator::map instead.
\n§Note on performance and stack usage
\nUnfortunately, usages of this method are currently not always optimized\nas well as they could be. This mainly concerns large arrays, as mapping\nover small arrays seem to be optimized just fine. Also note that in\ndebug mode (i.e. without any optimizations), this method can use a lot\nof stack space (a few times the size of the array or more).
\nTherefore, in performance-critical code, try to avoid using this method\non large arrays or check the emitted code. Also try to avoid chained\nmaps (e.g. arr.map(...).map(...)).
\nIn many cases, you can instead use Iterator::map by calling .iter()\nor .into_iter() on your array. [T; N]::map is only necessary if you\nreally need a new array of the same size as the result. Rust’s lazy\niterators tend to get optimized very well.
\n§Examples
\nlet x = [1, 2, 3];\nlet y = x.map(|v| v + 1);\nassert_eq!(y, [2, 3, 4]);\n\nlet x = [1, 2, 3];\nlet mut temp = 0;\nlet y = x.map(|v| { temp += 1; v * temp });\nassert_eq!(y, [1, 4, 9]);\n\nlet x = [\"Ferris\", \"Bueller's\", \"Day\", \"Off\"];\nlet y = x.map(|v| v.len());\nassert_eq!(y, [6, 9, 3, 3]);
\nsourcepub fn try_map<F, R>(\n self,\n f: F\n) -> <<R as Try>::Residual as Residual<[<R as Try>::Output; N]>>::TryType
🔬This is a nightly-only experimental API. (array_try_map)
A fallible function f applied to each element on array self in order to\nreturn an array the same size as self or the first error encountered.
\nThe return type of this function depends on the return type of the closure.\nIf you return Result<T, E> from the closure, you’ll get a Result<[T; N], E>.\nIf you return Option<T> from the closure, you’ll get an Option<[T; N]>.
\n§Examples
\n#![feature(array_try_map)]\n\nlet a = [\"1\", \"2\", \"3\"];\nlet b = a.try_map(|v| v.parse::<u32>()).unwrap().map(|v| v + 1);\nassert_eq!(b, [2, 3, 4]);\n\nlet a = [\"1\", \"2a\", \"3\"];\nlet b = a.try_map(|v| v.parse::<u32>());\nassert!(b.is_err());\n\nuse std::num::NonZero;\n\nlet z = [1, 2, 0, 3, 4];\nassert_eq!(z.try_map(NonZero::new), None);\n\nlet a = [1, 2, 3];\nlet b = a.try_map(NonZero::new);\nlet c = b.map(|x| x.map(NonZero::get));\nassert_eq!(c, Some(a));
\n1.57.0 (const: 1.57.0) · sourcepub const fn as_slice(&self) -> &[T]
Returns a slice containing the entire array. Equivalent to &s[..].
\n1.57.0 · sourcepub fn as_mut_slice(&mut self) -> &mut [T]
Returns a mutable slice containing the entire array. Equivalent to\n&mut s[..].
\n1.77.0 · sourcepub fn each_ref(&self) -> [&T; N]
Borrows each element and returns an array of references with the same\nsize as self.
\n§Example
\nlet floats = [3.1, 2.7, -1.0];\nlet float_refs: [&f64; 3] = floats.each_ref();\nassert_eq!(float_refs, [&3.1, &2.7, &-1.0]);
\nThis method is particularly useful if combined with other methods, like\nmap. This way, you can avoid moving the original\narray if its elements are not Copy.
\n\nlet strings = [\"Ferris\".to_string(), \"♥\".to_string(), \"Rust\".to_string()];\nlet is_ascii = strings.each_ref().map(|s| s.is_ascii());\nassert_eq!(is_ascii, [true, false, true]);\n\n// We can still access the original array: it has not been moved.\nassert_eq!(strings.len(), 3);
\n1.77.0 · sourcepub fn each_mut(&mut self) -> [&mut T; N]
Borrows each element mutably and returns an array of mutable references\nwith the same size as self.
\n§Example
\n\nlet mut floats = [3.1, 2.7, -1.0];\nlet float_refs: [&mut f64; 3] = floats.each_mut();\n*float_refs[0] = 0.0;\nassert_eq!(float_refs, [&mut 0.0, &mut 2.7, &mut -1.0]);\nassert_eq!(floats, [0.0, 2.7, -1.0]);
\nsourcepub fn split_array_ref<const M: usize>(&self) -> (&[T; M], &[T])
🔬This is a nightly-only experimental API. (split_array)
Divides one array reference into two at an index.
\nThe first will contain all indices from [0, M) (excluding\nthe index M itself) and the second will contain all\nindices from [M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet v = [1, 2, 3, 4, 5, 6];\n\n{\n let (left, right) = v.split_array_ref::<0>();\n assert_eq!(left, &[]);\n assert_eq!(right, &[1, 2, 3, 4, 5, 6]);\n}\n\n{\n let (left, right) = v.split_array_ref::<2>();\n assert_eq!(left, &[1, 2]);\n assert_eq!(right, &[3, 4, 5, 6]);\n}\n\n{\n let (left, right) = v.split_array_ref::<6>();\n assert_eq!(left, &[1, 2, 3, 4, 5, 6]);\n assert_eq!(right, &[]);\n}
\nsourcepub fn split_array_mut<const M: usize>(&mut self) -> (&mut [T; M], &mut [T])
🔬This is a nightly-only experimental API. (split_array)
Divides one mutable array reference into two at an index.
\nThe first will contain all indices from [0, M) (excluding\nthe index M itself) and the second will contain all\nindices from [M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet mut v = [1, 0, 3, 0, 5, 6];\nlet (left, right) = v.split_array_mut::<2>();\nassert_eq!(left, &mut [1, 0][..]);\nassert_eq!(right, &mut [3, 0, 5, 6]);\nleft[1] = 2;\nright[1] = 4;\nassert_eq!(v, [1, 2, 3, 4, 5, 6]);
\nsourcepub fn rsplit_array_ref<const M: usize>(&self) -> (&[T], &[T; M])
🔬This is a nightly-only experimental API. (split_array)
Divides one array reference into two at an index from the end.
\nThe first will contain all indices from [0, N - M) (excluding\nthe index N - M itself) and the second will contain all\nindices from [N - M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet v = [1, 2, 3, 4, 5, 6];\n\n{\n let (left, right) = v.rsplit_array_ref::<0>();\n assert_eq!(left, &[1, 2, 3, 4, 5, 6]);\n assert_eq!(right, &[]);\n}\n\n{\n let (left, right) = v.rsplit_array_ref::<2>();\n assert_eq!(left, &[1, 2, 3, 4]);\n assert_eq!(right, &[5, 6]);\n}\n\n{\n let (left, right) = v.rsplit_array_ref::<6>();\n assert_eq!(left, &[]);\n assert_eq!(right, &[1, 2, 3, 4, 5, 6]);\n}
\nsourcepub fn rsplit_array_mut<const M: usize>(&mut self) -> (&mut [T], &mut [T; M])
🔬This is a nightly-only experimental API. (split_array)
Divides one mutable array reference into two at an index from the end.
\nThe first will contain all indices from [0, N - M) (excluding\nthe index N - M itself) and the second will contain all\nindices from [N - M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet mut v = [1, 0, 3, 0, 5, 6];\nlet (left, right) = v.rsplit_array_mut::<4>();\nassert_eq!(left, &mut [1, 0]);\nassert_eq!(right, &mut [3, 0, 5, 6][..]);\nleft[1] = 2;\nright[1] = 4;\nassert_eq!(v, [1, 2, 3, 4, 5, 6]);
\n",0,"iroh_docs::sync::PeerIdBytes"],["source§impl<const N: usize> [u8; N]
sourcepub const fn as_ascii(&self) -> Option<&[AsciiChar; N]>
🔬This is a nightly-only experimental API. (ascii_char)
Converts this array of bytes into a array of ASCII characters,\nor returns None if any of the characters is non-ASCII.
\n§Examples
\n#![feature(ascii_char)]\n#![feature(const_option)]\n\nconst HEX_DIGITS: [std::ascii::Char; 16] =\n *b\"0123456789abcdef\".as_ascii().unwrap();\n\nassert_eq!(HEX_DIGITS[1].as_str(), \"1\");\nassert_eq!(HEX_DIGITS[10].as_str(), \"a\");
\nsourcepub const unsafe fn as_ascii_unchecked(&self) -> &[AsciiChar; N]
🔬This is a nightly-only experimental API. (ascii_char)
Converts this array of bytes into a array of ASCII characters,\nwithout checking whether they’re valid.
\n§Safety
\nEvery byte in the array must be in 0..=127, or else this is UB.
\n",0,"iroh_docs::sync::PeerIdBytes"],["§impl<T> Array for [T; 32]where\n T: Default,
§fn as_slice_mut(&mut self) -> &mut [T]
Gives a unique slice over the whole thing. Read more","Array","iroh_docs::sync::PeerIdBytes"],["","Array","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> AsBytes for [T; N]where\n T: AsBytes,
§fn write_to_prefix(&self, bytes: &mut [u8]) -> Option<()>
","AsBytes","iroh_docs::sync::PeerIdBytes"],["","AsBytes","iroh_docs::sync::PeerIdBytes"],["","AsMut<[T]>","iroh_docs::sync::PeerIdBytes"],["","AsRef<[T]>","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> BitView for [T; N]where\n T: BitStore,
Note that overly-large arrays may cause the conversions to fail.
\n§fn view_bits<O>(&self) -> &BitSlice<T, O>where\n O: BitOrder,
Views a memory region as an immutable bit-slice.§fn try_view_bits<O>(&self) -> Result<&BitSlice<T, O>, BitSpanError<T>>where\n O: BitOrder,
Attempts to view a memory region as an immutable bit-slice. Read more§fn view_bits_mut<O>(&mut self) -> &mut BitSlice<T, O>where\n O: BitOrder,
Views a memory region as a mutable bit-slice.§fn try_view_bits_mut<O>(\n &mut self\n) -> Result<&mut BitSlice<T, O>, BitSpanError<T>>where\n O: BitOrder,
Attempts to view a memory region as a mutable bit-slice. Read more","BitView","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> BitViewSized for [T; N]where\n T: BitStore,
§fn as_raw_slice(&self) -> &[<[T; N] as BitView>::Store]
Views the type as a slice of its elements.§fn as_raw_mut_slice(&mut self) -> &mut [<[T; N] as BitView>::Store]
Views the type as a mutable slice of its elements.§fn into_bitarray<O>(self) -> BitArray<Self, O>where\n O: BitOrder,
Wraps self in a BitArray.","BitViewSized","iroh_docs::sync::PeerIdBytes"],["","Borrow<[T]>","iroh_docs::sync::PeerIdBytes"],["1.4.0 · source§impl<T, const N: usize> BorrowMut<[T]> for [T; N]
source§fn borrow_mut(&mut self) -> &mut [T]
Mutably borrows from an owned value. Read more","BorrowMut<[T]>","iroh_docs::sync::PeerIdBytes"],["","Chain","iroh_docs::sync::PeerIdBytes"],["","Clone","iroh_docs::sync::PeerIdBytes"],["","Debug","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize> Decode for [u8; N]
Decodes a byte array from byte[n] as described in RFC4251 § 5:
\n\nA byte represents an arbitrary 8-bit value (octet). Fixed length\ndata is sometimes represented as an array of bytes, written\nbyte[n], where n is the number of bytes in the array.
\n
\n","Decode","iroh_docs::sync::PeerIdBytes"],["§impl<'a, T, const N: usize> DecodeValue<'a> for [T; N]where\n T: Decode<'a>,
§fn decode_value<R>(reader: &mut R, header: Header) -> Result<[T; N], Error>where\n R: Reader<'a>,
Attempt to decode this message using the provided [Reader].","DecodeValue<'a>","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["source§impl<'de, T> Deserialize<'de> for [T; 32]where\n T: Deserialize<'de>,
source§fn deserialize<D>(\n deserializer: D\n) -> Result<[T; 32], <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more","Deserialize<'de>","iroh_docs::sync::PeerIdBytes"],["source§impl<'de, const N: usize> Deserialize<'de> for [u8; N]
source§fn deserialize<D>(\n deserializer: D\n) -> Result<[u8; N], <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
","Deserialize<'de>","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize> Encode for [u8; N]
Encodes [u8; N] into byte[n] as described in RFC4251 § 5:
\n\nA byte represents an arbitrary 8-bit value (octet). Fixed length\ndata is sometimes represented as an array of bytes, written\nbyte[n], where n is the number of bytes in the array.
\n
\n§fn encoded_len(&self) -> Result<usize, Error>
Get the length of this type encoded in bytes, prior to Base64 encoding.§fn encode(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value using the provided [Writer].§fn encoded_len_prefixed(&self) -> Result<usize, Error>
Return the length of this type after encoding when prepended with a\nuint32 length prefix.§fn encode_prefixed(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value, first prepending a uint32 length prefix\nset to [Encode::encoded_len].","Encode","iroh_docs::sync::PeerIdBytes"],["","EncodeLabelSet","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> EncodeValue for [T; N]where\n T: Encode,
","EncodeValue","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["§impl<'a> FindToken<&'a u8> for [u8; 32]
§fn find_token(&self, token: &u8) -> bool
Returns true if self contains the token","FindToken<&'a u8>","iroh_docs::sync::PeerIdBytes"],["§impl FindToken<u8> for [u8; 32]
§fn find_token(&self, token: u8) -> bool
Returns true if self contains the token","FindToken","iroh_docs::sync::PeerIdBytes"],["","FixedTag","iroh_docs::sync::PeerIdBytes"],["","From<&Signature>","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["§impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>>> for [T; 32]
","From, B0>, B0>, B0>, B0>, B0>>>","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["","From>","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["source§impl From<NamespaceId> for [u8; 32]
source§fn from(value: NamespaceId) -> Self
Converts to this type from the input type.","From","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["","From>","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> FromBytes for [T; N]where\n T: FromBytes,
§fn slice_from_prefix(bytes: &[u8], count: usize) -> Option<(&[Self], &[u8])>where\n Self: Sized,
Interprets the prefix of the given bytes as a &[Self] with length\nequal to count without copying. Read more§fn slice_from_suffix(bytes: &[u8], count: usize) -> Option<(&[u8], &[Self])>where\n Self: Sized,
Interprets the suffix of the given bytes as a &[Self] with length\nequal to count without copying. Read more§fn read_from_prefix(bytes: &[u8]) -> Option<Self>where\n Self: Sized,
","FromBytes","iroh_docs::sync::PeerIdBytes"],["","FromHex","iroh_docs::sync::PeerIdBytes"],["","FromZeroes","iroh_docs::sync::PeerIdBytes"],["","Hash","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Hash for [T; N]where\n T: Hash,
The hash of an array is the same as that of the corresponding slice,\nas required by the Borrow implementation.
\n\nuse std::hash::BuildHasher;\n\nlet b = std::hash::RandomState::new();\nlet a: [u8; 3] = [0xa8, 0x3c, 0x09];\nlet s: &[u8] = &[0xa8, 0x3c, 0x09];\nassert_eq!(b.hash_one(a), b.hash_one(s));
\n","Hash","iroh_docs::sync::PeerIdBytes"],["","Index","iroh_docs::sync::PeerIdBytes"],["","IndexMut","iroh_docs::sync::PeerIdBytes"],["","InputLength","iroh_docs::sync::PeerIdBytes"],["1.53.0 · source§impl<T, const N: usize> IntoIterator for [T; N]
source§fn into_iter(self) -> <[T; N] as IntoIterator>::IntoIter
Creates a consuming iterator, that is, one that moves each value out of\nthe array (from start to end). The array cannot be used after calling\nthis unless T implements Copy, so the whole array is copied.
\nArrays have special behavior when calling .into_iter() prior to the\n2021 edition – see the array Editions section for more information.
\n","IntoIterator","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize> IntoResponse for [u8; N]
§fn into_response(self) -> Response<Body>
Create a response.","IntoResponse","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, const N: usize> Join for [Fut; N]where\n Fut: IntoFuture,
§type Output = [<Fut as IntoFuture>::Output; N]
The resulting output type.§type Future = Join<<Fut as IntoFuture>::IntoFuture, N>
The Future implementation returned by this method.","Join","iroh_docs::sync::PeerIdBytes"],["","Key","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> MaxSize for [T; N]where\n T: MaxSize,
§const POSTCARD_MAX_SIZE: usize = _
The maximum possible size that the serialization of this\ntype can have, in bytes.","MaxSize","iroh_docs::sync::PeerIdBytes"],["","Merge","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Ord for [T; N]where\n T: Ord,
Implements comparison of arrays lexicographically.
\n1.21.0 · source§fn max(self, other: Self) -> Selfwhere\n Self: Sized,
Compares and returns the maximum of two values. Read more","Ord","iroh_docs::sync::PeerIdBytes"],["","PartialEq<&[U]>","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, U, const N: usize> PartialEq<&mut [U]> for [T; N]where\n T: PartialEq<U>,
","PartialEq<&mut [U]>","iroh_docs::sync::PeerIdBytes"],["","PartialEq<[U]>","iroh_docs::sync::PeerIdBytes"],["","PartialEq<[U; N]>","iroh_docs::sync::PeerIdBytes"],["","PartialEq","iroh_docs::sync::PeerIdBytes"],["§impl<A, B, const N: usize, const M: usize> PartialEq<Vec<A, N>> for [B; M]where\n A: PartialEq<B>,
","PartialEq>","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> PartialOrd for [T; N]where\n T: PartialOrd,
Implements comparison of arrays lexicographically.
\nsource§fn le(&self, other: &[T; N]) -> bool
This method tests less than or equal to (for self and other) and is used by the <=\noperator. Read more","PartialOrd","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, const N: usize> Race for [Fut; N]where\n Fut: IntoFuture,
§type Output = <Fut as IntoFuture>::Output
The resulting output type.§type Future = Race<<Fut as IntoFuture>::IntoFuture, N>
Which kind of future are we turning this into?","Race","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, T, E, const N: usize> RaceOk for [Fut; N]where\n Fut: IntoFuture<Output = Result<T, E>>,
§type Future = RaceOk<<Fut as IntoFuture>::IntoFuture, T, E, N>
Which kind of future are we turning this into?","RaceOk","iroh_docs::sync::PeerIdBytes"],["","Schema","iroh_docs::sync::PeerIdBytes"],["source§impl<T> Serialize for [T; 32]where\n T: 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","iroh_docs::sync::PeerIdBytes"],["source§impl<const N: usize> Serialize for [u8; N]
source§fn serialize<S>(\n &self,\n serializer: S\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where\n S: Serializer,
","Serialize","iroh_docs::sync::PeerIdBytes"],["1.51.0 · source§impl<T, const N: usize> SlicePattern for [T; N]
","SlicePattern","iroh_docs::sync::PeerIdBytes"],["1.34.0 · source§impl<T, const N: usize> TryFrom<&[T]> for [T; N]where\n T: Copy,
Tries to create an array [T; N] by copying from a slice &[T]. Succeeds if\nslice.len() == N.
\n\nlet bytes: [u8; 3] = [1, 0, 2];\n\nlet bytes_head: [u8; 2] = <[u8; 2]>::try_from(&bytes[0..2]).unwrap();\nassert_eq!(1, u16::from_le_bytes(bytes_head));\n\nlet bytes_tail: [u8; 2] = bytes[1..3].try_into().unwrap();\nassert_eq!(512, u16::from_le_bytes(bytes_tail));
\n§type Error = TryFromSliceError
The type returned in the event of a conversion error.","TryFrom<&[T]>","iroh_docs::sync::PeerIdBytes"],["1.59.0 · source§impl<T, const N: usize> TryFrom<&mut [T]> for [T; N]where\n T: Copy,
Tries to create an array [T; N] by copying from a mutable slice &mut [T].\nSucceeds if slice.len() == N.
\n\nlet mut bytes: [u8; 3] = [1, 0, 2];\n\nlet bytes_head: [u8; 2] = <[u8; 2]>::try_from(&mut bytes[0..2]).unwrap();\nassert_eq!(1, u16::from_le_bytes(bytes_head));\n\nlet bytes_tail: [u8; 2] = (&mut bytes[1..3]).try_into().unwrap();\nassert_eq!(512, u16::from_le_bytes(bytes_tail));
\n§type Error = TryFromSliceError
The type returned in the event of a conversion error.","TryFrom<&mut [T]>","iroh_docs::sync::PeerIdBytes"],["§impl<T, A, const N: usize> TryFrom<Vec<T, A>> for [T; N]where\n A: Allocator,
§fn try_from(vec: Vec<T, A>) -> Result<[T; N], Vec<T, A>>
Gets the entire contents of the Vec<T> as an array,\nif its size exactly matches that of the requested array.
\n§Examples
\nassert_eq!(vec![1, 2, 3].try_into(), Ok([1, 2, 3]));\nassert_eq!(<Vec<i32>>::new().try_into(), Ok([]));
\nIf the length doesn’t match, the input comes back in Err:
\n\nlet r: Result<[i32; 4], _> = (0..10).collect::<Vec<_>>().try_into();\nassert_eq!(r, Err(vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9]));
\nIf you’re fine with just getting a prefix of the Vec<T>,\nyou can call .truncate(N) first.
\n\nlet mut v = String::from(\"hello world\").into_bytes();\nv.sort();\nv.truncate(2);\nlet [a, b]: [_; 2] = v.try_into().unwrap();\nassert_eq!(a, b' ');\nassert_eq!(b, b'd');
\n","TryFrom>","iroh_docs::sync::PeerIdBytes"],["1.48.0 · source§impl<T, A, const N: usize> TryFrom<Vec<T, A>> for [T; N]where\n A: Allocator,
source§fn try_from(vec: Vec<T, A>) -> Result<[T; N], Vec<T, A>>
Gets the entire contents of the Vec<T> as an array,\nif its size exactly matches that of the requested array.
\n§Examples
\nassert_eq!(vec![1, 2, 3].try_into(), Ok([1, 2, 3]));\nassert_eq!(<Vec<i32>>::new().try_into(), Ok([]));
\nIf the length doesn’t match, the input comes back in Err:
\n\nlet r: Result<[i32; 4], _> = (0..10).collect::<Vec<_>>().try_into();\nassert_eq!(r, Err(vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9]));
\nIf you’re fine with just getting a prefix of the Vec<T>,\nyou can call .truncate(N) first.
\n\nlet mut v = String::from(\"hello world\").into_bytes();\nv.sort();\nv.truncate(2);\nlet [a, b]: [_; 2] = v.try_into().unwrap();\nassert_eq!(a, b' ');\nassert_eq!(b, b'd');
\n","TryFrom>","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, T, E, const N: usize> TryJoin for [Fut; N]where\n Fut: IntoFuture<Output = Result<T, E>>,
§type Future = TryJoin<<Fut as IntoFuture>::IntoFuture, T, E, N>
Which kind of future are we turning this into?","TryJoin","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> Value for [T; N]where\n T: Value,
§type SelfType<'a> = [<T as Value>::SelfType<'a>; N]\nwhere\n [T; N]: 'a
SelfType<’a> must be the same type as Self with all lifetimes replaced with ’a§type AsBytes<'a> = Vec<u8>\nwhere\n [T; N]: 'a
§fn fixed_width() -> Option<usize>
Width of a fixed type, or None for variable width§fn from_bytes<'a>(data: &'a [u8]) -> [<T as Value>::SelfType<'a>; N]where\n [T; N]: 'a,
Deserializes data\nImplementations may return a view over data, or an owned type","Value","iroh_docs::sync::PeerIdBytes"],["","ValueOrd","iroh_docs::sync::PeerIdBytes"],["§impl<Z, const N: usize> Zeroize for [Z; N]where\n Z: Zeroize,
Impl [Zeroize] on arrays of types that impl [Zeroize].
\n","Zeroize","iroh_docs::sync::PeerIdBytes"],["","Zip","iroh_docs::sync::PeerIdBytes"],["source§impl<T, const N: usize> ConstParamTy for [T; N]where\n T: ConstParamTy,
","ConstParamTy","iroh_docs::sync::PeerIdBytes"],["1.58.0 · source§impl<T, const N: usize> Copy for [T; N]where\n T: Copy,
","Copy","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Eq for [T; N]where\n T: Eq,
","Eq","iroh_docs::sync::PeerIdBytes"],["source§impl<T, const N: usize> StructuralPartialEq for [T; N]
","StructuralPartialEq","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> Unaligned for [T; N]where\n T: Unaligned,
","Unaligned","iroh_docs::sync::PeerIdBytes"],["§impl<Z, const N: usize> ZeroizeOnDrop for [Z; N]where\n Z: ZeroizeOnDrop,
Impl [ZeroizeOnDrop] on arrays of types that impl [ZeroizeOnDrop].
\n","ZeroizeOnDrop","iroh_docs::sync::PeerIdBytes"]]
+"iroh_docs":[["source§impl<T, const N: usize> [T; N]
1.55.0 · sourcepub fn map<F, U>(self, f: F) -> [U; N]where\n F: FnMut(T) -> U,
Returns an array of the same size as self, with function f applied to each element\nin order.
\nIf you don’t necessarily need a new fixed-size array, consider using\nIterator::map instead.
\n§Note on performance and stack usage
\nUnfortunately, usages of this method are currently not always optimized\nas well as they could be. This mainly concerns large arrays, as mapping\nover small arrays seem to be optimized just fine. Also note that in\ndebug mode (i.e. without any optimizations), this method can use a lot\nof stack space (a few times the size of the array or more).
\nTherefore, in performance-critical code, try to avoid using this method\non large arrays or check the emitted code. Also try to avoid chained\nmaps (e.g. arr.map(...).map(...)).
\nIn many cases, you can instead use Iterator::map by calling .iter()\nor .into_iter() on your array. [T; N]::map is only necessary if you\nreally need a new array of the same size as the result. Rust’s lazy\niterators tend to get optimized very well.
\n§Examples
\nlet x = [1, 2, 3];\nlet y = x.map(|v| v + 1);\nassert_eq!(y, [2, 3, 4]);\n\nlet x = [1, 2, 3];\nlet mut temp = 0;\nlet y = x.map(|v| { temp += 1; v * temp });\nassert_eq!(y, [1, 4, 9]);\n\nlet x = [\"Ferris\", \"Bueller's\", \"Day\", \"Off\"];\nlet y = x.map(|v| v.len());\nassert_eq!(y, [6, 9, 3, 3]);
\nsourcepub fn try_map<F, R>(\n self,\n f: F\n) -> <<R as Try>::Residual as Residual<[<R as Try>::Output; N]>>::TryType
🔬This is a nightly-only experimental API. (array_try_map)
A fallible function f applied to each element on array self in order to\nreturn an array the same size as self or the first error encountered.
\nThe return type of this function depends on the return type of the closure.\nIf you return Result<T, E> from the closure, you’ll get a Result<[T; N], E>.\nIf you return Option<T> from the closure, you’ll get an Option<[T; N]>.
\n§Examples
\n#![feature(array_try_map)]\n\nlet a = [\"1\", \"2\", \"3\"];\nlet b = a.try_map(|v| v.parse::<u32>()).unwrap().map(|v| v + 1);\nassert_eq!(b, [2, 3, 4]);\n\nlet a = [\"1\", \"2a\", \"3\"];\nlet b = a.try_map(|v| v.parse::<u32>());\nassert!(b.is_err());\n\nuse std::num::NonZero;\n\nlet z = [1, 2, 0, 3, 4];\nassert_eq!(z.try_map(NonZero::new), None);\n\nlet a = [1, 2, 3];\nlet b = a.try_map(NonZero::new);\nlet c = b.map(|x| x.map(NonZero::get));\nassert_eq!(c, Some(a));
\n1.57.0 (const: 1.57.0) · sourcepub const fn as_slice(&self) -> &[T]
Returns a slice containing the entire array. Equivalent to &s[..].
\n1.57.0 · sourcepub fn as_mut_slice(&mut self) -> &mut [T]
Returns a mutable slice containing the entire array. Equivalent to\n&mut s[..].
\n1.77.0 · sourcepub fn each_ref(&self) -> [&T; N]
Borrows each element and returns an array of references with the same\nsize as self.
\n§Example
\nlet floats = [3.1, 2.7, -1.0];\nlet float_refs: [&f64; 3] = floats.each_ref();\nassert_eq!(float_refs, [&3.1, &2.7, &-1.0]);
\nThis method is particularly useful if combined with other methods, like\nmap. This way, you can avoid moving the original\narray if its elements are not Copy.
\n\nlet strings = [\"Ferris\".to_string(), \"♥\".to_string(), \"Rust\".to_string()];\nlet is_ascii = strings.each_ref().map(|s| s.is_ascii());\nassert_eq!(is_ascii, [true, false, true]);\n\n// We can still access the original array: it has not been moved.\nassert_eq!(strings.len(), 3);
\n1.77.0 · sourcepub fn each_mut(&mut self) -> [&mut T; N]
Borrows each element mutably and returns an array of mutable references\nwith the same size as self.
\n§Example
\n\nlet mut floats = [3.1, 2.7, -1.0];\nlet float_refs: [&mut f64; 3] = floats.each_mut();\n*float_refs[0] = 0.0;\nassert_eq!(float_refs, [&mut 0.0, &mut 2.7, &mut -1.0]);\nassert_eq!(floats, [0.0, 2.7, -1.0]);
\nsourcepub fn split_array_ref<const M: usize>(&self) -> (&[T; M], &[T])
🔬This is a nightly-only experimental API. (split_array)
Divides one array reference into two at an index.
\nThe first will contain all indices from [0, M) (excluding\nthe index M itself) and the second will contain all\nindices from [M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet v = [1, 2, 3, 4, 5, 6];\n\n{\n let (left, right) = v.split_array_ref::<0>();\n assert_eq!(left, &[]);\n assert_eq!(right, &[1, 2, 3, 4, 5, 6]);\n}\n\n{\n let (left, right) = v.split_array_ref::<2>();\n assert_eq!(left, &[1, 2]);\n assert_eq!(right, &[3, 4, 5, 6]);\n}\n\n{\n let (left, right) = v.split_array_ref::<6>();\n assert_eq!(left, &[1, 2, 3, 4, 5, 6]);\n assert_eq!(right, &[]);\n}
\nsourcepub fn split_array_mut<const M: usize>(&mut self) -> (&mut [T; M], &mut [T])
🔬This is a nightly-only experimental API. (split_array)
Divides one mutable array reference into two at an index.
\nThe first will contain all indices from [0, M) (excluding\nthe index M itself) and the second will contain all\nindices from [M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet mut v = [1, 0, 3, 0, 5, 6];\nlet (left, right) = v.split_array_mut::<2>();\nassert_eq!(left, &mut [1, 0][..]);\nassert_eq!(right, &mut [3, 0, 5, 6]);\nleft[1] = 2;\nright[1] = 4;\nassert_eq!(v, [1, 2, 3, 4, 5, 6]);
\nsourcepub fn rsplit_array_ref<const M: usize>(&self) -> (&[T], &[T; M])
🔬This is a nightly-only experimental API. (split_array)
Divides one array reference into two at an index from the end.
\nThe first will contain all indices from [0, N - M) (excluding\nthe index N - M itself) and the second will contain all\nindices from [N - M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet v = [1, 2, 3, 4, 5, 6];\n\n{\n let (left, right) = v.rsplit_array_ref::<0>();\n assert_eq!(left, &[1, 2, 3, 4, 5, 6]);\n assert_eq!(right, &[]);\n}\n\n{\n let (left, right) = v.rsplit_array_ref::<2>();\n assert_eq!(left, &[1, 2, 3, 4]);\n assert_eq!(right, &[5, 6]);\n}\n\n{\n let (left, right) = v.rsplit_array_ref::<6>();\n assert_eq!(left, &[]);\n assert_eq!(right, &[1, 2, 3, 4, 5, 6]);\n}
\nsourcepub fn rsplit_array_mut<const M: usize>(&mut self) -> (&mut [T], &mut [T; M])
🔬This is a nightly-only experimental API. (split_array)
Divides one mutable array reference into two at an index from the end.
\nThe first will contain all indices from [0, N - M) (excluding\nthe index N - M itself) and the second will contain all\nindices from [N - M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet mut v = [1, 0, 3, 0, 5, 6];\nlet (left, right) = v.rsplit_array_mut::<4>();\nassert_eq!(left, &mut [1, 0]);\nassert_eq!(right, &mut [3, 0, 5, 6][..]);\nleft[1] = 2;\nright[1] = 4;\nassert_eq!(v, [1, 2, 3, 4, 5, 6]);
\n",0,"iroh_docs::sync::PeerIdBytes"],["source§impl<const N: usize> [u8; N]
sourcepub const fn as_ascii(&self) -> Option<&[AsciiChar; N]>
🔬This is a nightly-only experimental API. (ascii_char)
Converts this array of bytes into a array of ASCII characters,\nor returns None if any of the characters is non-ASCII.
\n§Examples
\n#![feature(ascii_char)]\n#![feature(const_option)]\n\nconst HEX_DIGITS: [std::ascii::Char; 16] =\n *b\"0123456789abcdef\".as_ascii().unwrap();\n\nassert_eq!(HEX_DIGITS[1].as_str(), \"1\");\nassert_eq!(HEX_DIGITS[10].as_str(), \"a\");
\nsourcepub const unsafe fn as_ascii_unchecked(&self) -> &[AsciiChar; N]
🔬This is a nightly-only experimental API. (ascii_char)
Converts this array of bytes into a array of ASCII characters,\nwithout checking whether they’re valid.
\n§Safety
\nEvery byte in the array must be in 0..=127, or else this is UB.
\n",0,"iroh_docs::sync::PeerIdBytes"],["§impl<T> Array for [T; 32]where\n T: Default,
§fn as_slice_mut(&mut self) -> &mut [T]
Gives a unique slice over the whole thing. Read more","Array","iroh_docs::sync::PeerIdBytes"],["","Array","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> AsBytes for [T; N]where\n T: AsBytes,
§fn write_to_prefix(&self, bytes: &mut [u8]) -> Option<()>
","AsBytes","iroh_docs::sync::PeerIdBytes"],["","AsBytes","iroh_docs::sync::PeerIdBytes"],["","AsMut<[T]>","iroh_docs::sync::PeerIdBytes"],["","AsRef<[T]>","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> BitView for [T; N]where\n T: BitStore,
Note that overly-large arrays may cause the conversions to fail.
\n§fn view_bits<O>(&self) -> &BitSlice<T, O>where\n O: BitOrder,
Views a memory region as an immutable bit-slice.§fn try_view_bits<O>(&self) -> Result<&BitSlice<T, O>, BitSpanError<T>>where\n O: BitOrder,
Attempts to view a memory region as an immutable bit-slice. Read more§fn view_bits_mut<O>(&mut self) -> &mut BitSlice<T, O>where\n O: BitOrder,
Views a memory region as a mutable bit-slice.§fn try_view_bits_mut<O>(\n &mut self\n) -> Result<&mut BitSlice<T, O>, BitSpanError<T>>where\n O: BitOrder,
Attempts to view a memory region as a mutable bit-slice. Read more","BitView","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> BitViewSized for [T; N]where\n T: BitStore,
§fn as_raw_slice(&self) -> &[<[T; N] as BitView>::Store]
Views the type as a slice of its elements.§fn as_raw_mut_slice(&mut self) -> &mut [<[T; N] as BitView>::Store]
Views the type as a mutable slice of its elements.§fn into_bitarray<O>(self) -> BitArray<Self, O>where\n O: BitOrder,
Wraps self in a BitArray.","BitViewSized","iroh_docs::sync::PeerIdBytes"],["","Borrow<[T]>","iroh_docs::sync::PeerIdBytes"],["1.4.0 · source§impl<T, const N: usize> BorrowMut<[T]> for [T; N]
source§fn borrow_mut(&mut self) -> &mut [T]
Mutably borrows from an owned value. Read more","BorrowMut<[T]>","iroh_docs::sync::PeerIdBytes"],["","Chain","iroh_docs::sync::PeerIdBytes"],["","Clone","iroh_docs::sync::PeerIdBytes"],["","Debug","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize> Decode for [u8; N]
Decodes a byte array from byte[n] as described in RFC4251 § 5:
\n\nA byte represents an arbitrary 8-bit value (octet). Fixed length\ndata is sometimes represented as an array of bytes, written\nbyte[n], where n is the number of bytes in the array.
\n
\n","Decode","iroh_docs::sync::PeerIdBytes"],["§impl<'a, T, const N: usize> DecodeValue<'a> for [T; N]where\n T: Decode<'a>,
§fn decode_value<R>(reader: &mut R, header: Header) -> Result<[T; N], Error>where\n R: Reader<'a>,
Attempt to decode this message using the provided [Reader].","DecodeValue<'a>","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["source§impl<'de, T> Deserialize<'de> for [T; 32]where\n T: Deserialize<'de>,
source§fn deserialize<D>(\n deserializer: D\n) -> Result<[T; 32], <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more","Deserialize<'de>","iroh_docs::sync::PeerIdBytes"],["source§impl<'de, const N: usize> Deserialize<'de> for [u8; N]
source§fn deserialize<D>(\n deserializer: D\n) -> Result<[u8; N], <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
","Deserialize<'de>","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize> Encode for [u8; N]
Encodes [u8; N] into byte[n] as described in RFC4251 § 5:
\n\nA byte represents an arbitrary 8-bit value (octet). Fixed length\ndata is sometimes represented as an array of bytes, written\nbyte[n], where n is the number of bytes in the array.
\n
\n§fn encoded_len(&self) -> Result<usize, Error>
Get the length of this type encoded in bytes, prior to Base64 encoding.§fn encode(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value using the provided [Writer].§fn encoded_len_prefixed(&self) -> Result<usize, Error>
Return the length of this type after encoding when prepended with a\nuint32 length prefix.§fn encode_prefixed(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value, first prepending a uint32 length prefix\nset to [Encode::encoded_len].","Encode","iroh_docs::sync::PeerIdBytes"],["","EncodeLabelSet","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> EncodeValue for [T; N]where\n T: Encode,
","EncodeValue","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["§impl<'a> FindToken<&'a u8> for [u8; 32]
§fn find_token(&self, token: &u8) -> bool
Returns true if self contains the token","FindToken<&'a u8>","iroh_docs::sync::PeerIdBytes"],["§impl FindToken<u8> for [u8; 32]
§fn find_token(&self, token: u8) -> bool
Returns true if self contains the token","FindToken","iroh_docs::sync::PeerIdBytes"],["","FixedTag","iroh_docs::sync::PeerIdBytes"],["","From<&Signature>","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["§impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>>> for [T; 32]
","From, B0>, B0>, B0>, B0>, B0>>>","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["","From>","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["source§impl From<NamespaceId> for [u8; 32]
source§fn from(value: NamespaceId) -> Self
Converts to this type from the input type.","From","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["","From>","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> FromBytes for [T; N]where\n T: FromBytes,
§fn slice_from_prefix(bytes: &[u8], count: usize) -> Option<(&[Self], &[u8])>where\n Self: Sized,
Interprets the prefix of the given bytes as a &[Self] with length\nequal to count without copying. Read more§fn slice_from_suffix(bytes: &[u8], count: usize) -> Option<(&[u8], &[Self])>where\n Self: Sized,
Interprets the suffix of the given bytes as a &[Self] with length\nequal to count without copying. Read more§fn read_from_prefix(bytes: &[u8]) -> Option<Self>where\n Self: Sized,
","FromBytes","iroh_docs::sync::PeerIdBytes"],["","FromHex","iroh_docs::sync::PeerIdBytes"],["","FromZeroes","iroh_docs::sync::PeerIdBytes"],["","Hash","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Hash for [T; N]where\n T: Hash,
The hash of an array is the same as that of the corresponding slice,\nas required by the Borrow implementation.
\n\nuse std::hash::BuildHasher;\n\nlet b = std::hash::RandomState::new();\nlet a: [u8; 3] = [0xa8, 0x3c, 0x09];\nlet s: &[u8] = &[0xa8, 0x3c, 0x09];\nassert_eq!(b.hash_one(a), b.hash_one(s));
\n","Hash","iroh_docs::sync::PeerIdBytes"],["","Index","iroh_docs::sync::PeerIdBytes"],["","IndexMut","iroh_docs::sync::PeerIdBytes"],["","InputLength","iroh_docs::sync::PeerIdBytes"],["1.53.0 · source§impl<T, const N: usize> IntoIterator for [T; N]
source§fn into_iter(self) -> <[T; N] as IntoIterator>::IntoIter
Creates a consuming iterator, that is, one that moves each value out of\nthe array (from start to end). The array cannot be used after calling\nthis unless T implements Copy, so the whole array is copied.
\nArrays have special behavior when calling .into_iter() prior to the\n2021 edition – see the array Editions section for more information.
\n","IntoIterator","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize> IntoResponse for [u8; N]
§fn into_response(self) -> Response<Body>
Create a response.","IntoResponse","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, const N: usize> Join for [Fut; N]where\n Fut: IntoFuture,
§type Output = [<Fut as IntoFuture>::Output; N]
The resulting output type.§type Future = Join<<Fut as IntoFuture>::IntoFuture, N>
The Future implementation returned by this method.","Join","iroh_docs::sync::PeerIdBytes"],["","Key","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> MaxSize for [T; N]where\n T: MaxSize,
§const POSTCARD_MAX_SIZE: usize = _
The maximum possible size that the serialization of this\ntype can have, in bytes.","MaxSize","iroh_docs::sync::PeerIdBytes"],["","Merge","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Ord for [T; N]where\n T: Ord,
Implements comparison of arrays lexicographically.
\n1.21.0 · source§fn max(self, other: Self) -> Selfwhere\n Self: Sized,
Compares and returns the maximum of two values. Read more","Ord","iroh_docs::sync::PeerIdBytes"],["","PartialEq<&[U]>","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, U, const N: usize> PartialEq<&mut [U]> for [T; N]where\n T: PartialEq<U>,
","PartialEq<&mut [U]>","iroh_docs::sync::PeerIdBytes"],["","PartialEq<[U]>","iroh_docs::sync::PeerIdBytes"],["","PartialEq<[U; N]>","iroh_docs::sync::PeerIdBytes"],["","PartialEq","iroh_docs::sync::PeerIdBytes"],["§impl<A, B, const N: usize, const M: usize> PartialEq<Vec<A, N>> for [B; M]where\n A: PartialEq<B>,
","PartialEq>","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> PartialOrd for [T; N]where\n T: PartialOrd,
Implements comparison of arrays lexicographically.
\nsource§fn le(&self, other: &[T; N]) -> bool
This method tests less than or equal to (for self and other) and is used by the <=\noperator. Read more","PartialOrd","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, const N: usize> Race for [Fut; N]where\n Fut: IntoFuture,
§type Output = <Fut as IntoFuture>::Output
The resulting output type.§type Future = Race<<Fut as IntoFuture>::IntoFuture, N>
Which kind of future are we turning this into?","Race","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, T, E, const N: usize> RaceOk for [Fut; N]where\n Fut: IntoFuture<Output = Result<T, E>>,
§type Future = RaceOk<<Fut as IntoFuture>::IntoFuture, T, E, N>
Which kind of future are we turning this into?","RaceOk","iroh_docs::sync::PeerIdBytes"],["","Schema","iroh_docs::sync::PeerIdBytes"],["source§impl<T> Serialize for [T; 32]where\n T: 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","iroh_docs::sync::PeerIdBytes"],["source§impl<const N: usize> Serialize for [u8; N]
source§fn serialize<S>(\n &self,\n serializer: S\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where\n S: Serializer,
","Serialize","iroh_docs::sync::PeerIdBytes"],["1.51.0 · source§impl<T, const N: usize> SlicePattern for [T; N]
","SlicePattern","iroh_docs::sync::PeerIdBytes"],["1.34.0 · source§impl<T, const N: usize> TryFrom<&[T]> for [T; N]where\n T: Copy,
Tries to create an array [T; N] by copying from a slice &[T]. Succeeds if\nslice.len() == N.
\n\nlet bytes: [u8; 3] = [1, 0, 2];\n\nlet bytes_head: [u8; 2] = <[u8; 2]>::try_from(&bytes[0..2]).unwrap();\nassert_eq!(1, u16::from_le_bytes(bytes_head));\n\nlet bytes_tail: [u8; 2] = bytes[1..3].try_into().unwrap();\nassert_eq!(512, u16::from_le_bytes(bytes_tail));
\n§type Error = TryFromSliceError
The type returned in the event of a conversion error.","TryFrom<&[T]>","iroh_docs::sync::PeerIdBytes"],["1.59.0 · source§impl<T, const N: usize> TryFrom<&mut [T]> for [T; N]where\n T: Copy,
Tries to create an array [T; N] by copying from a mutable slice &mut [T].\nSucceeds if slice.len() == N.
\n\nlet mut bytes: [u8; 3] = [1, 0, 2];\n\nlet bytes_head: [u8; 2] = <[u8; 2]>::try_from(&mut bytes[0..2]).unwrap();\nassert_eq!(1, u16::from_le_bytes(bytes_head));\n\nlet bytes_tail: [u8; 2] = (&mut bytes[1..3]).try_into().unwrap();\nassert_eq!(512, u16::from_le_bytes(bytes_tail));
\n§type Error = TryFromSliceError
The type returned in the event of a conversion error.","TryFrom<&mut [T]>","iroh_docs::sync::PeerIdBytes"],["§impl<T, A, const N: usize> TryFrom<Vec<T, A>> for [T; N]where\n A: Allocator,
§fn try_from(vec: Vec<T, A>) -> Result<[T; N], Vec<T, A>>
Gets the entire contents of the Vec<T> as an array,\nif its size exactly matches that of the requested array.
\n§Examples
\nassert_eq!(vec![1, 2, 3].try_into(), Ok([1, 2, 3]));\nassert_eq!(<Vec<i32>>::new().try_into(), Ok([]));
\nIf the length doesn’t match, the input comes back in Err:
\n\nlet r: Result<[i32; 4], _> = (0..10).collect::<Vec<_>>().try_into();\nassert_eq!(r, Err(vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9]));
\nIf you’re fine with just getting a prefix of the Vec<T>,\nyou can call .truncate(N) first.
\n\nlet mut v = String::from(\"hello world\").into_bytes();\nv.sort();\nv.truncate(2);\nlet [a, b]: [_; 2] = v.try_into().unwrap();\nassert_eq!(a, b' ');\nassert_eq!(b, b'd');
\n","TryFrom>","iroh_docs::sync::PeerIdBytes"],["1.48.0 · source§impl<T, A, const N: usize> TryFrom<Vec<T, A>> for [T; N]where\n A: Allocator,
source§fn try_from(vec: Vec<T, A>) -> Result<[T; N], Vec<T, A>>
Gets the entire contents of the Vec<T> as an array,\nif its size exactly matches that of the requested array.
\n§Examples
\nassert_eq!(vec![1, 2, 3].try_into(), Ok([1, 2, 3]));\nassert_eq!(<Vec<i32>>::new().try_into(), Ok([]));
\nIf the length doesn’t match, the input comes back in Err:
\n\nlet r: Result<[i32; 4], _> = (0..10).collect::<Vec<_>>().try_into();\nassert_eq!(r, Err(vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9]));
\nIf you’re fine with just getting a prefix of the Vec<T>,\nyou can call .truncate(N) first.
\n\nlet mut v = String::from(\"hello world\").into_bytes();\nv.sort();\nv.truncate(2);\nlet [a, b]: [_; 2] = v.try_into().unwrap();\nassert_eq!(a, b' ');\nassert_eq!(b, b'd');
\n","TryFrom>","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, T, E, const N: usize> TryJoin for [Fut; N]where\n Fut: IntoFuture<Output = Result<T, E>>,
§type Future = TryJoin<<Fut as IntoFuture>::IntoFuture, T, E, N>
Which kind of future are we turning this into?","TryJoin","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> Value for [T; N]where\n T: Value,
§type SelfType<'a> = [<T as Value>::SelfType<'a>; N]\nwhere\n [T; N]: 'a
SelfType<’a> must be the same type as Self with all lifetimes replaced with ’a§type AsBytes<'a> = Vec<u8>\nwhere\n [T; N]: 'a
§fn fixed_width() -> Option<usize>
Width of a fixed type, or None for variable width§fn from_bytes<'a>(data: &'a [u8]) -> [<T as Value>::SelfType<'a>; N]where\n [T; N]: 'a,
Deserializes data\nImplementations may return a view over data, or an owned type","Value","iroh_docs::sync::PeerIdBytes"],["","ValueOrd","iroh_docs::sync::PeerIdBytes"],["§impl<Z, const N: usize> Zeroize for [Z; N]where\n Z: Zeroize,
Impl [Zeroize] on arrays of types that impl [Zeroize].
\n","Zeroize","iroh_docs::sync::PeerIdBytes"],["","Zip","iroh_docs::sync::PeerIdBytes"],["source§impl<T, const N: usize> ConstParamTy for [T; N]where\n T: ConstParamTy,
","ConstParamTy","iroh_docs::sync::PeerIdBytes"],["1.58.0 · source§impl<T, const N: usize> Copy for [T; N]where\n T: Copy,
","Copy","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Eq for [T; N]where\n T: Eq,
","Eq","iroh_docs::sync::PeerIdBytes"],["source§impl<T, const N: usize> StructuralPartialEq for [T; N]
","StructuralPartialEq","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> Unaligned for [T; N]where\n T: Unaligned,
","Unaligned","iroh_docs::sync::PeerIdBytes"],["§impl<Z, const N: usize> ZeroizeOnDrop for [Z; N]where\n Z: ZeroizeOnDrop,
Impl [ZeroizeOnDrop] on arrays of types that impl [ZeroizeOnDrop].
\n","ZeroizeOnDrop","iroh_docs::sync::PeerIdBytes"]]
};if (window.register_type_impls) {window.register_type_impls(type_impls);} else {window.pending_type_impls = type_impls;}})()
\ No newline at end of file
Struct iroh_blobs::HashAndFormat
pub struct HashAndFormat {
+HashAndFormat in iroh_blobs - Rust Struct iroh_blobs::HashAndFormat
source · pub struct HashAndFormat {
pub hash: Hash,
pub format: BlobFormat,
}
Expand description
A hash and format pair
Fields§
§hash: HashThe hash
§format: BlobFormatThe format
-Implementations§
§impl HashAndFormat
pub fn new(hash: Hash, format: BlobFormat) -> HashAndFormat
Create a new hash and format pair.
-pub fn raw(hash: Hash) -> HashAndFormat
Create a new hash and format pair, using the default (raw) format.
-pub fn hash_seq(hash: Hash) -> HashAndFormat
Create a new hash and format pair, using the collection format.
-Trait Implementations§
§impl Clone for HashAndFormat
§fn clone(&self) -> HashAndFormat
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more§impl Debug for HashAndFormat
§impl<'de> Deserialize<'de> for HashAndFormat
§fn deserialize<D>(
+
Implementations§
source§impl HashAndFormat
sourcepub fn new(hash: Hash, format: BlobFormat) -> HashAndFormat
Create a new hash and format pair.
+sourcepub fn raw(hash: Hash) -> HashAndFormat
Create a new hash and format pair, using the default (raw) format.
+sourcepub fn hash_seq(hash: Hash) -> HashAndFormat
Create a new hash and format pair, using the collection format.
+Trait Implementations§
source§impl Clone for HashAndFormat
source§fn clone(&self) -> HashAndFormat
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moresource§impl Debug for HashAndFormat
source§impl<'de> Deserialize<'de> for HashAndFormat
source§fn deserialize<D>(
deserializer: D
) -> Result<HashAndFormat, <D as Deserializer<'de>>::Error>where
- D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more§impl Display for HashAndFormat
source§impl From<DownloadKind> for HashAndFormat
source§fn from(value: DownloadKind) -> Self
Converts to this type from the input type.source§impl From<HashAndFormat> for DownloadKind
source§fn from(value: HashAndFormat) -> Self
Converts to this type from the input type.§impl FromStr for HashAndFormat
§impl Hash for HashAndFormat
§fn hash<__H>(&self, state: &mut __H)where
+ D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl Display for HashAndFormat
source§impl From<DownloadKind> for HashAndFormat
source§fn from(value: DownloadKind) -> Self
Converts to this type from the input type.source§impl From<HashAndFormat> for DownloadKind
source§fn from(value: HashAndFormat) -> Self
Converts to this type from the input type.source§impl FromStr for HashAndFormat
source§impl Hash for HashAndFormat
§impl MaxSize for HashAndFormat
§const POSTCARD_MAX_SIZE: usize = 33usize
The maximum possible size that the serialization of this
-type can have, in bytes.§impl Ord for HashAndFormat
source§impl MaxSize for HashAndFormat
source§const POSTCARD_MAX_SIZE: usize = 33usize
The maximum possible size that the serialization of this
+type can have, in bytes.source§impl Ord for HashAndFormat
source§fn cmp(&self, other: &HashAndFormat) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more§impl PartialEq for HashAndFormat
§fn eq(&self, other: &HashAndFormat) -> bool
Restrict a value to a certain interval. Read moresource§impl PartialEq for HashAndFormat
source§fn eq(&self, other: &HashAndFormat) -> bool
This method tests for self and other values to be equal, and is used
by ==.§impl PartialOrd for HashAndFormat
§fn partial_cmp(&self, other: &HashAndFormat) -> Option<Ordering>
source§impl PartialOrd for HashAndFormat
source§fn partial_cmp(&self, other: &HashAndFormat) -> Option<Ordering>
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 <=
operator. Read moresource§impl Serialize for HashAndFormat
source§fn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
- S: Serializer,
Serialize this value into the given Serde serializer. Read more§impl Value for HashAndFormat
§type SelfType<'a> = HashAndFormat
SelfType<’a> must be the same type as Self with all lifetimes replaced with ’a§type AsBytes<'a> = [u8; 33]
§fn fixed_width() -> Option<usize>
Width of a fixed type, or None for variable width§fn from_bytes<'a>(data: &'a [u8]) -> <HashAndFormat as Value>::SelfType<'a>where
+ S: Serializer,
Serialize this value into the given Serde serializer. Read moresource§impl Value for HashAndFormat
§type SelfType<'a> = HashAndFormat
SelfType<’a> must be the same type as Self with all lifetimes replaced with ’a§type AsBytes<'a> = [u8; 33]
source§fn fixed_width() -> Option<usize>
Width of a fixed type, or None for variable widthsource§fn from_bytes<'a>(data: &'a [u8]) -> <HashAndFormat as Value>::SelfType<'a>where
HashAndFormat: 'a,
Deserializes data
-Implementations may return a view over data, or an owned typesource§fn as_bytes<'a, 'b>(
value: &'a <HashAndFormat as Value>::SelfType<'b>
) -> <HashAndFormat as Value>::AsBytes<'a>where
'b: 'a,
- HashAndFormat: 'a + 'b,
Serialize the value to a slice§impl Copy for HashAndFormat
§impl Eq for HashAndFormat
§impl StructuralPartialEq for HashAndFormat
Auto Trait Implementations§
§impl Freeze for HashAndFormat
§impl RefUnwindSafe for HashAndFormat
§impl Send for HashAndFormat
§impl Sync for HashAndFormat
§impl Unpin for HashAndFormat
§impl UnwindSafe for HashAndFormat
Blanket Implementations§
source§impl<T> Any for Twhere
+ HashAndFormat: 'a + 'b,
Serialize the value to a slicesource§impl Copy for HashAndFormat
source§impl Eq for HashAndFormat
source§impl StructuralPartialEq for HashAndFormat
Auto Trait Implementations§
impl Freeze for HashAndFormat
impl RefUnwindSafe for HashAndFormat
impl Send for HashAndFormat
impl Sync for HashAndFormat
impl Unpin for HashAndFormat
impl UnwindSafe for HashAndFormat
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
diff --git a/pr/2595/docs/iroh_docs/actor/struct.SyncHandle.html b/pr/2595/docs/iroh_docs/actor/struct.SyncHandle.html
index cfd29c2ce8..6c70a0ff39 100644
--- a/pr/2595/docs/iroh_docs/actor/struct.SyncHandle.html
+++ b/pr/2595/docs/iroh_docs/actor/struct.SyncHandle.html
@@ -26,7 +26,7 @@ waiting for the actor to finish happens in an async context, and therefore that
namespace: NamespaceId,
author: AuthorId,
key: Bytes,
- hash: Hash,
+ hash: Hash,
len: u64
) -> Result<()>sourcepub async fn delete_prefix(
&self,
diff --git a/pr/2595/docs/iroh_docs/engine/enum.LiveEvent.html b/pr/2595/docs/iroh_docs/engine/enum.LiveEvent.html
index ceb8545b50..f0d33bcb21 100644
--- a/pr/2595/docs/iroh_docs/engine/enum.LiveEvent.html
+++ b/pr/2595/docs/iroh_docs/engine/enum.LiveEvent.html
@@ -3,34 +3,34 @@
entry: Entry,
},
InsertRemote {
- from: PublicKey,
+ from: PublicKey,
entry: Entry,
content_status: ContentStatus,
},
ContentReady {
- hash: Hash,
+ hash: Hash,
},
PendingContentReady,
- NeighborUp(PublicKey),
- NeighborDown(PublicKey),
+ NeighborUp(PublicKey),
+ NeighborDown(PublicKey),
SyncFinished(SyncEvent),
}Expand description
Events informing about actions of the live sync progress.
Variants§
§InsertLocal
A local insertion.
§InsertRemote
Received a remote insert.
-Fields
§from: PublicKeyThe peer that sent us the entry.
+Fields
§content_status: ContentStatusIf the content is available at the local node
§ContentReady
The content of an entry was downloaded and is now available at the local node
-Fields
§hash: HashThe content hash of the newly available entry content
+§PendingContentReady
All pending content is now ready.
This event signals that all queued content downloads from the last sync run have either
completed or failed.
It will only be emitted after a Self::SyncFinished event, never before.
Receiving this event does not guarantee that all content in the document is available. If
blobs failed to download, this event will still be emitted after all operations completed.
-§NeighborUp(PublicKey)
We have a new neighbor in the swarm.
-§NeighborDown(PublicKey)
We lost a neighbor in the swarm.
+§NeighborUp(PublicKey)
We have a new neighbor in the swarm.
+§NeighborDown(PublicKey)
We lost a neighbor in the swarm.
§SyncFinished(SyncEvent)
A set-reconciliation sync finished.
Trait Implementations§
source§impl<'de> Deserialize<'de> for LiveEvent
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl PartialEq for LiveEvent
source§fn eq(&self, other: &LiveEvent) -> bool
This method tests for self and other values to be equal, and is used
diff --git a/pr/2595/docs/iroh_docs/engine/fn.entry_to_content_status.html b/pr/2595/docs/iroh_docs/engine/fn.entry_to_content_status.html
index 459a6719d2..3b39df6428 100644
--- a/pr/2595/docs/iroh_docs/engine/fn.entry_to_content_status.html
+++ b/pr/2595/docs/iroh_docs/engine/fn.entry_to_content_status.html
@@ -1,2 +1,2 @@
-entry_to_content_status in iroh_docs::engine - Rust Function iroh_docs::engine::entry_to_content_status
source · pub fn entry_to_content_status(entry: Result<EntryStatus>) -> ContentStatus
Expand description
Converts an [EntryStatus] into a [‘ContentStatus’].
+entry_to_content_status in iroh_docs::engine - Rust Function iroh_docs::engine::entry_to_content_status
source · pub fn entry_to_content_status(entry: Result<EntryStatus>) -> ContentStatus
Expand description
Converts an EntryStatus into a [‘ContentStatus’].
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_docs/engine/index.html b/pr/2595/docs/iroh_docs/engine/index.html
index 5f78e23386..622ab4b871 100644
--- a/pr/2595/docs/iroh_docs/engine/index.html
+++ b/pr/2595/docs/iroh_docs/engine/index.html
@@ -1,4 +1,4 @@
iroh_docs::engine - Rust Expand description
Handlers and actors to for live syncing replicas.
crate::Replica is also called documents here.
Structs§
- Persistent default author for a docs engine.
- The sync engine coordinates actors that manage open documents, set-reconciliation syncs with
-peers and a gossip swarm for each syncing document.
- Event emitted when a sync operation completes
Enums§
- Where to persist the default author.
- Events informing about actions of the live sync progress.
- Why we performed a sync exchange
- Why we started a sync request
Functions§
- Converts an [
EntryStatus] into a [‘ContentStatus’].
\ No newline at end of file
+peers and a gossip swarm for each syncing document.Event emitted when a sync operation completes Enums§
- Where to persist the default author.
- Events informing about actions of the live sync progress.
- Why we performed a sync exchange
- Why we started a sync request
Functions§
- Converts an
EntryStatus into a [‘ContentStatus’].
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_docs/engine/struct.Engine.html b/pr/2595/docs/iroh_docs/engine/struct.Engine.html
index 1b88a96726..46cd25179e 100644
--- a/pr/2595/docs/iroh_docs/engine/struct.Engine.html
+++ b/pr/2595/docs/iroh_docs/engine/struct.Engine.html
@@ -8,12 +8,12 @@ peers and a gossip swarm for each syncing document.
Fields§
§endpoint: EndpointEndpoint used by the engine.
§sync: SyncHandleHandle to the actor thread.
The persistent default author for this engine.
-Implementations§
source§impl Engine
Implementations§
source§impl Engine
sourcepub async fn spawn<B: Store>(
endpoint: Endpoint,
- gossip: Gossip,
+ gossip: Gossip,
replica_store: Store,
bao_store: B,
- downloader: Downloader,
+ downloader: Downloader,
default_author_storage: DefaultAuthorStorage
) -> Result<Self>
Start the sync engine.
This will spawn two tokio tasks for the live sync coordination and gossip actors, and a
@@ -21,7 +21,7 @@ thread for the sourcepub async fn start_sync(
&self,
namespace: NamespaceId,
- peers: Vec<NodeAddr>
+ peers: Vec<NodeAddr>
) -> Result<()>
Start to sync a document.
If peers is non-empty, it will both do an initial set-reconciliation sync with each peer,
and join an iroh-gossip swarm with these peers to receive and broadcast document updates.
diff --git a/pr/2595/docs/iroh_docs/engine/struct.SyncEvent.html b/pr/2595/docs/iroh_docs/engine/struct.SyncEvent.html
index 49ba954022..d7eb730d81 100644
--- a/pr/2595/docs/iroh_docs/engine/struct.SyncEvent.html
+++ b/pr/2595/docs/iroh_docs/engine/struct.SyncEvent.html
@@ -1,11 +1,11 @@
SyncEvent in iroh_docs::engine - Rust pub struct SyncEvent {
- pub peer: PublicKey,
+ pub peer: PublicKey,
pub origin: Origin,
pub finished: SystemTime,
pub started: SystemTime,
pub result: Result<SyncDetails, String>,
}
Expand description
Event emitted when a sync operation completes
-Fields§
§peer: PublicKeyPeer we synced with
+Fields§
§peer: PublicKeyPeer we synced with
§origin: OriginOrigin of the sync exchange
§finished: SystemTimeTimestamp when the sync started
§started: SystemTimeTimestamp when the sync finished
diff --git a/pr/2595/docs/iroh_docs/index.html b/pr/2595/docs/iroh_docs/index.html
index a37d30e2a6..41c792c5e5 100644
--- a/pr/2595/docs/iroh_docs/index.html
+++ b/pr/2595/docs/iroh_docs/index.html
@@ -1,7 +1,7 @@
iroh_docs - Rust Expand description
Multi-dimensional key-value documents with an efficient synchronization protocol
The crate operates on Replicas. A replica contains an unlimited number of
Entries. Each entry is identified by a key, its author, and the replica’s
-namespace. Its value is the 32-byte BLAKE3 hash
+namespace. Its value is the 32-byte BLAKE3 hash
of the entry’s content data, the size of this content data, and a timestamp.
The content data itself is not stored or transferred through a replica.
All entries in a replica are signed with two keypairs:
diff --git a/pr/2595/docs/iroh_docs/net/enum.AcceptError.html b/pr/2595/docs/iroh_docs/net/enum.AcceptError.html
index 87e9a07ad3..cf11b5b695 100644
--- a/pr/2595/docs/iroh_docs/net/enum.AcceptError.html
+++ b/pr/2595/docs/iroh_docs/net/enum.AcceptError.html
@@ -3,31 +3,31 @@
error: Error,
},
Open {
- peer: PublicKey,
+ peer: PublicKey,
error: Error,
},
Abort {
- peer: PublicKey,
+ peer: PublicKey,
namespace: NamespaceId,
reason: AbortReason,
},
Sync {
- peer: PublicKey,
+ peer: PublicKey,
namespace: Option<NamespaceId>,
error: Error,
},
Close {
- peer: PublicKey,
+ peer: PublicKey,
namespace: Option<NamespaceId>,
error: Error,
},
}Expand description
Errors that may occur on handling incoming sync connections.
Variants§
§Connect
Failed to establish connection
§Open
Failed to open replica
-§Abort
We aborted the sync request.
-§Sync
Failed to run sync
-§Close
Failed to close
-Implementations§
source§impl AcceptError
Implementations§
Trait Implementations§
source§impl Debug for AcceptError
source§impl Display for AcceptError
source§impl Error for AcceptError
source§fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more1.0.0 · source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()Auto Trait Implementations§
§impl Freeze for AcceptError
§impl RefUnwindSafe for AcceptError
§impl Send for AcceptError
§impl Sync for AcceptError
§impl Unpin for AcceptError
§impl UnwindSafe for AcceptError
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
diff --git a/pr/2595/docs/iroh_docs/net/fn.connect_and_sync.html b/pr/2595/docs/iroh_docs/net/fn.connect_and_sync.html
index 1ee6909d53..7bec313309 100644
--- a/pr/2595/docs/iroh_docs/net/fn.connect_and_sync.html
+++ b/pr/2595/docs/iroh_docs/net/fn.connect_and_sync.html
@@ -2,6 +2,6 @@
endpoint: &Endpoint,
sync: &SyncHandle,
namespace: NamespaceId,
- peer: NodeAddr
+ peer: NodeAddr
) -> Result<SyncFinished, ConnectError>Expand description
Connect to a peer and sync a replica
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_docs/net/fn.handle_connection.html b/pr/2595/docs/iroh_docs/net/fn.handle_connection.html
index 347a0c22bf..e96816b362 100644
--- a/pr/2595/docs/iroh_docs/net/fn.handle_connection.html
+++ b/pr/2595/docs/iroh_docs/net/fn.handle_connection.html
@@ -3,6 +3,6 @@
connecting: Connecting,
accept_cb: F
) -> Result<SyncFinished, AcceptError>where
- F: Fn(NamespaceId, PublicKey) -> Fut,
+ F: Fn(NamespaceId, PublicKey) -> Fut,
Fut: Future<Output = AcceptOutcome>,Expand description
Handle an iroh-docs connection and sync all shared documents in the replica store.
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_docs/net/struct.SyncFinished.html b/pr/2595/docs/iroh_docs/net/struct.SyncFinished.html
index 74ab2f6632..dcd549e6fc 100644
--- a/pr/2595/docs/iroh_docs/net/struct.SyncFinished.html
+++ b/pr/2595/docs/iroh_docs/net/struct.SyncFinished.html
@@ -1,11 +1,11 @@
SyncFinished in iroh_docs::net - Rust Struct iroh_docs::net::SyncFinished
source · pub struct SyncFinished {
pub namespace: NamespaceId,
- pub peer: PublicKey,
+ pub peer: PublicKey,
pub outcome: SyncOutcome,
pub timings: Timings,
}
Expand description
Details of a finished sync operation.
Fields§
§namespace: NamespaceIdThe namespace that was synced.
-§peer: PublicKeyThe peer we syned with.
+§peer: PublicKeyThe peer we syned with.
§outcome: SyncOutcomeThe outcome of the sync operation
§timings: TimingsThe time this operation took
Trait Implementations§
source§impl Clone for SyncFinished
source§fn clone(&self) -> SyncFinished
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moreAuto Trait Implementations§
§impl Freeze for SyncFinished
§impl RefUnwindSafe for SyncFinished
§impl Send for SyncFinished
§impl Sync for SyncFinished
§impl Unpin for SyncFinished
§impl UnwindSafe for SyncFinished
Blanket Implementations§
source§impl<T> Any for Twhere
diff --git a/pr/2595/docs/iroh_docs/store/fs/struct.ContentHashesIterator.html b/pr/2595/docs/iroh_docs/store/fs/struct.ContentHashesIterator.html
index 8bebf68ec6..df1fc8865f 100644
--- a/pr/2595/docs/iroh_docs/store/fs/struct.ContentHashesIterator.html
+++ b/pr/2595/docs/iroh_docs/store/fs/struct.ContentHashesIterator.html
@@ -6,7 +6,7 @@ It needs a copy of a redb::ReadOnlyTable to be self-contained.
Implementations§
Trait Implementations§
source§impl Debug for ContentHashesIterator
Trait Implementations§
source§impl Debug for ContentHashesIterator
source§impl Iterator for ContentHashesIterator
source§fn next(&mut self) -> Option<Self::Item>
Advances the iterator and returns the next value. Read moresource§fn next_chunk<const N: usize>(
&mut self
) -> Result<[Self::Item; N], IntoIter<Self::Item, N>>where
Self: Sized,
🔬This is a nightly-only experimental API. (iter_next_chunk)Advances the iterator and returns an array containing the next N values. Read more1.0.0 · source§fn size_hint(&self) -> (usize, Option<usize>)
Returns the bounds on the remaining length of the iterator. Read more1.0.0 · source§fn count(self) -> usizewhere
diff --git a/pr/2595/docs/iroh_docs/struct.AuthorId.html b/pr/2595/docs/iroh_docs/struct.AuthorId.html
index 7dfa3dea5b..02221b0eb6 100644
--- a/pr/2595/docs/iroh_docs/struct.AuthorId.html
+++ b/pr/2595/docs/iroh_docs/struct.AuthorId.html
@@ -156,6 +156,6 @@ letters are used (e.g. F9B4CA)
Into<Dispatch>, source§fn with_current_subscriber(self) -> WithDispatch<Self>
source§impl<T> DeserializeOwned for Twhere
- T: for<'de> Deserialize<'de>,
§impl<T> PeerIdentity for Twhere
+ T: for<'de> Deserialize<'de>,
source§impl<T> PeerIdentity for T
source§impl<T> RuleType for T
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_docs/struct.AuthorPublicKey.html b/pr/2595/docs/iroh_docs/struct.AuthorPublicKey.html
index 8e72b11c8a..7a83ce68e4 100644
--- a/pr/2595/docs/iroh_docs/struct.AuthorPublicKey.html
+++ b/pr/2595/docs/iroh_docs/struct.AuthorPublicKey.html
@@ -148,6 +148,6 @@ builds. Into<Dispatch>,source§fn with_current_subscriber(self) -> WithDispatch<Self>
source§impl<T> DeserializeOwned for Twhere
- T: for<'de> Deserialize<'de>,
§impl<T> PeerIdentity for Twhere
+ T: for<'de> Deserialize<'de>,
source§impl<T> PeerIdentity for T
source§impl<T> RuleType for T
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_docs/struct.DocTicket.html b/pr/2595/docs/iroh_docs/struct.DocTicket.html
index d53a93c4c4..fd1bb5eb02 100644
--- a/pr/2595/docs/iroh_docs/struct.DocTicket.html
+++ b/pr/2595/docs/iroh_docs/struct.DocTicket.html
@@ -1,13 +1,13 @@
DocTicket in iroh_docs - Rust pub struct DocTicket {
pub capability: Capability,
- pub nodes: Vec<NodeAddr>,
+ pub nodes: Vec<NodeAddr>,
}
Expand description
Contains both a key (either secret or public) to a document, and a list of peers to join.
Fields§
§capability: Capabilityeither a public or private key
-§nodes: Vec<NodeAddr>A list of nodes to contact.
-Implementations§
source§impl DocTicket
sourcepub fn new(capability: Capability, peers: Vec<NodeAddr>) -> Self
Create a new doc ticket
+§nodes: Vec<NodeAddr>A list of nodes to contact.
+Implementations§
Trait Implementations§
source§impl<'de> Deserialize<'de> for DocTicket
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
- __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreAuto Trait Implementations§
§impl Freeze for DocTicket
§impl RefUnwindSafe for DocTicket
§impl Send for DocTicket
§impl Sync for DocTicket
§impl Unpin for DocTicket
§impl UnwindSafe for DocTicket
Blanket Implementations§
source§impl<T> Any for Twhere
+ __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreAuto Trait Implementations§
§impl Freeze for DocTicket
§impl RefUnwindSafe for DocTicket
§impl Send for DocTicket
§impl Sync for DocTicket
§impl Unpin for DocTicket
§impl UnwindSafe for DocTicket
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
diff --git a/pr/2595/docs/iroh_docs/struct.NamespaceId.html b/pr/2595/docs/iroh_docs/struct.NamespaceId.html
index 433d51afc6..f9acda8e94 100644
--- a/pr/2595/docs/iroh_docs/struct.NamespaceId.html
+++ b/pr/2595/docs/iroh_docs/struct.NamespaceId.html
@@ -156,6 +156,6 @@ letters are used (e.g. F9B4CA)
Into<Dispatch>, source§fn with_current_subscriber(self) -> WithDispatch<Self>
source§impl<T> DeserializeOwned for Twhere
- T: for<'de> Deserialize<'de>,
§impl<T> PeerIdentity for Twhere
+ T: for<'de> Deserialize<'de>,
source§impl<T> PeerIdentity for T
source§impl<T> RuleType for T
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_docs/struct.NamespacePublicKey.html b/pr/2595/docs/iroh_docs/struct.NamespacePublicKey.html
index 350dea9049..72b75ed510 100644
--- a/pr/2595/docs/iroh_docs/struct.NamespacePublicKey.html
+++ b/pr/2595/docs/iroh_docs/struct.NamespacePublicKey.html
@@ -147,6 +147,6 @@ builds.Into<Dispatch>,source§fn with_current_subscriber(self) -> WithDispatch<Self>
source§impl<T> DeserializeOwned for Twhere
- T: for<'de> Deserialize<'de>,
§impl<T> PeerIdentity for Twhere
+ T: for<'de> Deserialize<'de>,
source§impl<T> PeerIdentity for T
source§impl<T> RuleType for T
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_docs/sync/struct.Entry.html b/pr/2595/docs/iroh_docs/sync/struct.Entry.html
index 55bf06044f..055a4b6f54 100644
--- a/pr/2595/docs/iroh_docs/sync/struct.Entry.html
+++ b/pr/2595/docs/iroh_docs/sync/struct.Entry.html
@@ -1,6 +1,6 @@
Entry in iroh_docs::sync - Rust pub struct Entry { /* private fields */ }
Expand description
A single entry in a Replica
An entry is identified by a key, its Author, and the Replica’s
-NamespaceSecret. Its value is the 32-byte BLAKE3 hash
+NamespaceSecret. Its value is the 32-byte BLAKE3 hash
of the entry’s content data, the size of this content data, and a timestamp.
Implementations§
source§impl Entry
sourcepub fn new(id: RecordIdentifier, record: Record) -> Self
Create a new entry
sourcepub fn new_empty(id: RecordIdentifier) -> Self
Create a new empty entry with the current timestamp.
@@ -15,7 +15,7 @@ of the entry’s content data, the size of this content data, and a timestamp.
sourcepub fn sign(self, namespace: &NamespaceSecret, author: &Author) -> SignedEntry
Sign this entry with a NamespaceSecret and Author.
Methods from Deref<Target = Record>§
sourcepub fn content_len(&self) -> u64
Get the length of the data addressed by this record’s content hash.
-sourcepub fn content_hash(&self) -> Hash
Get the [struct@Hash] of the content data of this record.
+sourcepub fn content_hash(&self) -> Hash
Get the Hash of the content data of this record.
Trait Implementations§
source§impl<'de> Deserialize<'de> for Entry
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl From<SignedEntry> for Entry
source§fn from(value: SignedEntry) -> Self
Converts to this type from the input type.source§impl Ord for Entry
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
diff --git a/pr/2595/docs/iroh_docs/sync/struct.Record.html b/pr/2595/docs/iroh_docs/sync/struct.Record.html
index 94479a973e..f06cccab52 100644
--- a/pr/2595/docs/iroh_docs/sync/struct.Record.html
+++ b/pr/2595/docs/iroh_docs/sync/struct.Record.html
@@ -1,11 +1,11 @@
Record in iroh_docs::sync - Rust pub struct Record { /* private fields */ }
Expand description
The data part of an entry in a Replica.
-Implementations§
source§impl Record
Implementations§
source§impl Record
sourcepub fn empty_current() -> Self
Create a tombstone record with the timestamp set to now.
sourcepub fn new_current(hash: Hash, len: u64) -> Self
Create a new Record with the timestamp set to now.
+sourcepub fn new_current(hash: Hash, len: u64) -> Self
Create a new Record with the timestamp set to now.
sourcepub fn content_len(&self) -> u64
Get the length of the data addressed by this record’s content hash.
-sourcepub fn content_hash(&self) -> Hash
Get the [struct@Hash] of the content data of this record.
+sourcepub fn content_hash(&self) -> Hash
Get the Hash of the content data of this record.
Trait Implementations§
source§impl<'de> Deserialize<'de> for Record
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl Ord for Record
Ordering for entry values.
diff --git a/pr/2595/docs/iroh_docs/sync/struct.Replica.html b/pr/2595/docs/iroh_docs/sync/struct.Replica.html
index 23a9798651..c4e161f3c3 100644
--- a/pr/2595/docs/iroh_docs/sync/struct.Replica.html
+++ b/pr/2595/docs/iroh_docs/sync/struct.Replica.html
@@ -5,7 +5,7 @@
&mut self,
key: impl AsRef<[u8]>,
author: &Author,
- hash: Hash,
+ hash: Hash,
len: u64
) -> Result<usize, InsertError>Insert a new record at the given key.
The entry will by signed by the provided author.
@@ -35,7 +35,7 @@ or an error if the entry failed to validate or if a store operation failed.
key: impl AsRef<[u8]>,
author: &Author,
data: impl AsRef<[u8]>
-) -> Result<Hash, InsertError>Hashes the given data and inserts it.
+) -> Result<Hash, InsertError>Hashes the given data and inserts it.
This does not store the content, just the record of it.
Returns the calculated hash.
sourcepub fn record_id(
diff --git a/pr/2595/docs/iroh_docs/sync/struct.SignedEntry.html b/pr/2595/docs/iroh_docs/sync/struct.SignedEntry.html
index 21644eacb1..9ef5e98134 100644
--- a/pr/2595/docs/iroh_docs/sync/struct.SignedEntry.html
+++ b/pr/2595/docs/iroh_docs/sync/struct.SignedEntry.html
@@ -14,7 +14,7 @@
sourcepub fn signature(&self) -> &EntrySignature
Get the signature.
sourcepub fn validate_empty(&self) -> Result<(), ValidationFailure>
Validate that the entry has the empty hash if the length is 0, or a non-zero length.
sourcepub fn content_hash(&self) -> Hash
Get the content [struct@Hash] of the entry.
+sourcepub fn content_hash(&self) -> Hash
Get the content Hash of the entry.
sourcepub fn content_len(&self) -> u64
Get the content length of the entry.
Get the author bytes of this entry.
Methods from Deref<Target = Record>§
sourcepub fn content_len(&self) -> u64
Get the length of the data addressed by this record’s content hash.
-sourcepub fn content_hash(&self) -> Hash
Get the [struct@Hash] of the content data of this record.
+sourcepub fn content_hash(&self) -> Hash
Get the Hash of the content data of this record.
Trait Implementations§
source§impl Clone for SignedEntry
source§fn clone(&self) -> SignedEntry
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moresource§impl Debug for SignedEntry
source§impl Deref for SignedEntry
source§impl<'de> Deserialize<'de> for SignedEntry
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl From<SignedEntry> for Entry
source§fn from(value: SignedEntry) -> Self
Converts to this type from the input type.source§impl Ord for SignedEntry
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
diff --git a/pr/2595/docs/iroh_docs/sync/type.ContentStatusCallback.html b/pr/2595/docs/iroh_docs/sync/type.ContentStatusCallback.html
index 46d5a5a49c..84ffdbe8ee 100644
--- a/pr/2595/docs/iroh_docs/sync/type.ContentStatusCallback.html
+++ b/pr/2595/docs/iroh_docs/sync/type.ContentStatusCallback.html
@@ -1,2 +1,2 @@
-ContentStatusCallback in iroh_docs::sync - Rust Type Alias iroh_docs::sync::ContentStatusCallback
source · pub type ContentStatusCallback = Arc<dyn Fn(Hash) -> ContentStatus + Send + Sync + 'static>;
Expand description
Callback that may be set on a replica to determine the availability status for a content hash.
+ContentStatusCallback in iroh_docs::sync - Rust Type Alias iroh_docs::sync::ContentStatusCallback
source · pub type ContentStatusCallback = Arc<dyn Fn(Hash) -> ContentStatus + Send + Sync + 'static>;
Expand description
Callback that may be set on a replica to determine the availability status for a content hash.
Aliased Type§
struct ContentStatusCallback { /* private fields */ }
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_net/discovery/dns/index.html b/pr/2595/docs/iroh_net/discovery/dns/index.html
index 5a80538422..a752b49d78 100644
--- a/pr/2595/docs/iroh_net/discovery/dns/index.html
+++ b/pr/2595/docs/iroh_net/discovery/dns/index.html
@@ -1,2 +1,2 @@
-iroh_net::discovery::dns - Rust Expand description
DNS node discovery for iroh-net
+iroh_net::discovery::dns - Rust Expand description
DNS node discovery for iroh-net
Structs§
- DNS node discovery
Constants§
- The n0 testing DNS node origin, for production.
- The n0 testing DNS node origin, for testing.
- Testing DNS node origin, must run server from
crate::test_utils::DnsPkarrServer.
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_net/discovery/dns/struct.DnsDiscovery.html b/pr/2595/docs/iroh_net/discovery/dns/struct.DnsDiscovery.html
index 3e7d5d71cc..7628fb45a9 100644
--- a/pr/2595/docs/iroh_net/discovery/dns/struct.DnsDiscovery.html
+++ b/pr/2595/docs/iroh_net/discovery/dns/struct.DnsDiscovery.html
@@ -28,7 +28,7 @@ custom discovery mechanism.
For testing it is also possible to use the N0_DNS_NODE_ORIGIN_STAGING domain
with DnsDiscovery::new. This would then use a hosted discovery service again,
but for testing purposes.
-Trait Implementations§
Trait Implementations§
source§impl Debug for DnsDiscovery
source§impl Discovery for DnsDiscovery
source§fn resolve(
&self,
ep: Endpoint,
node_id: NodeId
diff --git a/pr/2595/docs/iroh_net/discovery/trait.Discovery.html b/pr/2595/docs/iroh_net/discovery/trait.Discovery.html
index a53a618708..d3832a56b5 100644
--- a/pr/2595/docs/iroh_net/discovery/trait.Discovery.html
+++ b/pr/2595/docs/iroh_net/discovery/trait.Discovery.html
@@ -29,4 +29,4 @@ These tasks will be run on the runtime of the Option<BoxStream<Result<DiscoveryItem>>>
Implementors§
source§impl Discovery for DnsDiscovery
source§impl Discovery for LocalSwarmDiscovery
source§impl Discovery for PkarrPublisher
source§impl Discovery for PkarrResolver
source§impl Discovery for ConcurrentDiscovery
\ No newline at end of file
+
Implementors§
source§impl Discovery for DnsDiscovery
source§impl Discovery for LocalSwarmDiscovery
source§impl Discovery for PkarrPublisher
source§impl Discovery for PkarrResolver
source§impl Discovery for ConcurrentDiscovery
\ No newline at end of file
diff --git a/pr/2595/docs/src/iroh_net/discovery/dns.rs.html b/pr/2595/docs/src/iroh_net/discovery/dns.rs.html
index dd1a279fb3..1d32545ed3 100644
--- a/pr/2595/docs/src/iroh_net/discovery/dns.rs.html
+++ b/pr/2595/docs/src/iroh_net/discovery/dns.rs.html
@@ -97,6 +97,10 @@
97
98
99
+100
+101
+102
+103
//! DNS node discovery for iroh-net
use anyhow::Result;
@@ -182,6 +186,10 @@
fn resolve(&self, ep: Endpoint, node_id: NodeId) -> Option<BoxStream<Result<DiscoveryItem>>> {
let resolver = ep.dns_resolver().clone();
let origin_domain = self.origin_domain.clone();
+ #[cfg(any(test, feature = "test-utils"))]
+ if origin_domain.contains(&TEST_DNS_NODE_ORIGIN.to_string()) {
+ panic!("wait. THIS IS ILLEGAL!");
+ }
let fut = async move {
let node_addr = resolver
.lookup_by_id_staggered(&node_id, &origin_domain, DNS_STAGGERING_MS)
diff --git a/pr/2595/docs/trait.impl/iroh_base/ticket/trait.Ticket.js b/pr/2595/docs/trait.impl/iroh_base/ticket/trait.Ticket.js
index 12fa1e3ee5..5d209fabd2 100644
--- a/pr/2595/docs/trait.impl/iroh_base/ticket/trait.Ticket.js
+++ b/pr/2595/docs/trait.impl/iroh_base/ticket/trait.Ticket.js
@@ -1,5 +1,5 @@
(function() {var implementors = {
"iroh":[],
"iroh_base":[],
-"iroh_docs":[["impl Ticket for DocTicket"]]
+"iroh_docs":[["impl Ticket for DocTicket"]]
};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
diff --git a/pr/2595/docs/type.impl/std/primitive.array.js b/pr/2595/docs/type.impl/std/primitive.array.js
index 588a8b53a3..3006964922 100644
--- a/pr/2595/docs/type.impl/std/primitive.array.js
+++ b/pr/2595/docs/type.impl/std/primitive.array.js
@@ -1,4 +1,4 @@
(function() {var type_impls = {
"iroh":[["source§impl<T, const N: usize> [T; N]
1.55.0 · sourcepub fn map<F, U>(self, f: F) -> [U; N]where\n F: FnMut(T) -> U,
Returns an array of the same size as self, with function f applied to each element\nin order.
\nIf you don’t necessarily need a new fixed-size array, consider using\nIterator::map instead.
\n§Note on performance and stack usage
\nUnfortunately, usages of this method are currently not always optimized\nas well as they could be. This mainly concerns large arrays, as mapping\nover small arrays seem to be optimized just fine. Also note that in\ndebug mode (i.e. without any optimizations), this method can use a lot\nof stack space (a few times the size of the array or more).
\nTherefore, in performance-critical code, try to avoid using this method\non large arrays or check the emitted code. Also try to avoid chained\nmaps (e.g. arr.map(...).map(...)).
\nIn many cases, you can instead use Iterator::map by calling .iter()\nor .into_iter() on your array. [T; N]::map is only necessary if you\nreally need a new array of the same size as the result. Rust’s lazy\niterators tend to get optimized very well.
\n§Examples
\nlet x = [1, 2, 3];\nlet y = x.map(|v| v + 1);\nassert_eq!(y, [2, 3, 4]);\n\nlet x = [1, 2, 3];\nlet mut temp = 0;\nlet y = x.map(|v| { temp += 1; v * temp });\nassert_eq!(y, [1, 4, 9]);\n\nlet x = [\"Ferris\", \"Bueller's\", \"Day\", \"Off\"];\nlet y = x.map(|v| v.len());\nassert_eq!(y, [6, 9, 3, 3]);
\nsourcepub fn try_map<F, R>(\n self,\n f: F\n) -> <<R as Try>::Residual as Residual<[<R as Try>::Output; N]>>::TryType
🔬This is a nightly-only experimental API. (array_try_map)
A fallible function f applied to each element on array self in order to\nreturn an array the same size as self or the first error encountered.
\nThe return type of this function depends on the return type of the closure.\nIf you return Result<T, E> from the closure, you’ll get a Result<[T; N], E>.\nIf you return Option<T> from the closure, you’ll get an Option<[T; N]>.
\n§Examples
\n#![feature(array_try_map)]\n\nlet a = [\"1\", \"2\", \"3\"];\nlet b = a.try_map(|v| v.parse::<u32>()).unwrap().map(|v| v + 1);\nassert_eq!(b, [2, 3, 4]);\n\nlet a = [\"1\", \"2a\", \"3\"];\nlet b = a.try_map(|v| v.parse::<u32>());\nassert!(b.is_err());\n\nuse std::num::NonZero;\n\nlet z = [1, 2, 0, 3, 4];\nassert_eq!(z.try_map(NonZero::new), None);\n\nlet a = [1, 2, 3];\nlet b = a.try_map(NonZero::new);\nlet c = b.map(|x| x.map(NonZero::get));\nassert_eq!(c, Some(a));
\n1.57.0 (const: 1.57.0) · sourcepub const fn as_slice(&self) -> &[T]
Returns a slice containing the entire array. Equivalent to &s[..].
\n1.57.0 · sourcepub fn as_mut_slice(&mut self) -> &mut [T]
Returns a mutable slice containing the entire array. Equivalent to\n&mut s[..].
\n1.77.0 · sourcepub fn each_ref(&self) -> [&T; N]
Borrows each element and returns an array of references with the same\nsize as self.
\n§Example
\nlet floats = [3.1, 2.7, -1.0];\nlet float_refs: [&f64; 3] = floats.each_ref();\nassert_eq!(float_refs, [&3.1, &2.7, &-1.0]);
\nThis method is particularly useful if combined with other methods, like\nmap. This way, you can avoid moving the original\narray if its elements are not Copy.
\n\nlet strings = [\"Ferris\".to_string(), \"♥\".to_string(), \"Rust\".to_string()];\nlet is_ascii = strings.each_ref().map(|s| s.is_ascii());\nassert_eq!(is_ascii, [true, false, true]);\n\n// We can still access the original array: it has not been moved.\nassert_eq!(strings.len(), 3);
\n1.77.0 · sourcepub fn each_mut(&mut self) -> [&mut T; N]
Borrows each element mutably and returns an array of mutable references\nwith the same size as self.
\n§Example
\n\nlet mut floats = [3.1, 2.7, -1.0];\nlet float_refs: [&mut f64; 3] = floats.each_mut();\n*float_refs[0] = 0.0;\nassert_eq!(float_refs, [&mut 0.0, &mut 2.7, &mut -1.0]);\nassert_eq!(floats, [0.0, 2.7, -1.0]);
\nsourcepub fn split_array_ref<const M: usize>(&self) -> (&[T; M], &[T])
🔬This is a nightly-only experimental API. (split_array)
Divides one array reference into two at an index.
\nThe first will contain all indices from [0, M) (excluding\nthe index M itself) and the second will contain all\nindices from [M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet v = [1, 2, 3, 4, 5, 6];\n\n{\n let (left, right) = v.split_array_ref::<0>();\n assert_eq!(left, &[]);\n assert_eq!(right, &[1, 2, 3, 4, 5, 6]);\n}\n\n{\n let (left, right) = v.split_array_ref::<2>();\n assert_eq!(left, &[1, 2]);\n assert_eq!(right, &[3, 4, 5, 6]);\n}\n\n{\n let (left, right) = v.split_array_ref::<6>();\n assert_eq!(left, &[1, 2, 3, 4, 5, 6]);\n assert_eq!(right, &[]);\n}
\nsourcepub fn split_array_mut<const M: usize>(&mut self) -> (&mut [T; M], &mut [T])
🔬This is a nightly-only experimental API. (split_array)
Divides one mutable array reference into two at an index.
\nThe first will contain all indices from [0, M) (excluding\nthe index M itself) and the second will contain all\nindices from [M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet mut v = [1, 0, 3, 0, 5, 6];\nlet (left, right) = v.split_array_mut::<2>();\nassert_eq!(left, &mut [1, 0][..]);\nassert_eq!(right, &mut [3, 0, 5, 6]);\nleft[1] = 2;\nright[1] = 4;\nassert_eq!(v, [1, 2, 3, 4, 5, 6]);
\nsourcepub fn rsplit_array_ref<const M: usize>(&self) -> (&[T], &[T; M])
🔬This is a nightly-only experimental API. (split_array)
Divides one array reference into two at an index from the end.
\nThe first will contain all indices from [0, N - M) (excluding\nthe index N - M itself) and the second will contain all\nindices from [N - M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet v = [1, 2, 3, 4, 5, 6];\n\n{\n let (left, right) = v.rsplit_array_ref::<0>();\n assert_eq!(left, &[1, 2, 3, 4, 5, 6]);\n assert_eq!(right, &[]);\n}\n\n{\n let (left, right) = v.rsplit_array_ref::<2>();\n assert_eq!(left, &[1, 2, 3, 4]);\n assert_eq!(right, &[5, 6]);\n}\n\n{\n let (left, right) = v.rsplit_array_ref::<6>();\n assert_eq!(left, &[]);\n assert_eq!(right, &[1, 2, 3, 4, 5, 6]);\n}
\nsourcepub fn rsplit_array_mut<const M: usize>(&mut self) -> (&mut [T], &mut [T; M])
🔬This is a nightly-only experimental API. (split_array)
Divides one mutable array reference into two at an index from the end.
\nThe first will contain all indices from [0, N - M) (excluding\nthe index N - M itself) and the second will contain all\nindices from [N - M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet mut v = [1, 0, 3, 0, 5, 6];\nlet (left, right) = v.rsplit_array_mut::<4>();\nassert_eq!(left, &mut [1, 0]);\nassert_eq!(right, &mut [3, 0, 5, 6][..]);\nleft[1] = 2;\nright[1] = 4;\nassert_eq!(v, [1, 2, 3, 4, 5, 6]);
\n",0,"iroh::docs::PeerIdBytes"],["source§impl<const N: usize> [u8; N]
sourcepub const fn as_ascii(&self) -> Option<&[AsciiChar; N]>
🔬This is a nightly-only experimental API. (ascii_char)
Converts this array of bytes into a array of ASCII characters,\nor returns None if any of the characters is non-ASCII.
\n§Examples
\n#![feature(ascii_char)]\n#![feature(const_option)]\n\nconst HEX_DIGITS: [std::ascii::Char; 16] =\n *b\"0123456789abcdef\".as_ascii().unwrap();\n\nassert_eq!(HEX_DIGITS[1].as_str(), \"1\");\nassert_eq!(HEX_DIGITS[10].as_str(), \"a\");
\nsourcepub const unsafe fn as_ascii_unchecked(&self) -> &[AsciiChar; N]
🔬This is a nightly-only experimental API. (ascii_char)
Converts this array of bytes into a array of ASCII characters,\nwithout checking whether they’re valid.
\n§Safety
\nEvery byte in the array must be in 0..=127, or else this is UB.
\n",0,"iroh::docs::PeerIdBytes"],["§impl<T> Array for [T; 32]where\n T: Default,
§fn as_slice_mut(&mut self) -> &mut [T]
Gives a unique slice over the whole thing. Read more","Array","iroh::docs::PeerIdBytes"],["","Array","iroh::docs::PeerIdBytes"],["§impl<const N: usize, T> AsBytes for [T; N]where\n T: AsBytes,
§fn write_to_prefix(&self, bytes: &mut [u8]) -> Option<()>
","AsBytes","iroh::docs::PeerIdBytes"],["","AsBytes","iroh::docs::PeerIdBytes"],["","AsMut<[T]>","iroh::docs::PeerIdBytes"],["","AsRef<[T]>","iroh::docs::PeerIdBytes"],["§impl<T, const N: usize> BitView for [T; N]where\n T: BitStore,
Note that overly-large arrays may cause the conversions to fail.
\n§fn view_bits<O>(&self) -> &BitSlice<T, O>where\n O: BitOrder,
Views a memory region as an immutable bit-slice.§fn try_view_bits<O>(&self) -> Result<&BitSlice<T, O>, BitSpanError<T>>where\n O: BitOrder,
Attempts to view a memory region as an immutable bit-slice. Read more§fn view_bits_mut<O>(&mut self) -> &mut BitSlice<T, O>where\n O: BitOrder,
Views a memory region as a mutable bit-slice.§fn try_view_bits_mut<O>(\n &mut self\n) -> Result<&mut BitSlice<T, O>, BitSpanError<T>>where\n O: BitOrder,
Attempts to view a memory region as a mutable bit-slice. Read more","BitView","iroh::docs::PeerIdBytes"],["§impl<T, const N: usize> BitViewSized for [T; N]where\n T: BitStore,
§fn as_raw_slice(&self) -> &[<[T; N] as BitView>::Store]
Views the type as a slice of its elements.§fn as_raw_mut_slice(&mut self) -> &mut [<[T; N] as BitView>::Store]
Views the type as a mutable slice of its elements.§fn into_bitarray<O>(self) -> BitArray<Self, O>where\n O: BitOrder,
Wraps self in a BitArray.","BitViewSized","iroh::docs::PeerIdBytes"],["","Borrow<[T]>","iroh::docs::PeerIdBytes"],["1.4.0 · source§impl<T, const N: usize> BorrowMut<[T]> for [T; N]
source§fn borrow_mut(&mut self) -> &mut [T]
Mutably borrows from an owned value. Read more","BorrowMut<[T]>","iroh::docs::PeerIdBytes"],["","Chain","iroh::docs::PeerIdBytes"],["","Clone","iroh::docs::PeerIdBytes"],["","Debug","iroh::docs::PeerIdBytes"],["§impl<const N: usize> Decode for [u8; N]
Decodes a byte array from byte[n] as described in RFC4251 § 5:
\n\nA byte represents an arbitrary 8-bit value (octet). Fixed length\ndata is sometimes represented as an array of bytes, written\nbyte[n], where n is the number of bytes in the array.
\n
\n","Decode","iroh::docs::PeerIdBytes"],["§impl<'a, T, const N: usize> DecodeValue<'a> for [T; N]where\n T: Decode<'a>,
§fn decode_value<R>(reader: &mut R, header: Header) -> Result<[T; N], Error>where\n R: Reader<'a>,
Attempt to decode this message using the provided [Reader].","DecodeValue<'a>","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["source§impl<'de, T> Deserialize<'de> for [T; 32]where\n T: Deserialize<'de>,
source§fn deserialize<D>(\n deserializer: D\n) -> Result<[T; 32], <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more","Deserialize<'de>","iroh::docs::PeerIdBytes"],["source§impl<'de, const N: usize> Deserialize<'de> for [u8; N]
source§fn deserialize<D>(\n deserializer: D\n) -> Result<[u8; N], <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
","Deserialize<'de>","iroh::docs::PeerIdBytes"],["§impl<const N: usize> Encode for [u8; N]
Encodes [u8; N] into byte[n] as described in RFC4251 § 5:
\n\nA byte represents an arbitrary 8-bit value (octet). Fixed length\ndata is sometimes represented as an array of bytes, written\nbyte[n], where n is the number of bytes in the array.
\n
\n§fn encoded_len(&self) -> Result<usize, Error>
Get the length of this type encoded in bytes, prior to Base64 encoding.§fn encode(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value using the provided [Writer].§fn encoded_len_prefixed(&self) -> Result<usize, Error>
Return the length of this type after encoding when prepended with a\nuint32 length prefix.§fn encode_prefixed(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value, first prepending a uint32 length prefix\nset to [Encode::encoded_len].","Encode","iroh::docs::PeerIdBytes"],["","EncodeLabelSet","iroh::docs::PeerIdBytes"],["§impl<T, const N: usize> EncodeValue for [T; N]where\n T: Encode,
","EncodeValue","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["§impl<'a> FindToken<&'a u8> for [u8; 32]
§fn find_token(&self, token: &u8) -> bool
Returns true if self contains the token","FindToken<&'a u8>","iroh::docs::PeerIdBytes"],["§impl FindToken<u8> for [u8; 32]
§fn find_token(&self, token: u8) -> bool
Returns true if self contains the token","FindToken","iroh::docs::PeerIdBytes"],["","FixedTag","iroh::docs::PeerIdBytes"],["","From<&Signature>","iroh::docs::PeerIdBytes"],["","From","iroh::docs::PeerIdBytes"],["§impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>>> for [T; 32]
","From, B0>, B0>, B0>, B0>, B0>>>","iroh::docs::PeerIdBytes"],["","From","iroh::docs::PeerIdBytes"],["","From","iroh::docs::PeerIdBytes"],["","From>","iroh::docs::PeerIdBytes"],["","From","iroh::docs::PeerIdBytes"],["","From","iroh::docs::PeerIdBytes"],["","From","iroh::docs::PeerIdBytes"],["","From>","iroh::docs::PeerIdBytes"],["§impl<const N: usize, T> FromBytes for [T; N]where\n T: FromBytes,
§fn slice_from_prefix(bytes: &[u8], count: usize) -> Option<(&[Self], &[u8])>where\n Self: Sized,
Interprets the prefix of the given bytes as a &[Self] with length\nequal to count without copying. Read more§fn slice_from_suffix(bytes: &[u8], count: usize) -> Option<(&[u8], &[Self])>where\n Self: Sized,
Interprets the suffix of the given bytes as a &[Self] with length\nequal to count without copying. Read more§fn read_from_prefix(bytes: &[u8]) -> Option<Self>where\n Self: Sized,
","FromBytes","iroh::docs::PeerIdBytes"],["","FromHex","iroh::docs::PeerIdBytes"],["","FromZeroes","iroh::docs::PeerIdBytes"],["","Hash","iroh::docs::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Hash for [T; N]where\n T: Hash,
The hash of an array is the same as that of the corresponding slice,\nas required by the Borrow implementation.
\n\nuse std::hash::BuildHasher;\n\nlet b = std::hash::RandomState::new();\nlet a: [u8; 3] = [0xa8, 0x3c, 0x09];\nlet s: &[u8] = &[0xa8, 0x3c, 0x09];\nassert_eq!(b.hash_one(a), b.hash_one(s));
\n","Hash","iroh::docs::PeerIdBytes"],["","Index","iroh::docs::PeerIdBytes"],["","IndexMut","iroh::docs::PeerIdBytes"],["","InputLength","iroh::docs::PeerIdBytes"],["1.53.0 · source§impl<T, const N: usize> IntoIterator for [T; N]
source§fn into_iter(self) -> <[T; N] as IntoIterator>::IntoIter
Creates a consuming iterator, that is, one that moves each value out of\nthe array (from start to end). The array cannot be used after calling\nthis unless T implements Copy, so the whole array is copied.
\nArrays have special behavior when calling .into_iter() prior to the\n2021 edition – see the array Editions section for more information.
\n","IntoIterator","iroh::docs::PeerIdBytes"],["§impl<const N: usize> IntoResponse for [u8; N]
§fn into_response(self) -> Response<Body>
Create a response.","IntoResponse","iroh::docs::PeerIdBytes"],["§impl<Fut, const N: usize> Join for [Fut; N]where\n Fut: IntoFuture,
§type Output = [<Fut as IntoFuture>::Output; N]
The resulting output type.§type Future = Join<<Fut as IntoFuture>::IntoFuture, N>
The Future implementation returned by this method.","Join","iroh::docs::PeerIdBytes"],["","Key","iroh::docs::PeerIdBytes"],["§impl<T, const N: usize> MaxSize for [T; N]where\n T: MaxSize,
§const POSTCARD_MAX_SIZE: usize = _
The maximum possible size that the serialization of this\ntype can have, in bytes.","MaxSize","iroh::docs::PeerIdBytes"],["","Merge","iroh::docs::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Ord for [T; N]where\n T: Ord,
Implements comparison of arrays lexicographically.
\n1.21.0 · source§fn max(self, other: Self) -> Selfwhere\n Self: Sized,
Compares and returns the maximum of two values. Read more","Ord","iroh::docs::PeerIdBytes"],["","PartialEq<&[U]>","iroh::docs::PeerIdBytes"],["1.0.0 · source§impl<T, U, const N: usize> PartialEq<&mut [U]> for [T; N]where\n T: PartialEq<U>,
","PartialEq<&mut [U]>","iroh::docs::PeerIdBytes"],["","PartialEq<[U]>","iroh::docs::PeerIdBytes"],["","PartialEq<[U; N]>","iroh::docs::PeerIdBytes"],["","PartialEq","iroh::docs::PeerIdBytes"],["§impl<A, B, const N: usize, const M: usize> PartialEq<Vec<A, N>> for [B; M]where\n A: PartialEq<B>,
","PartialEq>","iroh::docs::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> PartialOrd for [T; N]where\n T: PartialOrd,
Implements comparison of arrays lexicographically.
\nsource§fn le(&self, other: &[T; N]) -> bool
This method tests less than or equal to (for self and other) and is used by the <=\noperator. Read more","PartialOrd","iroh::docs::PeerIdBytes"],["§impl<Fut, const N: usize> Race for [Fut; N]where\n Fut: IntoFuture,
§type Output = <Fut as IntoFuture>::Output
The resulting output type.§type Future = Race<<Fut as IntoFuture>::IntoFuture, N>
Which kind of future are we turning this into?","Race","iroh::docs::PeerIdBytes"],["§impl<Fut, T, E, const N: usize> RaceOk for [Fut; N]where\n Fut: IntoFuture<Output = Result<T, E>>,
§type Future = RaceOk<<Fut as IntoFuture>::IntoFuture, T, E, N>
Which kind of future are we turning this into?","RaceOk","iroh::docs::PeerIdBytes"],["","Schema","iroh::docs::PeerIdBytes"],["source§impl<T> Serialize for [T; 32]where\n T: 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","iroh::docs::PeerIdBytes"],["source§impl<const N: usize> Serialize for [u8; N]
source§fn serialize<S>(\n &self,\n serializer: S\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where\n S: Serializer,
","Serialize","iroh::docs::PeerIdBytes"],["1.51.0 · source§impl<T, const N: usize> SlicePattern for [T; N]
","SlicePattern","iroh::docs::PeerIdBytes"],["1.34.0 · source§impl<T, const N: usize> TryFrom<&[T]> for [T; N]where\n T: Copy,
Tries to create an array [T; N] by copying from a slice &[T]. Succeeds if\nslice.len() == N.
\n\nlet bytes: [u8; 3] = [1, 0, 2];\n\nlet bytes_head: [u8; 2] = <[u8; 2]>::try_from(&bytes[0..2]).unwrap();\nassert_eq!(1, u16::from_le_bytes(bytes_head));\n\nlet bytes_tail: [u8; 2] = bytes[1..3].try_into().unwrap();\nassert_eq!(512, u16::from_le_bytes(bytes_tail));
\n§type Error = TryFromSliceError
The type returned in the event of a conversion error.","TryFrom<&[T]>","iroh::docs::PeerIdBytes"],["1.59.0 · source§impl<T, const N: usize> TryFrom<&mut [T]> for [T; N]where\n T: Copy,
Tries to create an array [T; N] by copying from a mutable slice &mut [T].\nSucceeds if slice.len() == N.
\n\nlet mut bytes: [u8; 3] = [1, 0, 2];\n\nlet bytes_head: [u8; 2] = <[u8; 2]>::try_from(&mut bytes[0..2]).unwrap();\nassert_eq!(1, u16::from_le_bytes(bytes_head));\n\nlet bytes_tail: [u8; 2] = (&mut bytes[1..3]).try_into().unwrap();\nassert_eq!(512, u16::from_le_bytes(bytes_tail));
\n§type Error = TryFromSliceError
The type returned in the event of a conversion error.","TryFrom<&mut [T]>","iroh::docs::PeerIdBytes"],["§impl<T, A, const N: usize> TryFrom<Vec<T, A>> for [T; N]where\n A: Allocator,
§fn try_from(vec: Vec<T, A>) -> Result<[T; N], Vec<T, A>>
Gets the entire contents of the Vec<T> as an array,\nif its size exactly matches that of the requested array.
\n§Examples
\nassert_eq!(vec![1, 2, 3].try_into(), Ok([1, 2, 3]));\nassert_eq!(<Vec<i32>>::new().try_into(), Ok([]));
\nIf the length doesn’t match, the input comes back in Err:
\n\nlet r: Result<[i32; 4], _> = (0..10).collect::<Vec<_>>().try_into();\nassert_eq!(r, Err(vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9]));
\nIf you’re fine with just getting a prefix of the Vec<T>,\nyou can call .truncate(N) first.
\n\nlet mut v = String::from(\"hello world\").into_bytes();\nv.sort();\nv.truncate(2);\nlet [a, b]: [_; 2] = v.try_into().unwrap();\nassert_eq!(a, b' ');\nassert_eq!(b, b'd');
\n","TryFrom>","iroh::docs::PeerIdBytes"],["1.48.0 · source§impl<T, A, const N: usize> TryFrom<Vec<T, A>> for [T; N]where\n A: Allocator,
source§fn try_from(vec: Vec<T, A>) -> Result<[T; N], Vec<T, A>>
Gets the entire contents of the Vec<T> as an array,\nif its size exactly matches that of the requested array.
\n§Examples
\nassert_eq!(vec![1, 2, 3].try_into(), Ok([1, 2, 3]));\nassert_eq!(<Vec<i32>>::new().try_into(), Ok([]));
\nIf the length doesn’t match, the input comes back in Err:
\n\nlet r: Result<[i32; 4], _> = (0..10).collect::<Vec<_>>().try_into();\nassert_eq!(r, Err(vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9]));
\nIf you’re fine with just getting a prefix of the Vec<T>,\nyou can call .truncate(N) first.
\n\nlet mut v = String::from(\"hello world\").into_bytes();\nv.sort();\nv.truncate(2);\nlet [a, b]: [_; 2] = v.try_into().unwrap();\nassert_eq!(a, b' ');\nassert_eq!(b, b'd');
\n","TryFrom>","iroh::docs::PeerIdBytes"],["§impl<Fut, T, E, const N: usize> TryJoin for [Fut; N]where\n Fut: IntoFuture<Output = Result<T, E>>,
§type Future = TryJoin<<Fut as IntoFuture>::IntoFuture, T, E, N>
Which kind of future are we turning this into?","TryJoin","iroh::docs::PeerIdBytes"],["§impl<const N: usize, T> Value for [T; N]where\n T: Value,
§type SelfType<'a> = [<T as Value>::SelfType<'a>; N]\nwhere\n [T; N]: 'a
SelfType<’a> must be the same type as Self with all lifetimes replaced with ’a§type AsBytes<'a> = Vec<u8>\nwhere\n [T; N]: 'a
§fn fixed_width() -> Option<usize>
Width of a fixed type, or None for variable width§fn from_bytes<'a>(data: &'a [u8]) -> [<T as Value>::SelfType<'a>; N]where\n [T; N]: 'a,
Deserializes data\nImplementations may return a view over data, or an owned type","Value","iroh::docs::PeerIdBytes"],["","ValueOrd","iroh::docs::PeerIdBytes"],["§impl<Z, const N: usize> Zeroize for [Z; N]where\n Z: Zeroize,
Impl [Zeroize] on arrays of types that impl [Zeroize].
\n","Zeroize","iroh::docs::PeerIdBytes"],["","Zip","iroh::docs::PeerIdBytes"],["source§impl<T, const N: usize> ConstParamTy for [T; N]where\n T: ConstParamTy,
","ConstParamTy","iroh::docs::PeerIdBytes"],["1.58.0 · source§impl<T, const N: usize> Copy for [T; N]where\n T: Copy,
","Copy","iroh::docs::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Eq for [T; N]where\n T: Eq,
","Eq","iroh::docs::PeerIdBytes"],["source§impl<T, const N: usize> StructuralPartialEq for [T; N]
","StructuralPartialEq","iroh::docs::PeerIdBytes"],["§impl<const N: usize, T> Unaligned for [T; N]where\n T: Unaligned,
","Unaligned","iroh::docs::PeerIdBytes"],["§impl<Z, const N: usize> ZeroizeOnDrop for [Z; N]where\n Z: ZeroizeOnDrop,
Impl [ZeroizeOnDrop] on arrays of types that impl [ZeroizeOnDrop].
\n","ZeroizeOnDrop","iroh::docs::PeerIdBytes"]],
-"iroh_docs":[["source§impl<T, const N: usize> [T; N]
1.55.0 · sourcepub fn map<F, U>(self, f: F) -> [U; N]where\n F: FnMut(T) -> U,
Returns an array of the same size as self, with function f applied to each element\nin order.
\nIf you don’t necessarily need a new fixed-size array, consider using\nIterator::map instead.
\n§Note on performance and stack usage
\nUnfortunately, usages of this method are currently not always optimized\nas well as they could be. This mainly concerns large arrays, as mapping\nover small arrays seem to be optimized just fine. Also note that in\ndebug mode (i.e. without any optimizations), this method can use a lot\nof stack space (a few times the size of the array or more).
\nTherefore, in performance-critical code, try to avoid using this method\non large arrays or check the emitted code. Also try to avoid chained\nmaps (e.g. arr.map(...).map(...)).
\nIn many cases, you can instead use Iterator::map by calling .iter()\nor .into_iter() on your array. [T; N]::map is only necessary if you\nreally need a new array of the same size as the result. Rust’s lazy\niterators tend to get optimized very well.
\n§Examples
\nlet x = [1, 2, 3];\nlet y = x.map(|v| v + 1);\nassert_eq!(y, [2, 3, 4]);\n\nlet x = [1, 2, 3];\nlet mut temp = 0;\nlet y = x.map(|v| { temp += 1; v * temp });\nassert_eq!(y, [1, 4, 9]);\n\nlet x = [\"Ferris\", \"Bueller's\", \"Day\", \"Off\"];\nlet y = x.map(|v| v.len());\nassert_eq!(y, [6, 9, 3, 3]);
\nsourcepub fn try_map<F, R>(\n self,\n f: F\n) -> <<R as Try>::Residual as Residual<[<R as Try>::Output; N]>>::TryType
🔬This is a nightly-only experimental API. (array_try_map)
A fallible function f applied to each element on array self in order to\nreturn an array the same size as self or the first error encountered.
\nThe return type of this function depends on the return type of the closure.\nIf you return Result<T, E> from the closure, you’ll get a Result<[T; N], E>.\nIf you return Option<T> from the closure, you’ll get an Option<[T; N]>.
\n§Examples
\n#![feature(array_try_map)]\n\nlet a = [\"1\", \"2\", \"3\"];\nlet b = a.try_map(|v| v.parse::<u32>()).unwrap().map(|v| v + 1);\nassert_eq!(b, [2, 3, 4]);\n\nlet a = [\"1\", \"2a\", \"3\"];\nlet b = a.try_map(|v| v.parse::<u32>());\nassert!(b.is_err());\n\nuse std::num::NonZero;\n\nlet z = [1, 2, 0, 3, 4];\nassert_eq!(z.try_map(NonZero::new), None);\n\nlet a = [1, 2, 3];\nlet b = a.try_map(NonZero::new);\nlet c = b.map(|x| x.map(NonZero::get));\nassert_eq!(c, Some(a));
\n1.57.0 (const: 1.57.0) · sourcepub const fn as_slice(&self) -> &[T]
Returns a slice containing the entire array. Equivalent to &s[..].
\n1.57.0 · sourcepub fn as_mut_slice(&mut self) -> &mut [T]
Returns a mutable slice containing the entire array. Equivalent to\n&mut s[..].
\n1.77.0 · sourcepub fn each_ref(&self) -> [&T; N]
Borrows each element and returns an array of references with the same\nsize as self.
\n§Example
\nlet floats = [3.1, 2.7, -1.0];\nlet float_refs: [&f64; 3] = floats.each_ref();\nassert_eq!(float_refs, [&3.1, &2.7, &-1.0]);
\nThis method is particularly useful if combined with other methods, like\nmap. This way, you can avoid moving the original\narray if its elements are not Copy.
\n\nlet strings = [\"Ferris\".to_string(), \"♥\".to_string(), \"Rust\".to_string()];\nlet is_ascii = strings.each_ref().map(|s| s.is_ascii());\nassert_eq!(is_ascii, [true, false, true]);\n\n// We can still access the original array: it has not been moved.\nassert_eq!(strings.len(), 3);
\n1.77.0 · sourcepub fn each_mut(&mut self) -> [&mut T; N]
Borrows each element mutably and returns an array of mutable references\nwith the same size as self.
\n§Example
\n\nlet mut floats = [3.1, 2.7, -1.0];\nlet float_refs: [&mut f64; 3] = floats.each_mut();\n*float_refs[0] = 0.0;\nassert_eq!(float_refs, [&mut 0.0, &mut 2.7, &mut -1.0]);\nassert_eq!(floats, [0.0, 2.7, -1.0]);
\nsourcepub fn split_array_ref<const M: usize>(&self) -> (&[T; M], &[T])
🔬This is a nightly-only experimental API. (split_array)
Divides one array reference into two at an index.
\nThe first will contain all indices from [0, M) (excluding\nthe index M itself) and the second will contain all\nindices from [M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet v = [1, 2, 3, 4, 5, 6];\n\n{\n let (left, right) = v.split_array_ref::<0>();\n assert_eq!(left, &[]);\n assert_eq!(right, &[1, 2, 3, 4, 5, 6]);\n}\n\n{\n let (left, right) = v.split_array_ref::<2>();\n assert_eq!(left, &[1, 2]);\n assert_eq!(right, &[3, 4, 5, 6]);\n}\n\n{\n let (left, right) = v.split_array_ref::<6>();\n assert_eq!(left, &[1, 2, 3, 4, 5, 6]);\n assert_eq!(right, &[]);\n}
\nsourcepub fn split_array_mut<const M: usize>(&mut self) -> (&mut [T; M], &mut [T])
🔬This is a nightly-only experimental API. (split_array)
Divides one mutable array reference into two at an index.
\nThe first will contain all indices from [0, M) (excluding\nthe index M itself) and the second will contain all\nindices from [M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet mut v = [1, 0, 3, 0, 5, 6];\nlet (left, right) = v.split_array_mut::<2>();\nassert_eq!(left, &mut [1, 0][..]);\nassert_eq!(right, &mut [3, 0, 5, 6]);\nleft[1] = 2;\nright[1] = 4;\nassert_eq!(v, [1, 2, 3, 4, 5, 6]);
\nsourcepub fn rsplit_array_ref<const M: usize>(&self) -> (&[T], &[T; M])
🔬This is a nightly-only experimental API. (split_array)
Divides one array reference into two at an index from the end.
\nThe first will contain all indices from [0, N - M) (excluding\nthe index N - M itself) and the second will contain all\nindices from [N - M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet v = [1, 2, 3, 4, 5, 6];\n\n{\n let (left, right) = v.rsplit_array_ref::<0>();\n assert_eq!(left, &[1, 2, 3, 4, 5, 6]);\n assert_eq!(right, &[]);\n}\n\n{\n let (left, right) = v.rsplit_array_ref::<2>();\n assert_eq!(left, &[1, 2, 3, 4]);\n assert_eq!(right, &[5, 6]);\n}\n\n{\n let (left, right) = v.rsplit_array_ref::<6>();\n assert_eq!(left, &[]);\n assert_eq!(right, &[1, 2, 3, 4, 5, 6]);\n}
\nsourcepub fn rsplit_array_mut<const M: usize>(&mut self) -> (&mut [T], &mut [T; M])
🔬This is a nightly-only experimental API. (split_array)
Divides one mutable array reference into two at an index from the end.
\nThe first will contain all indices from [0, N - M) (excluding\nthe index N - M itself) and the second will contain all\nindices from [N - M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet mut v = [1, 0, 3, 0, 5, 6];\nlet (left, right) = v.rsplit_array_mut::<4>();\nassert_eq!(left, &mut [1, 0]);\nassert_eq!(right, &mut [3, 0, 5, 6][..]);\nleft[1] = 2;\nright[1] = 4;\nassert_eq!(v, [1, 2, 3, 4, 5, 6]);
\n",0,"iroh_docs::sync::PeerIdBytes"],["source§impl<const N: usize> [u8; N]
sourcepub const fn as_ascii(&self) -> Option<&[AsciiChar; N]>
🔬This is a nightly-only experimental API. (ascii_char)
Converts this array of bytes into a array of ASCII characters,\nor returns None if any of the characters is non-ASCII.
\n§Examples
\n#![feature(ascii_char)]\n#![feature(const_option)]\n\nconst HEX_DIGITS: [std::ascii::Char; 16] =\n *b\"0123456789abcdef\".as_ascii().unwrap();\n\nassert_eq!(HEX_DIGITS[1].as_str(), \"1\");\nassert_eq!(HEX_DIGITS[10].as_str(), \"a\");
\nsourcepub const unsafe fn as_ascii_unchecked(&self) -> &[AsciiChar; N]
🔬This is a nightly-only experimental API. (ascii_char)
Converts this array of bytes into a array of ASCII characters,\nwithout checking whether they’re valid.
\n§Safety
\nEvery byte in the array must be in 0..=127, or else this is UB.
\n",0,"iroh_docs::sync::PeerIdBytes"],["§impl<T> Array for [T; 32]where\n T: Default,
§fn as_slice_mut(&mut self) -> &mut [T]
Gives a unique slice over the whole thing. Read more","Array","iroh_docs::sync::PeerIdBytes"],["","Array","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> AsBytes for [T; N]where\n T: AsBytes,
§fn write_to_prefix(&self, bytes: &mut [u8]) -> Option<()>
","AsBytes","iroh_docs::sync::PeerIdBytes"],["","AsBytes","iroh_docs::sync::PeerIdBytes"],["","AsMut<[T]>","iroh_docs::sync::PeerIdBytes"],["","AsRef<[T]>","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> BitView for [T; N]where\n T: BitStore,
Note that overly-large arrays may cause the conversions to fail.
\n§fn view_bits<O>(&self) -> &BitSlice<T, O>where\n O: BitOrder,
Views a memory region as an immutable bit-slice.§fn try_view_bits<O>(&self) -> Result<&BitSlice<T, O>, BitSpanError<T>>where\n O: BitOrder,
Attempts to view a memory region as an immutable bit-slice. Read more§fn view_bits_mut<O>(&mut self) -> &mut BitSlice<T, O>where\n O: BitOrder,
Views a memory region as a mutable bit-slice.§fn try_view_bits_mut<O>(\n &mut self\n) -> Result<&mut BitSlice<T, O>, BitSpanError<T>>where\n O: BitOrder,
Attempts to view a memory region as a mutable bit-slice. Read more","BitView","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> BitViewSized for [T; N]where\n T: BitStore,
§fn as_raw_slice(&self) -> &[<[T; N] as BitView>::Store]
Views the type as a slice of its elements.§fn as_raw_mut_slice(&mut self) -> &mut [<[T; N] as BitView>::Store]
Views the type as a mutable slice of its elements.§fn into_bitarray<O>(self) -> BitArray<Self, O>where\n O: BitOrder,
Wraps self in a BitArray.","BitViewSized","iroh_docs::sync::PeerIdBytes"],["","Borrow<[T]>","iroh_docs::sync::PeerIdBytes"],["1.4.0 · source§impl<T, const N: usize> BorrowMut<[T]> for [T; N]
source§fn borrow_mut(&mut self) -> &mut [T]
Mutably borrows from an owned value. Read more","BorrowMut<[T]>","iroh_docs::sync::PeerIdBytes"],["","Chain","iroh_docs::sync::PeerIdBytes"],["","Clone","iroh_docs::sync::PeerIdBytes"],["","Debug","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize> Decode for [u8; N]
Decodes a byte array from byte[n] as described in RFC4251 § 5:
\n\nA byte represents an arbitrary 8-bit value (octet). Fixed length\ndata is sometimes represented as an array of bytes, written\nbyte[n], where n is the number of bytes in the array.
\n
\n","Decode","iroh_docs::sync::PeerIdBytes"],["§impl<'a, T, const N: usize> DecodeValue<'a> for [T; N]where\n T: Decode<'a>,
§fn decode_value<R>(reader: &mut R, header: Header) -> Result<[T; N], Error>where\n R: Reader<'a>,
Attempt to decode this message using the provided [Reader].","DecodeValue<'a>","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["source§impl<'de, T> Deserialize<'de> for [T; 32]where\n T: Deserialize<'de>,
source§fn deserialize<D>(\n deserializer: D\n) -> Result<[T; 32], <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more","Deserialize<'de>","iroh_docs::sync::PeerIdBytes"],["source§impl<'de, const N: usize> Deserialize<'de> for [u8; N]
source§fn deserialize<D>(\n deserializer: D\n) -> Result<[u8; N], <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
","Deserialize<'de>","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize> Encode for [u8; N]
Encodes [u8; N] into byte[n] as described in RFC4251 § 5:
\n\nA byte represents an arbitrary 8-bit value (octet). Fixed length\ndata is sometimes represented as an array of bytes, written\nbyte[n], where n is the number of bytes in the array.
\n
\n§fn encoded_len(&self) -> Result<usize, Error>
Get the length of this type encoded in bytes, prior to Base64 encoding.§fn encode(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value using the provided [Writer].§fn encoded_len_prefixed(&self) -> Result<usize, Error>
Return the length of this type after encoding when prepended with a\nuint32 length prefix.§fn encode_prefixed(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value, first prepending a uint32 length prefix\nset to [Encode::encoded_len].","Encode","iroh_docs::sync::PeerIdBytes"],["","EncodeLabelSet","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> EncodeValue for [T; N]where\n T: Encode,
","EncodeValue","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["§impl<'a> FindToken<&'a u8> for [u8; 32]
§fn find_token(&self, token: &u8) -> bool
Returns true if self contains the token","FindToken<&'a u8>","iroh_docs::sync::PeerIdBytes"],["§impl FindToken<u8> for [u8; 32]
§fn find_token(&self, token: u8) -> bool
Returns true if self contains the token","FindToken","iroh_docs::sync::PeerIdBytes"],["","FixedTag","iroh_docs::sync::PeerIdBytes"],["","From<&Signature>","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["§impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>>> for [T; 32]
","From, B0>, B0>, B0>, B0>, B0>>>","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["","From>","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["source§impl From<NamespaceId> for [u8; 32]
source§fn from(value: NamespaceId) -> Self
Converts to this type from the input type.","From","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["","From>","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> FromBytes for [T; N]where\n T: FromBytes,
§fn slice_from_prefix(bytes: &[u8], count: usize) -> Option<(&[Self], &[u8])>where\n Self: Sized,
Interprets the prefix of the given bytes as a &[Self] with length\nequal to count without copying. Read more§fn slice_from_suffix(bytes: &[u8], count: usize) -> Option<(&[u8], &[Self])>where\n Self: Sized,
Interprets the suffix of the given bytes as a &[Self] with length\nequal to count without copying. Read more§fn read_from_prefix(bytes: &[u8]) -> Option<Self>where\n Self: Sized,
","FromBytes","iroh_docs::sync::PeerIdBytes"],["","FromHex","iroh_docs::sync::PeerIdBytes"],["","FromZeroes","iroh_docs::sync::PeerIdBytes"],["","Hash","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Hash for [T; N]where\n T: Hash,
The hash of an array is the same as that of the corresponding slice,\nas required by the Borrow implementation.
\n\nuse std::hash::BuildHasher;\n\nlet b = std::hash::RandomState::new();\nlet a: [u8; 3] = [0xa8, 0x3c, 0x09];\nlet s: &[u8] = &[0xa8, 0x3c, 0x09];\nassert_eq!(b.hash_one(a), b.hash_one(s));
\n","Hash","iroh_docs::sync::PeerIdBytes"],["","Index","iroh_docs::sync::PeerIdBytes"],["","IndexMut","iroh_docs::sync::PeerIdBytes"],["","InputLength","iroh_docs::sync::PeerIdBytes"],["1.53.0 · source§impl<T, const N: usize> IntoIterator for [T; N]
source§fn into_iter(self) -> <[T; N] as IntoIterator>::IntoIter
Creates a consuming iterator, that is, one that moves each value out of\nthe array (from start to end). The array cannot be used after calling\nthis unless T implements Copy, so the whole array is copied.
\nArrays have special behavior when calling .into_iter() prior to the\n2021 edition – see the array Editions section for more information.
\n","IntoIterator","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize> IntoResponse for [u8; N]
§fn into_response(self) -> Response<Body>
Create a response.","IntoResponse","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, const N: usize> Join for [Fut; N]where\n Fut: IntoFuture,
§type Output = [<Fut as IntoFuture>::Output; N]
The resulting output type.§type Future = Join<<Fut as IntoFuture>::IntoFuture, N>
The Future implementation returned by this method.","Join","iroh_docs::sync::PeerIdBytes"],["","Key","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> MaxSize for [T; N]where\n T: MaxSize,
§const POSTCARD_MAX_SIZE: usize = _
The maximum possible size that the serialization of this\ntype can have, in bytes.","MaxSize","iroh_docs::sync::PeerIdBytes"],["","Merge","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Ord for [T; N]where\n T: Ord,
Implements comparison of arrays lexicographically.
\n1.21.0 · source§fn max(self, other: Self) -> Selfwhere\n Self: Sized,
Compares and returns the maximum of two values. Read more","Ord","iroh_docs::sync::PeerIdBytes"],["","PartialEq<&[U]>","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, U, const N: usize> PartialEq<&mut [U]> for [T; N]where\n T: PartialEq<U>,
","PartialEq<&mut [U]>","iroh_docs::sync::PeerIdBytes"],["","PartialEq<[U]>","iroh_docs::sync::PeerIdBytes"],["","PartialEq<[U; N]>","iroh_docs::sync::PeerIdBytes"],["","PartialEq","iroh_docs::sync::PeerIdBytes"],["§impl<A, B, const N: usize, const M: usize> PartialEq<Vec<A, N>> for [B; M]where\n A: PartialEq<B>,
","PartialEq>","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> PartialOrd for [T; N]where\n T: PartialOrd,
Implements comparison of arrays lexicographically.
\nsource§fn le(&self, other: &[T; N]) -> bool
This method tests less than or equal to (for self and other) and is used by the <=\noperator. Read more","PartialOrd","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, const N: usize> Race for [Fut; N]where\n Fut: IntoFuture,
§type Output = <Fut as IntoFuture>::Output
The resulting output type.§type Future = Race<<Fut as IntoFuture>::IntoFuture, N>
Which kind of future are we turning this into?","Race","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, T, E, const N: usize> RaceOk for [Fut; N]where\n Fut: IntoFuture<Output = Result<T, E>>,
§type Future = RaceOk<<Fut as IntoFuture>::IntoFuture, T, E, N>
Which kind of future are we turning this into?","RaceOk","iroh_docs::sync::PeerIdBytes"],["","Schema","iroh_docs::sync::PeerIdBytes"],["source§impl<T> Serialize for [T; 32]where\n T: 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","iroh_docs::sync::PeerIdBytes"],["source§impl<const N: usize> Serialize for [u8; N]
source§fn serialize<S>(\n &self,\n serializer: S\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where\n S: Serializer,
","Serialize","iroh_docs::sync::PeerIdBytes"],["1.51.0 · source§impl<T, const N: usize> SlicePattern for [T; N]
","SlicePattern","iroh_docs::sync::PeerIdBytes"],["1.34.0 · source§impl<T, const N: usize> TryFrom<&[T]> for [T; N]where\n T: Copy,
Tries to create an array [T; N] by copying from a slice &[T]. Succeeds if\nslice.len() == N.
\n\nlet bytes: [u8; 3] = [1, 0, 2];\n\nlet bytes_head: [u8; 2] = <[u8; 2]>::try_from(&bytes[0..2]).unwrap();\nassert_eq!(1, u16::from_le_bytes(bytes_head));\n\nlet bytes_tail: [u8; 2] = bytes[1..3].try_into().unwrap();\nassert_eq!(512, u16::from_le_bytes(bytes_tail));
\n§type Error = TryFromSliceError
The type returned in the event of a conversion error.","TryFrom<&[T]>","iroh_docs::sync::PeerIdBytes"],["1.59.0 · source§impl<T, const N: usize> TryFrom<&mut [T]> for [T; N]where\n T: Copy,
Tries to create an array [T; N] by copying from a mutable slice &mut [T].\nSucceeds if slice.len() == N.
\n\nlet mut bytes: [u8; 3] = [1, 0, 2];\n\nlet bytes_head: [u8; 2] = <[u8; 2]>::try_from(&mut bytes[0..2]).unwrap();\nassert_eq!(1, u16::from_le_bytes(bytes_head));\n\nlet bytes_tail: [u8; 2] = (&mut bytes[1..3]).try_into().unwrap();\nassert_eq!(512, u16::from_le_bytes(bytes_tail));
\n§type Error = TryFromSliceError
The type returned in the event of a conversion error.","TryFrom<&mut [T]>","iroh_docs::sync::PeerIdBytes"],["§impl<T, A, const N: usize> TryFrom<Vec<T, A>> for [T; N]where\n A: Allocator,
§fn try_from(vec: Vec<T, A>) -> Result<[T; N], Vec<T, A>>
Gets the entire contents of the Vec<T> as an array,\nif its size exactly matches that of the requested array.
\n§Examples
\nassert_eq!(vec![1, 2, 3].try_into(), Ok([1, 2, 3]));\nassert_eq!(<Vec<i32>>::new().try_into(), Ok([]));
\nIf the length doesn’t match, the input comes back in Err:
\n\nlet r: Result<[i32; 4], _> = (0..10).collect::<Vec<_>>().try_into();\nassert_eq!(r, Err(vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9]));
\nIf you’re fine with just getting a prefix of the Vec<T>,\nyou can call .truncate(N) first.
\n\nlet mut v = String::from(\"hello world\").into_bytes();\nv.sort();\nv.truncate(2);\nlet [a, b]: [_; 2] = v.try_into().unwrap();\nassert_eq!(a, b' ');\nassert_eq!(b, b'd');
\n","TryFrom>","iroh_docs::sync::PeerIdBytes"],["1.48.0 · source§impl<T, A, const N: usize> TryFrom<Vec<T, A>> for [T; N]where\n A: Allocator,
source§fn try_from(vec: Vec<T, A>) -> Result<[T; N], Vec<T, A>>
Gets the entire contents of the Vec<T> as an array,\nif its size exactly matches that of the requested array.
\n§Examples
\nassert_eq!(vec![1, 2, 3].try_into(), Ok([1, 2, 3]));\nassert_eq!(<Vec<i32>>::new().try_into(), Ok([]));
\nIf the length doesn’t match, the input comes back in Err:
\n\nlet r: Result<[i32; 4], _> = (0..10).collect::<Vec<_>>().try_into();\nassert_eq!(r, Err(vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9]));
\nIf you’re fine with just getting a prefix of the Vec<T>,\nyou can call .truncate(N) first.
\n\nlet mut v = String::from(\"hello world\").into_bytes();\nv.sort();\nv.truncate(2);\nlet [a, b]: [_; 2] = v.try_into().unwrap();\nassert_eq!(a, b' ');\nassert_eq!(b, b'd');
\n","TryFrom>","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, T, E, const N: usize> TryJoin for [Fut; N]where\n Fut: IntoFuture<Output = Result<T, E>>,
§type Future = TryJoin<<Fut as IntoFuture>::IntoFuture, T, E, N>
Which kind of future are we turning this into?","TryJoin","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> Value for [T; N]where\n T: Value,
§type SelfType<'a> = [<T as Value>::SelfType<'a>; N]\nwhere\n [T; N]: 'a
SelfType<’a> must be the same type as Self with all lifetimes replaced with ’a§type AsBytes<'a> = Vec<u8>\nwhere\n [T; N]: 'a
§fn fixed_width() -> Option<usize>
Width of a fixed type, or None for variable width§fn from_bytes<'a>(data: &'a [u8]) -> [<T as Value>::SelfType<'a>; N]where\n [T; N]: 'a,
Deserializes data\nImplementations may return a view over data, or an owned type","Value","iroh_docs::sync::PeerIdBytes"],["","ValueOrd","iroh_docs::sync::PeerIdBytes"],["§impl<Z, const N: usize> Zeroize for [Z; N]where\n Z: Zeroize,
Impl [Zeroize] on arrays of types that impl [Zeroize].
\n","Zeroize","iroh_docs::sync::PeerIdBytes"],["","Zip","iroh_docs::sync::PeerIdBytes"],["source§impl<T, const N: usize> ConstParamTy for [T; N]where\n T: ConstParamTy,
","ConstParamTy","iroh_docs::sync::PeerIdBytes"],["1.58.0 · source§impl<T, const N: usize> Copy for [T; N]where\n T: Copy,
","Copy","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Eq for [T; N]where\n T: Eq,
","Eq","iroh_docs::sync::PeerIdBytes"],["source§impl<T, const N: usize> StructuralPartialEq for [T; N]
","StructuralPartialEq","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> Unaligned for [T; N]where\n T: Unaligned,
","Unaligned","iroh_docs::sync::PeerIdBytes"],["§impl<Z, const N: usize> ZeroizeOnDrop for [Z; N]where\n Z: ZeroizeOnDrop,
Impl [ZeroizeOnDrop] on arrays of types that impl [ZeroizeOnDrop].
\n","ZeroizeOnDrop","iroh_docs::sync::PeerIdBytes"]]
+"iroh_docs":[["source§impl<T, const N: usize> [T; N]
1.55.0 · sourcepub fn map<F, U>(self, f: F) -> [U; N]where\n F: FnMut(T) -> U,
Returns an array of the same size as self, with function f applied to each element\nin order.
\nIf you don’t necessarily need a new fixed-size array, consider using\nIterator::map instead.
\n§Note on performance and stack usage
\nUnfortunately, usages of this method are currently not always optimized\nas well as they could be. This mainly concerns large arrays, as mapping\nover small arrays seem to be optimized just fine. Also note that in\ndebug mode (i.e. without any optimizations), this method can use a lot\nof stack space (a few times the size of the array or more).
\nTherefore, in performance-critical code, try to avoid using this method\non large arrays or check the emitted code. Also try to avoid chained\nmaps (e.g. arr.map(...).map(...)).
\nIn many cases, you can instead use Iterator::map by calling .iter()\nor .into_iter() on your array. [T; N]::map is only necessary if you\nreally need a new array of the same size as the result. Rust’s lazy\niterators tend to get optimized very well.
\n§Examples
\nlet x = [1, 2, 3];\nlet y = x.map(|v| v + 1);\nassert_eq!(y, [2, 3, 4]);\n\nlet x = [1, 2, 3];\nlet mut temp = 0;\nlet y = x.map(|v| { temp += 1; v * temp });\nassert_eq!(y, [1, 4, 9]);\n\nlet x = [\"Ferris\", \"Bueller's\", \"Day\", \"Off\"];\nlet y = x.map(|v| v.len());\nassert_eq!(y, [6, 9, 3, 3]);
\nsourcepub fn try_map<F, R>(\n self,\n f: F\n) -> <<R as Try>::Residual as Residual<[<R as Try>::Output; N]>>::TryType
🔬This is a nightly-only experimental API. (array_try_map)
A fallible function f applied to each element on array self in order to\nreturn an array the same size as self or the first error encountered.
\nThe return type of this function depends on the return type of the closure.\nIf you return Result<T, E> from the closure, you’ll get a Result<[T; N], E>.\nIf you return Option<T> from the closure, you’ll get an Option<[T; N]>.
\n§Examples
\n#![feature(array_try_map)]\n\nlet a = [\"1\", \"2\", \"3\"];\nlet b = a.try_map(|v| v.parse::<u32>()).unwrap().map(|v| v + 1);\nassert_eq!(b, [2, 3, 4]);\n\nlet a = [\"1\", \"2a\", \"3\"];\nlet b = a.try_map(|v| v.parse::<u32>());\nassert!(b.is_err());\n\nuse std::num::NonZero;\n\nlet z = [1, 2, 0, 3, 4];\nassert_eq!(z.try_map(NonZero::new), None);\n\nlet a = [1, 2, 3];\nlet b = a.try_map(NonZero::new);\nlet c = b.map(|x| x.map(NonZero::get));\nassert_eq!(c, Some(a));
\n1.57.0 (const: 1.57.0) · sourcepub const fn as_slice(&self) -> &[T]
Returns a slice containing the entire array. Equivalent to &s[..].
\n1.57.0 · sourcepub fn as_mut_slice(&mut self) -> &mut [T]
Returns a mutable slice containing the entire array. Equivalent to\n&mut s[..].
\n1.77.0 · sourcepub fn each_ref(&self) -> [&T; N]
Borrows each element and returns an array of references with the same\nsize as self.
\n§Example
\nlet floats = [3.1, 2.7, -1.0];\nlet float_refs: [&f64; 3] = floats.each_ref();\nassert_eq!(float_refs, [&3.1, &2.7, &-1.0]);
\nThis method is particularly useful if combined with other methods, like\nmap. This way, you can avoid moving the original\narray if its elements are not Copy.
\n\nlet strings = [\"Ferris\".to_string(), \"♥\".to_string(), \"Rust\".to_string()];\nlet is_ascii = strings.each_ref().map(|s| s.is_ascii());\nassert_eq!(is_ascii, [true, false, true]);\n\n// We can still access the original array: it has not been moved.\nassert_eq!(strings.len(), 3);
\n1.77.0 · sourcepub fn each_mut(&mut self) -> [&mut T; N]
Borrows each element mutably and returns an array of mutable references\nwith the same size as self.
\n§Example
\n\nlet mut floats = [3.1, 2.7, -1.0];\nlet float_refs: [&mut f64; 3] = floats.each_mut();\n*float_refs[0] = 0.0;\nassert_eq!(float_refs, [&mut 0.0, &mut 2.7, &mut -1.0]);\nassert_eq!(floats, [0.0, 2.7, -1.0]);
\nsourcepub fn split_array_ref<const M: usize>(&self) -> (&[T; M], &[T])
🔬This is a nightly-only experimental API. (split_array)
Divides one array reference into two at an index.
\nThe first will contain all indices from [0, M) (excluding\nthe index M itself) and the second will contain all\nindices from [M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet v = [1, 2, 3, 4, 5, 6];\n\n{\n let (left, right) = v.split_array_ref::<0>();\n assert_eq!(left, &[]);\n assert_eq!(right, &[1, 2, 3, 4, 5, 6]);\n}\n\n{\n let (left, right) = v.split_array_ref::<2>();\n assert_eq!(left, &[1, 2]);\n assert_eq!(right, &[3, 4, 5, 6]);\n}\n\n{\n let (left, right) = v.split_array_ref::<6>();\n assert_eq!(left, &[1, 2, 3, 4, 5, 6]);\n assert_eq!(right, &[]);\n}
\nsourcepub fn split_array_mut<const M: usize>(&mut self) -> (&mut [T; M], &mut [T])
🔬This is a nightly-only experimental API. (split_array)
Divides one mutable array reference into two at an index.
\nThe first will contain all indices from [0, M) (excluding\nthe index M itself) and the second will contain all\nindices from [M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet mut v = [1, 0, 3, 0, 5, 6];\nlet (left, right) = v.split_array_mut::<2>();\nassert_eq!(left, &mut [1, 0][..]);\nassert_eq!(right, &mut [3, 0, 5, 6]);\nleft[1] = 2;\nright[1] = 4;\nassert_eq!(v, [1, 2, 3, 4, 5, 6]);
\nsourcepub fn rsplit_array_ref<const M: usize>(&self) -> (&[T], &[T; M])
🔬This is a nightly-only experimental API. (split_array)
Divides one array reference into two at an index from the end.
\nThe first will contain all indices from [0, N - M) (excluding\nthe index N - M itself) and the second will contain all\nindices from [N - M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet v = [1, 2, 3, 4, 5, 6];\n\n{\n let (left, right) = v.rsplit_array_ref::<0>();\n assert_eq!(left, &[1, 2, 3, 4, 5, 6]);\n assert_eq!(right, &[]);\n}\n\n{\n let (left, right) = v.rsplit_array_ref::<2>();\n assert_eq!(left, &[1, 2, 3, 4]);\n assert_eq!(right, &[5, 6]);\n}\n\n{\n let (left, right) = v.rsplit_array_ref::<6>();\n assert_eq!(left, &[]);\n assert_eq!(right, &[1, 2, 3, 4, 5, 6]);\n}
\nsourcepub fn rsplit_array_mut<const M: usize>(&mut self) -> (&mut [T], &mut [T; M])
🔬This is a nightly-only experimental API. (split_array)
Divides one mutable array reference into two at an index from the end.
\nThe first will contain all indices from [0, N - M) (excluding\nthe index N - M itself) and the second will contain all\nindices from [N - M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet mut v = [1, 0, 3, 0, 5, 6];\nlet (left, right) = v.rsplit_array_mut::<4>();\nassert_eq!(left, &mut [1, 0]);\nassert_eq!(right, &mut [3, 0, 5, 6][..]);\nleft[1] = 2;\nright[1] = 4;\nassert_eq!(v, [1, 2, 3, 4, 5, 6]);
\n",0,"iroh_docs::sync::PeerIdBytes"],["source§impl<const N: usize> [u8; N]
sourcepub const fn as_ascii(&self) -> Option<&[AsciiChar; N]>
🔬This is a nightly-only experimental API. (ascii_char)
Converts this array of bytes into a array of ASCII characters,\nor returns None if any of the characters is non-ASCII.
\n§Examples
\n#![feature(ascii_char)]\n#![feature(const_option)]\n\nconst HEX_DIGITS: [std::ascii::Char; 16] =\n *b\"0123456789abcdef\".as_ascii().unwrap();\n\nassert_eq!(HEX_DIGITS[1].as_str(), \"1\");\nassert_eq!(HEX_DIGITS[10].as_str(), \"a\");
\nsourcepub const unsafe fn as_ascii_unchecked(&self) -> &[AsciiChar; N]
🔬This is a nightly-only experimental API. (ascii_char)
Converts this array of bytes into a array of ASCII characters,\nwithout checking whether they’re valid.
\n§Safety
\nEvery byte in the array must be in 0..=127, or else this is UB.
\n",0,"iroh_docs::sync::PeerIdBytes"],["§impl<T> Array for [T; 32]where\n T: Default,
§fn as_slice_mut(&mut self) -> &mut [T]
Gives a unique slice over the whole thing. Read more","Array","iroh_docs::sync::PeerIdBytes"],["","Array","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> AsBytes for [T; N]where\n T: AsBytes,
§fn write_to_prefix(&self, bytes: &mut [u8]) -> Option<()>
","AsBytes","iroh_docs::sync::PeerIdBytes"],["","AsBytes","iroh_docs::sync::PeerIdBytes"],["","AsMut<[T]>","iroh_docs::sync::PeerIdBytes"],["","AsRef<[T]>","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> BitView for [T; N]where\n T: BitStore,
Note that overly-large arrays may cause the conversions to fail.
\n§fn view_bits<O>(&self) -> &BitSlice<T, O>where\n O: BitOrder,
Views a memory region as an immutable bit-slice.§fn try_view_bits<O>(&self) -> Result<&BitSlice<T, O>, BitSpanError<T>>where\n O: BitOrder,
Attempts to view a memory region as an immutable bit-slice. Read more§fn view_bits_mut<O>(&mut self) -> &mut BitSlice<T, O>where\n O: BitOrder,
Views a memory region as a mutable bit-slice.§fn try_view_bits_mut<O>(\n &mut self\n) -> Result<&mut BitSlice<T, O>, BitSpanError<T>>where\n O: BitOrder,
Attempts to view a memory region as a mutable bit-slice. Read more","BitView","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> BitViewSized for [T; N]where\n T: BitStore,
§fn as_raw_slice(&self) -> &[<[T; N] as BitView>::Store]
Views the type as a slice of its elements.§fn as_raw_mut_slice(&mut self) -> &mut [<[T; N] as BitView>::Store]
Views the type as a mutable slice of its elements.§fn into_bitarray<O>(self) -> BitArray<Self, O>where\n O: BitOrder,
Wraps self in a BitArray.","BitViewSized","iroh_docs::sync::PeerIdBytes"],["","Borrow<[T]>","iroh_docs::sync::PeerIdBytes"],["1.4.0 · source§impl<T, const N: usize> BorrowMut<[T]> for [T; N]
source§fn borrow_mut(&mut self) -> &mut [T]
Mutably borrows from an owned value. Read more","BorrowMut<[T]>","iroh_docs::sync::PeerIdBytes"],["","Chain","iroh_docs::sync::PeerIdBytes"],["","Clone","iroh_docs::sync::PeerIdBytes"],["","Debug","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize> Decode for [u8; N]
Decodes a byte array from byte[n] as described in RFC4251 § 5:
\n\nA byte represents an arbitrary 8-bit value (octet). Fixed length\ndata is sometimes represented as an array of bytes, written\nbyte[n], where n is the number of bytes in the array.
\n
\n","Decode","iroh_docs::sync::PeerIdBytes"],["§impl<'a, T, const N: usize> DecodeValue<'a> for [T; N]where\n T: Decode<'a>,
§fn decode_value<R>(reader: &mut R, header: Header) -> Result<[T; N], Error>where\n R: Reader<'a>,
Attempt to decode this message using the provided [Reader].","DecodeValue<'a>","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["source§impl<'de, T> Deserialize<'de> for [T; 32]where\n T: Deserialize<'de>,
source§fn deserialize<D>(\n deserializer: D\n) -> Result<[T; 32], <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more","Deserialize<'de>","iroh_docs::sync::PeerIdBytes"],["source§impl<'de, const N: usize> Deserialize<'de> for [u8; N]
source§fn deserialize<D>(\n deserializer: D\n) -> Result<[u8; N], <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
","Deserialize<'de>","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize> Encode for [u8; N]
Encodes [u8; N] into byte[n] as described in RFC4251 § 5:
\n\nA byte represents an arbitrary 8-bit value (octet). Fixed length\ndata is sometimes represented as an array of bytes, written\nbyte[n], where n is the number of bytes in the array.
\n
\n§fn encoded_len(&self) -> Result<usize, Error>
Get the length of this type encoded in bytes, prior to Base64 encoding.§fn encode(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value using the provided [Writer].§fn encoded_len_prefixed(&self) -> Result<usize, Error>
Return the length of this type after encoding when prepended with a\nuint32 length prefix.§fn encode_prefixed(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value, first prepending a uint32 length prefix\nset to [Encode::encoded_len].","Encode","iroh_docs::sync::PeerIdBytes"],["","EncodeLabelSet","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> EncodeValue for [T; N]where\n T: Encode,
","EncodeValue","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["§impl<'a> FindToken<&'a u8> for [u8; 32]
§fn find_token(&self, token: &u8) -> bool
Returns true if self contains the token","FindToken<&'a u8>","iroh_docs::sync::PeerIdBytes"],["§impl FindToken<u8> for [u8; 32]
§fn find_token(&self, token: u8) -> bool
Returns true if self contains the token","FindToken","iroh_docs::sync::PeerIdBytes"],["","FixedTag","iroh_docs::sync::PeerIdBytes"],["","From<&Signature>","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["§impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>>> for [T; 32]
","From, B0>, B0>, B0>, B0>, B0>>>","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["","From>","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["source§impl From<NamespaceId> for [u8; 32]
source§fn from(value: NamespaceId) -> Self
Converts to this type from the input type.","From","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["","From>","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> FromBytes for [T; N]where\n T: FromBytes,
§fn slice_from_prefix(bytes: &[u8], count: usize) -> Option<(&[Self], &[u8])>where\n Self: Sized,
Interprets the prefix of the given bytes as a &[Self] with length\nequal to count without copying. Read more§fn slice_from_suffix(bytes: &[u8], count: usize) -> Option<(&[u8], &[Self])>where\n Self: Sized,
Interprets the suffix of the given bytes as a &[Self] with length\nequal to count without copying. Read more§fn read_from_prefix(bytes: &[u8]) -> Option<Self>where\n Self: Sized,
","FromBytes","iroh_docs::sync::PeerIdBytes"],["","FromHex","iroh_docs::sync::PeerIdBytes"],["","FromZeroes","iroh_docs::sync::PeerIdBytes"],["","Hash","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Hash for [T; N]where\n T: Hash,
The hash of an array is the same as that of the corresponding slice,\nas required by the Borrow implementation.
\n\nuse std::hash::BuildHasher;\n\nlet b = std::hash::RandomState::new();\nlet a: [u8; 3] = [0xa8, 0x3c, 0x09];\nlet s: &[u8] = &[0xa8, 0x3c, 0x09];\nassert_eq!(b.hash_one(a), b.hash_one(s));
\n","Hash","iroh_docs::sync::PeerIdBytes"],["","Index","iroh_docs::sync::PeerIdBytes"],["","IndexMut","iroh_docs::sync::PeerIdBytes"],["","InputLength","iroh_docs::sync::PeerIdBytes"],["1.53.0 · source§impl<T, const N: usize> IntoIterator for [T; N]
source§fn into_iter(self) -> <[T; N] as IntoIterator>::IntoIter
Creates a consuming iterator, that is, one that moves each value out of\nthe array (from start to end). The array cannot be used after calling\nthis unless T implements Copy, so the whole array is copied.
\nArrays have special behavior when calling .into_iter() prior to the\n2021 edition – see the array Editions section for more information.
\n","IntoIterator","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize> IntoResponse for [u8; N]
§fn into_response(self) -> Response<Body>
Create a response.","IntoResponse","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, const N: usize> Join for [Fut; N]where\n Fut: IntoFuture,
§type Output = [<Fut as IntoFuture>::Output; N]
The resulting output type.§type Future = Join<<Fut as IntoFuture>::IntoFuture, N>
The Future implementation returned by this method.","Join","iroh_docs::sync::PeerIdBytes"],["","Key","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> MaxSize for [T; N]where\n T: MaxSize,
§const POSTCARD_MAX_SIZE: usize = _
The maximum possible size that the serialization of this\ntype can have, in bytes.","MaxSize","iroh_docs::sync::PeerIdBytes"],["","Merge","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Ord for [T; N]where\n T: Ord,
Implements comparison of arrays lexicographically.
\n1.21.0 · source§fn max(self, other: Self) -> Selfwhere\n Self: Sized,
Compares and returns the maximum of two values. Read more","Ord","iroh_docs::sync::PeerIdBytes"],["","PartialEq<&[U]>","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, U, const N: usize> PartialEq<&mut [U]> for [T; N]where\n T: PartialEq<U>,
","PartialEq<&mut [U]>","iroh_docs::sync::PeerIdBytes"],["","PartialEq<[U]>","iroh_docs::sync::PeerIdBytes"],["","PartialEq<[U; N]>","iroh_docs::sync::PeerIdBytes"],["","PartialEq","iroh_docs::sync::PeerIdBytes"],["§impl<A, B, const N: usize, const M: usize> PartialEq<Vec<A, N>> for [B; M]where\n A: PartialEq<B>,
","PartialEq>","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> PartialOrd for [T; N]where\n T: PartialOrd,
Implements comparison of arrays lexicographically.
\nsource§fn le(&self, other: &[T; N]) -> bool
This method tests less than or equal to (for self and other) and is used by the <=\noperator. Read more","PartialOrd","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, const N: usize> Race for [Fut; N]where\n Fut: IntoFuture,
§type Output = <Fut as IntoFuture>::Output
The resulting output type.§type Future = Race<<Fut as IntoFuture>::IntoFuture, N>
Which kind of future are we turning this into?","Race","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, T, E, const N: usize> RaceOk for [Fut; N]where\n Fut: IntoFuture<Output = Result<T, E>>,
§type Future = RaceOk<<Fut as IntoFuture>::IntoFuture, T, E, N>
Which kind of future are we turning this into?","RaceOk","iroh_docs::sync::PeerIdBytes"],["","Schema","iroh_docs::sync::PeerIdBytes"],["source§impl<T> Serialize for [T; 32]where\n T: 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","iroh_docs::sync::PeerIdBytes"],["source§impl<const N: usize> Serialize for [u8; N]
source§fn serialize<S>(\n &self,\n serializer: S\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where\n S: Serializer,
","Serialize","iroh_docs::sync::PeerIdBytes"],["1.51.0 · source§impl<T, const N: usize> SlicePattern for [T; N]
","SlicePattern","iroh_docs::sync::PeerIdBytes"],["1.34.0 · source§impl<T, const N: usize> TryFrom<&[T]> for [T; N]where\n T: Copy,
Tries to create an array [T; N] by copying from a slice &[T]. Succeeds if\nslice.len() == N.
\n\nlet bytes: [u8; 3] = [1, 0, 2];\n\nlet bytes_head: [u8; 2] = <[u8; 2]>::try_from(&bytes[0..2]).unwrap();\nassert_eq!(1, u16::from_le_bytes(bytes_head));\n\nlet bytes_tail: [u8; 2] = bytes[1..3].try_into().unwrap();\nassert_eq!(512, u16::from_le_bytes(bytes_tail));
\n§type Error = TryFromSliceError
The type returned in the event of a conversion error.","TryFrom<&[T]>","iroh_docs::sync::PeerIdBytes"],["1.59.0 · source§impl<T, const N: usize> TryFrom<&mut [T]> for [T; N]where\n T: Copy,
Tries to create an array [T; N] by copying from a mutable slice &mut [T].\nSucceeds if slice.len() == N.
\n\nlet mut bytes: [u8; 3] = [1, 0, 2];\n\nlet bytes_head: [u8; 2] = <[u8; 2]>::try_from(&mut bytes[0..2]).unwrap();\nassert_eq!(1, u16::from_le_bytes(bytes_head));\n\nlet bytes_tail: [u8; 2] = (&mut bytes[1..3]).try_into().unwrap();\nassert_eq!(512, u16::from_le_bytes(bytes_tail));
\n§type Error = TryFromSliceError
The type returned in the event of a conversion error.","TryFrom<&mut [T]>","iroh_docs::sync::PeerIdBytes"],["§impl<T, A, const N: usize> TryFrom<Vec<T, A>> for [T; N]where\n A: Allocator,
§fn try_from(vec: Vec<T, A>) -> Result<[T; N], Vec<T, A>>
Gets the entire contents of the Vec<T> as an array,\nif its size exactly matches that of the requested array.
\n§Examples
\nassert_eq!(vec![1, 2, 3].try_into(), Ok([1, 2, 3]));\nassert_eq!(<Vec<i32>>::new().try_into(), Ok([]));
\nIf the length doesn’t match, the input comes back in Err:
\n\nlet r: Result<[i32; 4], _> = (0..10).collect::<Vec<_>>().try_into();\nassert_eq!(r, Err(vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9]));
\nIf you’re fine with just getting a prefix of the Vec<T>,\nyou can call .truncate(N) first.
\n\nlet mut v = String::from(\"hello world\").into_bytes();\nv.sort();\nv.truncate(2);\nlet [a, b]: [_; 2] = v.try_into().unwrap();\nassert_eq!(a, b' ');\nassert_eq!(b, b'd');
\n","TryFrom>","iroh_docs::sync::PeerIdBytes"],["1.48.0 · source§impl<T, A, const N: usize> TryFrom<Vec<T, A>> for [T; N]where\n A: Allocator,
source§fn try_from(vec: Vec<T, A>) -> Result<[T; N], Vec<T, A>>
Gets the entire contents of the Vec<T> as an array,\nif its size exactly matches that of the requested array.
\n§Examples
\nassert_eq!(vec![1, 2, 3].try_into(), Ok([1, 2, 3]));\nassert_eq!(<Vec<i32>>::new().try_into(), Ok([]));
\nIf the length doesn’t match, the input comes back in Err:
\n\nlet r: Result<[i32; 4], _> = (0..10).collect::<Vec<_>>().try_into();\nassert_eq!(r, Err(vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9]));
\nIf you’re fine with just getting a prefix of the Vec<T>,\nyou can call .truncate(N) first.
\n\nlet mut v = String::from(\"hello world\").into_bytes();\nv.sort();\nv.truncate(2);\nlet [a, b]: [_; 2] = v.try_into().unwrap();\nassert_eq!(a, b' ');\nassert_eq!(b, b'd');
\n","TryFrom>","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, T, E, const N: usize> TryJoin for [Fut; N]where\n Fut: IntoFuture<Output = Result<T, E>>,
§type Future = TryJoin<<Fut as IntoFuture>::IntoFuture, T, E, N>
Which kind of future are we turning this into?","TryJoin","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> Value for [T; N]where\n T: Value,
§type SelfType<'a> = [<T as Value>::SelfType<'a>; N]\nwhere\n [T; N]: 'a
SelfType<’a> must be the same type as Self with all lifetimes replaced with ’a§type AsBytes<'a> = Vec<u8>\nwhere\n [T; N]: 'a
§fn fixed_width() -> Option<usize>
Width of a fixed type, or None for variable width§fn from_bytes<'a>(data: &'a [u8]) -> [<T as Value>::SelfType<'a>; N]where\n [T; N]: 'a,
Deserializes data\nImplementations may return a view over data, or an owned type","Value","iroh_docs::sync::PeerIdBytes"],["","ValueOrd","iroh_docs::sync::PeerIdBytes"],["§impl<Z, const N: usize> Zeroize for [Z; N]where\n Z: Zeroize,
Impl [Zeroize] on arrays of types that impl [Zeroize].
\n","Zeroize","iroh_docs::sync::PeerIdBytes"],["","Zip","iroh_docs::sync::PeerIdBytes"],["source§impl<T, const N: usize> ConstParamTy for [T; N]where\n T: ConstParamTy,
","ConstParamTy","iroh_docs::sync::PeerIdBytes"],["1.58.0 · source§impl<T, const N: usize> Copy for [T; N]where\n T: Copy,
","Copy","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Eq for [T; N]where\n T: Eq,
","Eq","iroh_docs::sync::PeerIdBytes"],["source§impl<T, const N: usize> StructuralPartialEq for [T; N]
","StructuralPartialEq","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> Unaligned for [T; N]where\n T: Unaligned,
","Unaligned","iroh_docs::sync::PeerIdBytes"],["§impl<Z, const N: usize> ZeroizeOnDrop for [Z; N]where\n Z: ZeroizeOnDrop,
Impl [ZeroizeOnDrop] on arrays of types that impl [ZeroizeOnDrop].
\n","ZeroizeOnDrop","iroh_docs::sync::PeerIdBytes"]]
};if (window.register_type_impls) {window.register_type_impls(type_impls);} else {window.pending_type_impls = type_impls;}})()
\ No newline at end of file
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
diff --git a/pr/2595/docs/iroh_docs/actor/struct.SyncHandle.html b/pr/2595/docs/iroh_docs/actor/struct.SyncHandle.html
index cfd29c2ce8..6c70a0ff39 100644
--- a/pr/2595/docs/iroh_docs/actor/struct.SyncHandle.html
+++ b/pr/2595/docs/iroh_docs/actor/struct.SyncHandle.html
@@ -26,7 +26,7 @@ waiting for the actor to finish happens in an async context, and therefore that
namespace: NamespaceId,
author: AuthorId,
key: Bytes,
- hash: Hash,
+ hash: Hash,
len: u64
) -> Result<()>sourcepub async fn delete_prefix(
&self,
diff --git a/pr/2595/docs/iroh_docs/engine/enum.LiveEvent.html b/pr/2595/docs/iroh_docs/engine/enum.LiveEvent.html
index ceb8545b50..f0d33bcb21 100644
--- a/pr/2595/docs/iroh_docs/engine/enum.LiveEvent.html
+++ b/pr/2595/docs/iroh_docs/engine/enum.LiveEvent.html
@@ -3,34 +3,34 @@
entry: Entry,
},
InsertRemote {
- from: PublicKey,
+ from: PublicKey,
entry: Entry,
content_status: ContentStatus,
},
ContentReady {
- hash: Hash,
+ hash: Hash,
},
PendingContentReady,
- NeighborUp(PublicKey),
- NeighborDown(PublicKey),
+ NeighborUp(PublicKey),
+ NeighborDown(PublicKey),
SyncFinished(SyncEvent),
}Expand description
Events informing about actions of the live sync progress.
Variants§
§InsertLocal
A local insertion.
§InsertRemote
Received a remote insert.
-Fields
§from: PublicKeyThe peer that sent us the entry.
+Fields
§content_status: ContentStatusIf the content is available at the local node
§ContentReady
The content of an entry was downloaded and is now available at the local node
-Fields
§hash: HashThe content hash of the newly available entry content
+§PendingContentReady
All pending content is now ready.
This event signals that all queued content downloads from the last sync run have either
completed or failed.
It will only be emitted after a Self::SyncFinished event, never before.
Receiving this event does not guarantee that all content in the document is available. If
blobs failed to download, this event will still be emitted after all operations completed.
-§NeighborUp(PublicKey)
We have a new neighbor in the swarm.
-§NeighborDown(PublicKey)
We lost a neighbor in the swarm.
+§NeighborUp(PublicKey)
We have a new neighbor in the swarm.
+§NeighborDown(PublicKey)
We lost a neighbor in the swarm.
§SyncFinished(SyncEvent)
A set-reconciliation sync finished.
Trait Implementations§
source§impl<'de> Deserialize<'de> for LiveEvent
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl PartialEq for LiveEvent
source§fn eq(&self, other: &LiveEvent) -> bool
This method tests for self and other values to be equal, and is used
diff --git a/pr/2595/docs/iroh_docs/engine/fn.entry_to_content_status.html b/pr/2595/docs/iroh_docs/engine/fn.entry_to_content_status.html
index 459a6719d2..3b39df6428 100644
--- a/pr/2595/docs/iroh_docs/engine/fn.entry_to_content_status.html
+++ b/pr/2595/docs/iroh_docs/engine/fn.entry_to_content_status.html
@@ -1,2 +1,2 @@
-entry_to_content_status in iroh_docs::engine - Rust Function iroh_docs::engine::entry_to_content_status
source · pub fn entry_to_content_status(entry: Result<EntryStatus>) -> ContentStatus
Expand description
Converts an [EntryStatus] into a [‘ContentStatus’].
+entry_to_content_status in iroh_docs::engine - Rust Function iroh_docs::engine::entry_to_content_status
source · pub fn entry_to_content_status(entry: Result<EntryStatus>) -> ContentStatus
Expand description
Converts an EntryStatus into a [‘ContentStatus’].
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_docs/engine/index.html b/pr/2595/docs/iroh_docs/engine/index.html
index 5f78e23386..622ab4b871 100644
--- a/pr/2595/docs/iroh_docs/engine/index.html
+++ b/pr/2595/docs/iroh_docs/engine/index.html
@@ -1,4 +1,4 @@
iroh_docs::engine - Rust Expand description
Handlers and actors to for live syncing replicas.
crate::Replica is also called documents here.
Structs§
- Persistent default author for a docs engine.
- The sync engine coordinates actors that manage open documents, set-reconciliation syncs with
-peers and a gossip swarm for each syncing document.
- Event emitted when a sync operation completes
Enums§
- Where to persist the default author.
- Events informing about actions of the live sync progress.
- Why we performed a sync exchange
- Why we started a sync request
Functions§
- Converts an [
EntryStatus] into a [‘ContentStatus’].
\ No newline at end of file
+peers and a gossip swarm for each syncing document.Event emitted when a sync operation completes Enums§
- Where to persist the default author.
- Events informing about actions of the live sync progress.
- Why we performed a sync exchange
- Why we started a sync request
Functions§
- Converts an
EntryStatus into a [‘ContentStatus’].
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_docs/engine/struct.Engine.html b/pr/2595/docs/iroh_docs/engine/struct.Engine.html
index 1b88a96726..46cd25179e 100644
--- a/pr/2595/docs/iroh_docs/engine/struct.Engine.html
+++ b/pr/2595/docs/iroh_docs/engine/struct.Engine.html
@@ -8,12 +8,12 @@ peers and a gossip swarm for each syncing document.
Fields§
§endpoint: EndpointEndpoint used by the engine.
§sync: SyncHandleHandle to the actor thread.
The persistent default author for this engine.
-Implementations§
source§impl Engine
Implementations§
source§impl Engine
sourcepub async fn spawn<B: Store>(
endpoint: Endpoint,
- gossip: Gossip,
+ gossip: Gossip,
replica_store: Store,
bao_store: B,
- downloader: Downloader,
+ downloader: Downloader,
default_author_storage: DefaultAuthorStorage
) -> Result<Self>
Start the sync engine.
This will spawn two tokio tasks for the live sync coordination and gossip actors, and a
@@ -21,7 +21,7 @@ thread for the sourcepub async fn start_sync(
&self,
namespace: NamespaceId,
- peers: Vec<NodeAddr>
+ peers: Vec<NodeAddr>
) -> Result<()>
Start to sync a document.
If peers is non-empty, it will both do an initial set-reconciliation sync with each peer,
and join an iroh-gossip swarm with these peers to receive and broadcast document updates.
diff --git a/pr/2595/docs/iroh_docs/engine/struct.SyncEvent.html b/pr/2595/docs/iroh_docs/engine/struct.SyncEvent.html
index 49ba954022..d7eb730d81 100644
--- a/pr/2595/docs/iroh_docs/engine/struct.SyncEvent.html
+++ b/pr/2595/docs/iroh_docs/engine/struct.SyncEvent.html
@@ -1,11 +1,11 @@
SyncEvent in iroh_docs::engine - Rust pub struct SyncEvent {
- pub peer: PublicKey,
+ pub peer: PublicKey,
pub origin: Origin,
pub finished: SystemTime,
pub started: SystemTime,
pub result: Result<SyncDetails, String>,
}
Expand description
Event emitted when a sync operation completes
-Fields§
§peer: PublicKeyPeer we synced with
+Fields§
§peer: PublicKeyPeer we synced with
§origin: OriginOrigin of the sync exchange
§finished: SystemTimeTimestamp when the sync started
§started: SystemTimeTimestamp when the sync finished
diff --git a/pr/2595/docs/iroh_docs/index.html b/pr/2595/docs/iroh_docs/index.html
index a37d30e2a6..41c792c5e5 100644
--- a/pr/2595/docs/iroh_docs/index.html
+++ b/pr/2595/docs/iroh_docs/index.html
@@ -1,7 +1,7 @@
iroh_docs - Rust Expand description
Multi-dimensional key-value documents with an efficient synchronization protocol
The crate operates on Replicas. A replica contains an unlimited number of
Entries. Each entry is identified by a key, its author, and the replica’s
-namespace. Its value is the 32-byte BLAKE3 hash
+namespace. Its value is the 32-byte BLAKE3 hash
of the entry’s content data, the size of this content data, and a timestamp.
The content data itself is not stored or transferred through a replica.
All entries in a replica are signed with two keypairs:
diff --git a/pr/2595/docs/iroh_docs/net/enum.AcceptError.html b/pr/2595/docs/iroh_docs/net/enum.AcceptError.html
index 87e9a07ad3..cf11b5b695 100644
--- a/pr/2595/docs/iroh_docs/net/enum.AcceptError.html
+++ b/pr/2595/docs/iroh_docs/net/enum.AcceptError.html
@@ -3,31 +3,31 @@
error: Error,
},
Open {
- peer: PublicKey,
+ peer: PublicKey,
error: Error,
},
Abort {
- peer: PublicKey,
+ peer: PublicKey,
namespace: NamespaceId,
reason: AbortReason,
},
Sync {
- peer: PublicKey,
+ peer: PublicKey,
namespace: Option<NamespaceId>,
error: Error,
},
Close {
- peer: PublicKey,
+ peer: PublicKey,
namespace: Option<NamespaceId>,
error: Error,
},
}Expand description
Errors that may occur on handling incoming sync connections.
Variants§
§Connect
Failed to establish connection
§Open
Failed to open replica
-§Abort
We aborted the sync request.
-§Sync
Failed to run sync
-§Close
Failed to close
-Implementations§
source§impl AcceptError
Implementations§
Trait Implementations§
source§impl Debug for AcceptError
source§impl Display for AcceptError
source§impl Error for AcceptError
source§fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more1.0.0 · source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()Auto Trait Implementations§
§impl Freeze for AcceptError
§impl RefUnwindSafe for AcceptError
§impl Send for AcceptError
§impl Sync for AcceptError
§impl Unpin for AcceptError
§impl UnwindSafe for AcceptError
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
diff --git a/pr/2595/docs/iroh_docs/net/fn.connect_and_sync.html b/pr/2595/docs/iroh_docs/net/fn.connect_and_sync.html
index 1ee6909d53..7bec313309 100644
--- a/pr/2595/docs/iroh_docs/net/fn.connect_and_sync.html
+++ b/pr/2595/docs/iroh_docs/net/fn.connect_and_sync.html
@@ -2,6 +2,6 @@
endpoint: &Endpoint,
sync: &SyncHandle,
namespace: NamespaceId,
- peer: NodeAddr
+ peer: NodeAddr
) -> Result<SyncFinished, ConnectError>Expand description
Connect to a peer and sync a replica
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_docs/net/fn.handle_connection.html b/pr/2595/docs/iroh_docs/net/fn.handle_connection.html
index 347a0c22bf..e96816b362 100644
--- a/pr/2595/docs/iroh_docs/net/fn.handle_connection.html
+++ b/pr/2595/docs/iroh_docs/net/fn.handle_connection.html
@@ -3,6 +3,6 @@
connecting: Connecting,
accept_cb: F
) -> Result<SyncFinished, AcceptError>where
- F: Fn(NamespaceId, PublicKey) -> Fut,
+ F: Fn(NamespaceId, PublicKey) -> Fut,
Fut: Future<Output = AcceptOutcome>,Expand description
Handle an iroh-docs connection and sync all shared documents in the replica store.
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_docs/net/struct.SyncFinished.html b/pr/2595/docs/iroh_docs/net/struct.SyncFinished.html
index 74ab2f6632..dcd549e6fc 100644
--- a/pr/2595/docs/iroh_docs/net/struct.SyncFinished.html
+++ b/pr/2595/docs/iroh_docs/net/struct.SyncFinished.html
@@ -1,11 +1,11 @@
SyncFinished in iroh_docs::net - Rust Struct iroh_docs::net::SyncFinished
source · pub struct SyncFinished {
pub namespace: NamespaceId,
- pub peer: PublicKey,
+ pub peer: PublicKey,
pub outcome: SyncOutcome,
pub timings: Timings,
}
Expand description
Details of a finished sync operation.
Fields§
§namespace: NamespaceIdThe namespace that was synced.
-§peer: PublicKeyThe peer we syned with.
+§peer: PublicKeyThe peer we syned with.
§outcome: SyncOutcomeThe outcome of the sync operation
§timings: TimingsThe time this operation took
Trait Implementations§
source§impl Clone for SyncFinished
source§fn clone(&self) -> SyncFinished
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moreAuto Trait Implementations§
§impl Freeze for SyncFinished
§impl RefUnwindSafe for SyncFinished
§impl Send for SyncFinished
§impl Sync for SyncFinished
§impl Unpin for SyncFinished
§impl UnwindSafe for SyncFinished
Blanket Implementations§
source§impl<T> Any for Twhere
diff --git a/pr/2595/docs/iroh_docs/store/fs/struct.ContentHashesIterator.html b/pr/2595/docs/iroh_docs/store/fs/struct.ContentHashesIterator.html
index 8bebf68ec6..df1fc8865f 100644
--- a/pr/2595/docs/iroh_docs/store/fs/struct.ContentHashesIterator.html
+++ b/pr/2595/docs/iroh_docs/store/fs/struct.ContentHashesIterator.html
@@ -6,7 +6,7 @@ It needs a copy of a redb::ReadOnlyTable to be self-contained.
Implementations§
Trait Implementations§
source§impl Debug for ContentHashesIterator
Trait Implementations§
source§impl Debug for ContentHashesIterator
source§impl Iterator for ContentHashesIterator
source§fn next(&mut self) -> Option<Self::Item>
Advances the iterator and returns the next value. Read moresource§fn next_chunk<const N: usize>(
&mut self
) -> Result<[Self::Item; N], IntoIter<Self::Item, N>>where
Self: Sized,
🔬This is a nightly-only experimental API. (iter_next_chunk)Advances the iterator and returns an array containing the next N values. Read more1.0.0 · source§fn size_hint(&self) -> (usize, Option<usize>)
Returns the bounds on the remaining length of the iterator. Read more1.0.0 · source§fn count(self) -> usizewhere
diff --git a/pr/2595/docs/iroh_docs/struct.AuthorId.html b/pr/2595/docs/iroh_docs/struct.AuthorId.html
index 7dfa3dea5b..02221b0eb6 100644
--- a/pr/2595/docs/iroh_docs/struct.AuthorId.html
+++ b/pr/2595/docs/iroh_docs/struct.AuthorId.html
@@ -156,6 +156,6 @@ letters are used (e.g. F9B4CA)
Into<Dispatch>, source§fn with_current_subscriber(self) -> WithDispatch<Self>
source§impl<T> DeserializeOwned for Twhere
- T: for<'de> Deserialize<'de>,
§impl<T> PeerIdentity for Twhere
+ T: for<'de> Deserialize<'de>,
source§impl<T> PeerIdentity for T
source§impl<T> RuleType for T
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_docs/struct.AuthorPublicKey.html b/pr/2595/docs/iroh_docs/struct.AuthorPublicKey.html
index 8e72b11c8a..7a83ce68e4 100644
--- a/pr/2595/docs/iroh_docs/struct.AuthorPublicKey.html
+++ b/pr/2595/docs/iroh_docs/struct.AuthorPublicKey.html
@@ -148,6 +148,6 @@ builds. Into<Dispatch>,source§fn with_current_subscriber(self) -> WithDispatch<Self>
source§impl<T> DeserializeOwned for Twhere
- T: for<'de> Deserialize<'de>,
§impl<T> PeerIdentity for Twhere
+ T: for<'de> Deserialize<'de>,
source§impl<T> PeerIdentity for T
source§impl<T> RuleType for T
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_docs/struct.DocTicket.html b/pr/2595/docs/iroh_docs/struct.DocTicket.html
index d53a93c4c4..fd1bb5eb02 100644
--- a/pr/2595/docs/iroh_docs/struct.DocTicket.html
+++ b/pr/2595/docs/iroh_docs/struct.DocTicket.html
@@ -1,13 +1,13 @@
DocTicket in iroh_docs - Rust pub struct DocTicket {
pub capability: Capability,
- pub nodes: Vec<NodeAddr>,
+ pub nodes: Vec<NodeAddr>,
}
Expand description
Contains both a key (either secret or public) to a document, and a list of peers to join.
Fields§
§capability: Capabilityeither a public or private key
-§nodes: Vec<NodeAddr>A list of nodes to contact.
-Implementations§
source§impl DocTicket
sourcepub fn new(capability: Capability, peers: Vec<NodeAddr>) -> Self
Create a new doc ticket
+§nodes: Vec<NodeAddr>A list of nodes to contact.
+Implementations§
Trait Implementations§
source§impl<'de> Deserialize<'de> for DocTicket
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
- __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreAuto Trait Implementations§
§impl Freeze for DocTicket
§impl RefUnwindSafe for DocTicket
§impl Send for DocTicket
§impl Sync for DocTicket
§impl Unpin for DocTicket
§impl UnwindSafe for DocTicket
Blanket Implementations§
source§impl<T> Any for Twhere
+ __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreAuto Trait Implementations§
§impl Freeze for DocTicket
§impl RefUnwindSafe for DocTicket
§impl Send for DocTicket
§impl Sync for DocTicket
§impl Unpin for DocTicket
§impl UnwindSafe for DocTicket
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
diff --git a/pr/2595/docs/iroh_docs/struct.NamespaceId.html b/pr/2595/docs/iroh_docs/struct.NamespaceId.html
index 433d51afc6..f9acda8e94 100644
--- a/pr/2595/docs/iroh_docs/struct.NamespaceId.html
+++ b/pr/2595/docs/iroh_docs/struct.NamespaceId.html
@@ -156,6 +156,6 @@ letters are used (e.g. F9B4CA)
Into<Dispatch>, source§fn with_current_subscriber(self) -> WithDispatch<Self>
source§impl<T> DeserializeOwned for Twhere
- T: for<'de> Deserialize<'de>,
§impl<T> PeerIdentity for Twhere
+ T: for<'de> Deserialize<'de>,
source§impl<T> PeerIdentity for T
source§impl<T> RuleType for T
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_docs/struct.NamespacePublicKey.html b/pr/2595/docs/iroh_docs/struct.NamespacePublicKey.html
index 350dea9049..72b75ed510 100644
--- a/pr/2595/docs/iroh_docs/struct.NamespacePublicKey.html
+++ b/pr/2595/docs/iroh_docs/struct.NamespacePublicKey.html
@@ -147,6 +147,6 @@ builds.Into<Dispatch>,source§fn with_current_subscriber(self) -> WithDispatch<Self>
source§impl<T> DeserializeOwned for Twhere
- T: for<'de> Deserialize<'de>,
§impl<T> PeerIdentity for Twhere
+ T: for<'de> Deserialize<'de>,
source§impl<T> PeerIdentity for T
source§impl<T> RuleType for T
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_docs/sync/struct.Entry.html b/pr/2595/docs/iroh_docs/sync/struct.Entry.html
index 55bf06044f..055a4b6f54 100644
--- a/pr/2595/docs/iroh_docs/sync/struct.Entry.html
+++ b/pr/2595/docs/iroh_docs/sync/struct.Entry.html
@@ -1,6 +1,6 @@
Entry in iroh_docs::sync - Rust pub struct Entry { /* private fields */ }
Expand description
A single entry in a Replica
An entry is identified by a key, its Author, and the Replica’s
-NamespaceSecret. Its value is the 32-byte BLAKE3 hash
+NamespaceSecret. Its value is the 32-byte BLAKE3 hash
of the entry’s content data, the size of this content data, and a timestamp.
Implementations§
source§impl Entry
sourcepub fn new(id: RecordIdentifier, record: Record) -> Self
Create a new entry
sourcepub fn new_empty(id: RecordIdentifier) -> Self
Create a new empty entry with the current timestamp.
@@ -15,7 +15,7 @@ of the entry’s content data, the size of this content data, and a timestamp.
sourcepub fn sign(self, namespace: &NamespaceSecret, author: &Author) -> SignedEntry
Sign this entry with a NamespaceSecret and Author.
Methods from Deref<Target = Record>§
sourcepub fn content_len(&self) -> u64
Get the length of the data addressed by this record’s content hash.
-sourcepub fn content_hash(&self) -> Hash
Get the [struct@Hash] of the content data of this record.
+sourcepub fn content_hash(&self) -> Hash
Get the Hash of the content data of this record.
Trait Implementations§
source§impl<'de> Deserialize<'de> for Entry
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl From<SignedEntry> for Entry
source§fn from(value: SignedEntry) -> Self
Converts to this type from the input type.source§impl Ord for Entry
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
diff --git a/pr/2595/docs/iroh_docs/sync/struct.Record.html b/pr/2595/docs/iroh_docs/sync/struct.Record.html
index 94479a973e..f06cccab52 100644
--- a/pr/2595/docs/iroh_docs/sync/struct.Record.html
+++ b/pr/2595/docs/iroh_docs/sync/struct.Record.html
@@ -1,11 +1,11 @@
Record in iroh_docs::sync - Rust pub struct Record { /* private fields */ }
Expand description
The data part of an entry in a Replica.
-Implementations§
source§impl Record
Implementations§
source§impl Record
sourcepub fn empty_current() -> Self
Create a tombstone record with the timestamp set to now.
sourcepub fn new_current(hash: Hash, len: u64) -> Self
Create a new Record with the timestamp set to now.
+sourcepub fn new_current(hash: Hash, len: u64) -> Self
Create a new Record with the timestamp set to now.
sourcepub fn content_len(&self) -> u64
Get the length of the data addressed by this record’s content hash.
-sourcepub fn content_hash(&self) -> Hash
Get the [struct@Hash] of the content data of this record.
+sourcepub fn content_hash(&self) -> Hash
Get the Hash of the content data of this record.
Trait Implementations§
source§impl<'de> Deserialize<'de> for Record
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl Ord for Record
Ordering for entry values.
diff --git a/pr/2595/docs/iroh_docs/sync/struct.Replica.html b/pr/2595/docs/iroh_docs/sync/struct.Replica.html
index 23a9798651..c4e161f3c3 100644
--- a/pr/2595/docs/iroh_docs/sync/struct.Replica.html
+++ b/pr/2595/docs/iroh_docs/sync/struct.Replica.html
@@ -5,7 +5,7 @@
&mut self,
key: impl AsRef<[u8]>,
author: &Author,
- hash: Hash,
+ hash: Hash,
len: u64
) -> Result<usize, InsertError>Insert a new record at the given key.
The entry will by signed by the provided author.
@@ -35,7 +35,7 @@ or an error if the entry failed to validate or if a store operation failed.
key: impl AsRef<[u8]>,
author: &Author,
data: impl AsRef<[u8]>
-) -> Result<Hash, InsertError>Hashes the given data and inserts it.
+) -> Result<Hash, InsertError>Hashes the given data and inserts it.
This does not store the content, just the record of it.
Returns the calculated hash.
sourcepub fn record_id(
diff --git a/pr/2595/docs/iroh_docs/sync/struct.SignedEntry.html b/pr/2595/docs/iroh_docs/sync/struct.SignedEntry.html
index 21644eacb1..9ef5e98134 100644
--- a/pr/2595/docs/iroh_docs/sync/struct.SignedEntry.html
+++ b/pr/2595/docs/iroh_docs/sync/struct.SignedEntry.html
@@ -14,7 +14,7 @@
sourcepub fn signature(&self) -> &EntrySignature
Get the signature.
sourcepub fn validate_empty(&self) -> Result<(), ValidationFailure>
Validate that the entry has the empty hash if the length is 0, or a non-zero length.
sourcepub fn content_hash(&self) -> Hash
Get the content [struct@Hash] of the entry.
+sourcepub fn content_hash(&self) -> Hash
Get the content Hash of the entry.
sourcepub fn content_len(&self) -> u64
Get the content length of the entry.
Get the author bytes of this entry.
Methods from Deref<Target = Record>§
sourcepub fn content_len(&self) -> u64
Get the length of the data addressed by this record’s content hash.
-sourcepub fn content_hash(&self) -> Hash
Get the [struct@Hash] of the content data of this record.
+sourcepub fn content_hash(&self) -> Hash
Get the Hash of the content data of this record.
Trait Implementations§
source§impl Clone for SignedEntry
source§fn clone(&self) -> SignedEntry
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moresource§impl Debug for SignedEntry
source§impl Deref for SignedEntry
source§impl<'de> Deserialize<'de> for SignedEntry
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl From<SignedEntry> for Entry
source§fn from(value: SignedEntry) -> Self
Converts to this type from the input type.source§impl Ord for SignedEntry
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
diff --git a/pr/2595/docs/iroh_docs/sync/type.ContentStatusCallback.html b/pr/2595/docs/iroh_docs/sync/type.ContentStatusCallback.html
index 46d5a5a49c..84ffdbe8ee 100644
--- a/pr/2595/docs/iroh_docs/sync/type.ContentStatusCallback.html
+++ b/pr/2595/docs/iroh_docs/sync/type.ContentStatusCallback.html
@@ -1,2 +1,2 @@
-ContentStatusCallback in iroh_docs::sync - Rust Type Alias iroh_docs::sync::ContentStatusCallback
source · pub type ContentStatusCallback = Arc<dyn Fn(Hash) -> ContentStatus + Send + Sync + 'static>;
Expand description
Callback that may be set on a replica to determine the availability status for a content hash.
+ContentStatusCallback in iroh_docs::sync - Rust Type Alias iroh_docs::sync::ContentStatusCallback
source · pub type ContentStatusCallback = Arc<dyn Fn(Hash) -> ContentStatus + Send + Sync + 'static>;
Expand description
Callback that may be set on a replica to determine the availability status for a content hash.
Aliased Type§
struct ContentStatusCallback { /* private fields */ }
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_net/discovery/dns/index.html b/pr/2595/docs/iroh_net/discovery/dns/index.html
index 5a80538422..a752b49d78 100644
--- a/pr/2595/docs/iroh_net/discovery/dns/index.html
+++ b/pr/2595/docs/iroh_net/discovery/dns/index.html
@@ -1,2 +1,2 @@
-iroh_net::discovery::dns - Rust Expand description
DNS node discovery for iroh-net
+iroh_net::discovery::dns - Rust Expand description
DNS node discovery for iroh-net
Structs§
- DNS node discovery
Constants§
- The n0 testing DNS node origin, for production.
- The n0 testing DNS node origin, for testing.
- Testing DNS node origin, must run server from
crate::test_utils::DnsPkarrServer.
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_net/discovery/dns/struct.DnsDiscovery.html b/pr/2595/docs/iroh_net/discovery/dns/struct.DnsDiscovery.html
index 3e7d5d71cc..7628fb45a9 100644
--- a/pr/2595/docs/iroh_net/discovery/dns/struct.DnsDiscovery.html
+++ b/pr/2595/docs/iroh_net/discovery/dns/struct.DnsDiscovery.html
@@ -28,7 +28,7 @@ custom discovery mechanism.
For testing it is also possible to use the N0_DNS_NODE_ORIGIN_STAGING domain
with DnsDiscovery::new. This would then use a hosted discovery service again,
but for testing purposes.
-Trait Implementations§
Trait Implementations§
source§impl Debug for DnsDiscovery
source§impl Discovery for DnsDiscovery
source§fn resolve(
&self,
ep: Endpoint,
node_id: NodeId
diff --git a/pr/2595/docs/iroh_net/discovery/trait.Discovery.html b/pr/2595/docs/iroh_net/discovery/trait.Discovery.html
index a53a618708..d3832a56b5 100644
--- a/pr/2595/docs/iroh_net/discovery/trait.Discovery.html
+++ b/pr/2595/docs/iroh_net/discovery/trait.Discovery.html
@@ -29,4 +29,4 @@ These tasks will be run on the runtime of the Option<BoxStream<Result<DiscoveryItem>>>
Implementors§
source§impl Discovery for DnsDiscovery
source§impl Discovery for LocalSwarmDiscovery
source§impl Discovery for PkarrPublisher
source§impl Discovery for PkarrResolver
source§impl Discovery for ConcurrentDiscovery
\ No newline at end of file
+
Implementors§
source§impl Discovery for DnsDiscovery
source§impl Discovery for LocalSwarmDiscovery
source§impl Discovery for PkarrPublisher
source§impl Discovery for PkarrResolver
source§impl Discovery for ConcurrentDiscovery
\ No newline at end of file
diff --git a/pr/2595/docs/src/iroh_net/discovery/dns.rs.html b/pr/2595/docs/src/iroh_net/discovery/dns.rs.html
index dd1a279fb3..1d32545ed3 100644
--- a/pr/2595/docs/src/iroh_net/discovery/dns.rs.html
+++ b/pr/2595/docs/src/iroh_net/discovery/dns.rs.html
@@ -97,6 +97,10 @@
97
98
99
+100
+101
+102
+103
//! DNS node discovery for iroh-net
use anyhow::Result;
@@ -182,6 +186,10 @@
fn resolve(&self, ep: Endpoint, node_id: NodeId) -> Option<BoxStream<Result<DiscoveryItem>>> {
let resolver = ep.dns_resolver().clone();
let origin_domain = self.origin_domain.clone();
+ #[cfg(any(test, feature = "test-utils"))]
+ if origin_domain.contains(&TEST_DNS_NODE_ORIGIN.to_string()) {
+ panic!("wait. THIS IS ILLEGAL!");
+ }
let fut = async move {
let node_addr = resolver
.lookup_by_id_staggered(&node_id, &origin_domain, DNS_STAGGERING_MS)
diff --git a/pr/2595/docs/trait.impl/iroh_base/ticket/trait.Ticket.js b/pr/2595/docs/trait.impl/iroh_base/ticket/trait.Ticket.js
index 12fa1e3ee5..5d209fabd2 100644
--- a/pr/2595/docs/trait.impl/iroh_base/ticket/trait.Ticket.js
+++ b/pr/2595/docs/trait.impl/iroh_base/ticket/trait.Ticket.js
@@ -1,5 +1,5 @@
(function() {var implementors = {
"iroh":[],
"iroh_base":[],
-"iroh_docs":[["impl Ticket for DocTicket"]]
+"iroh_docs":[["impl Ticket for DocTicket"]]
};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
diff --git a/pr/2595/docs/type.impl/std/primitive.array.js b/pr/2595/docs/type.impl/std/primitive.array.js
index 588a8b53a3..3006964922 100644
--- a/pr/2595/docs/type.impl/std/primitive.array.js
+++ b/pr/2595/docs/type.impl/std/primitive.array.js
@@ -1,4 +1,4 @@
(function() {var type_impls = {
"iroh":[["source§impl<T, const N: usize> [T; N]
1.55.0 · sourcepub fn map<F, U>(self, f: F) -> [U; N]where\n F: FnMut(T) -> U,
Returns an array of the same size as self, with function f applied to each element\nin order.
\nIf you don’t necessarily need a new fixed-size array, consider using\nIterator::map instead.
\n§Note on performance and stack usage
\nUnfortunately, usages of this method are currently not always optimized\nas well as they could be. This mainly concerns large arrays, as mapping\nover small arrays seem to be optimized just fine. Also note that in\ndebug mode (i.e. without any optimizations), this method can use a lot\nof stack space (a few times the size of the array or more).
\nTherefore, in performance-critical code, try to avoid using this method\non large arrays or check the emitted code. Also try to avoid chained\nmaps (e.g. arr.map(...).map(...)).
\nIn many cases, you can instead use Iterator::map by calling .iter()\nor .into_iter() on your array. [T; N]::map is only necessary if you\nreally need a new array of the same size as the result. Rust’s lazy\niterators tend to get optimized very well.
\n§Examples
\nlet x = [1, 2, 3];\nlet y = x.map(|v| v + 1);\nassert_eq!(y, [2, 3, 4]);\n\nlet x = [1, 2, 3];\nlet mut temp = 0;\nlet y = x.map(|v| { temp += 1; v * temp });\nassert_eq!(y, [1, 4, 9]);\n\nlet x = [\"Ferris\", \"Bueller's\", \"Day\", \"Off\"];\nlet y = x.map(|v| v.len());\nassert_eq!(y, [6, 9, 3, 3]);
\nsourcepub fn try_map<F, R>(\n self,\n f: F\n) -> <<R as Try>::Residual as Residual<[<R as Try>::Output; N]>>::TryType
🔬This is a nightly-only experimental API. (array_try_map)
A fallible function f applied to each element on array self in order to\nreturn an array the same size as self or the first error encountered.
\nThe return type of this function depends on the return type of the closure.\nIf you return Result<T, E> from the closure, you’ll get a Result<[T; N], E>.\nIf you return Option<T> from the closure, you’ll get an Option<[T; N]>.
\n§Examples
\n#![feature(array_try_map)]\n\nlet a = [\"1\", \"2\", \"3\"];\nlet b = a.try_map(|v| v.parse::<u32>()).unwrap().map(|v| v + 1);\nassert_eq!(b, [2, 3, 4]);\n\nlet a = [\"1\", \"2a\", \"3\"];\nlet b = a.try_map(|v| v.parse::<u32>());\nassert!(b.is_err());\n\nuse std::num::NonZero;\n\nlet z = [1, 2, 0, 3, 4];\nassert_eq!(z.try_map(NonZero::new), None);\n\nlet a = [1, 2, 3];\nlet b = a.try_map(NonZero::new);\nlet c = b.map(|x| x.map(NonZero::get));\nassert_eq!(c, Some(a));
\n1.57.0 (const: 1.57.0) · sourcepub const fn as_slice(&self) -> &[T]
Returns a slice containing the entire array. Equivalent to &s[..].
\n1.57.0 · sourcepub fn as_mut_slice(&mut self) -> &mut [T]
Returns a mutable slice containing the entire array. Equivalent to\n&mut s[..].
\n1.77.0 · sourcepub fn each_ref(&self) -> [&T; N]
Borrows each element and returns an array of references with the same\nsize as self.
\n§Example
\nlet floats = [3.1, 2.7, -1.0];\nlet float_refs: [&f64; 3] = floats.each_ref();\nassert_eq!(float_refs, [&3.1, &2.7, &-1.0]);
\nThis method is particularly useful if combined with other methods, like\nmap. This way, you can avoid moving the original\narray if its elements are not Copy.
\n\nlet strings = [\"Ferris\".to_string(), \"♥\".to_string(), \"Rust\".to_string()];\nlet is_ascii = strings.each_ref().map(|s| s.is_ascii());\nassert_eq!(is_ascii, [true, false, true]);\n\n// We can still access the original array: it has not been moved.\nassert_eq!(strings.len(), 3);
\n1.77.0 · sourcepub fn each_mut(&mut self) -> [&mut T; N]
Borrows each element mutably and returns an array of mutable references\nwith the same size as self.
\n§Example
\n\nlet mut floats = [3.1, 2.7, -1.0];\nlet float_refs: [&mut f64; 3] = floats.each_mut();\n*float_refs[0] = 0.0;\nassert_eq!(float_refs, [&mut 0.0, &mut 2.7, &mut -1.0]);\nassert_eq!(floats, [0.0, 2.7, -1.0]);
\nsourcepub fn split_array_ref<const M: usize>(&self) -> (&[T; M], &[T])
🔬This is a nightly-only experimental API. (split_array)
Divides one array reference into two at an index.
\nThe first will contain all indices from [0, M) (excluding\nthe index M itself) and the second will contain all\nindices from [M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet v = [1, 2, 3, 4, 5, 6];\n\n{\n let (left, right) = v.split_array_ref::<0>();\n assert_eq!(left, &[]);\n assert_eq!(right, &[1, 2, 3, 4, 5, 6]);\n}\n\n{\n let (left, right) = v.split_array_ref::<2>();\n assert_eq!(left, &[1, 2]);\n assert_eq!(right, &[3, 4, 5, 6]);\n}\n\n{\n let (left, right) = v.split_array_ref::<6>();\n assert_eq!(left, &[1, 2, 3, 4, 5, 6]);\n assert_eq!(right, &[]);\n}
\nsourcepub fn split_array_mut<const M: usize>(&mut self) -> (&mut [T; M], &mut [T])
🔬This is a nightly-only experimental API. (split_array)
Divides one mutable array reference into two at an index.
\nThe first will contain all indices from [0, M) (excluding\nthe index M itself) and the second will contain all\nindices from [M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet mut v = [1, 0, 3, 0, 5, 6];\nlet (left, right) = v.split_array_mut::<2>();\nassert_eq!(left, &mut [1, 0][..]);\nassert_eq!(right, &mut [3, 0, 5, 6]);\nleft[1] = 2;\nright[1] = 4;\nassert_eq!(v, [1, 2, 3, 4, 5, 6]);
\nsourcepub fn rsplit_array_ref<const M: usize>(&self) -> (&[T], &[T; M])
🔬This is a nightly-only experimental API. (split_array)
Divides one array reference into two at an index from the end.
\nThe first will contain all indices from [0, N - M) (excluding\nthe index N - M itself) and the second will contain all\nindices from [N - M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet v = [1, 2, 3, 4, 5, 6];\n\n{\n let (left, right) = v.rsplit_array_ref::<0>();\n assert_eq!(left, &[1, 2, 3, 4, 5, 6]);\n assert_eq!(right, &[]);\n}\n\n{\n let (left, right) = v.rsplit_array_ref::<2>();\n assert_eq!(left, &[1, 2, 3, 4]);\n assert_eq!(right, &[5, 6]);\n}\n\n{\n let (left, right) = v.rsplit_array_ref::<6>();\n assert_eq!(left, &[]);\n assert_eq!(right, &[1, 2, 3, 4, 5, 6]);\n}
\nsourcepub fn rsplit_array_mut<const M: usize>(&mut self) -> (&mut [T], &mut [T; M])
🔬This is a nightly-only experimental API. (split_array)
Divides one mutable array reference into two at an index from the end.
\nThe first will contain all indices from [0, N - M) (excluding\nthe index N - M itself) and the second will contain all\nindices from [N - M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet mut v = [1, 0, 3, 0, 5, 6];\nlet (left, right) = v.rsplit_array_mut::<4>();\nassert_eq!(left, &mut [1, 0]);\nassert_eq!(right, &mut [3, 0, 5, 6][..]);\nleft[1] = 2;\nright[1] = 4;\nassert_eq!(v, [1, 2, 3, 4, 5, 6]);
\n",0,"iroh::docs::PeerIdBytes"],["source§impl<const N: usize> [u8; N]
sourcepub const fn as_ascii(&self) -> Option<&[AsciiChar; N]>
🔬This is a nightly-only experimental API. (ascii_char)
Converts this array of bytes into a array of ASCII characters,\nor returns None if any of the characters is non-ASCII.
\n§Examples
\n#![feature(ascii_char)]\n#![feature(const_option)]\n\nconst HEX_DIGITS: [std::ascii::Char; 16] =\n *b\"0123456789abcdef\".as_ascii().unwrap();\n\nassert_eq!(HEX_DIGITS[1].as_str(), \"1\");\nassert_eq!(HEX_DIGITS[10].as_str(), \"a\");
\nsourcepub const unsafe fn as_ascii_unchecked(&self) -> &[AsciiChar; N]
🔬This is a nightly-only experimental API. (ascii_char)
Converts this array of bytes into a array of ASCII characters,\nwithout checking whether they’re valid.
\n§Safety
\nEvery byte in the array must be in 0..=127, or else this is UB.
\n",0,"iroh::docs::PeerIdBytes"],["§impl<T> Array for [T; 32]where\n T: Default,
§fn as_slice_mut(&mut self) -> &mut [T]
Gives a unique slice over the whole thing. Read more","Array","iroh::docs::PeerIdBytes"],["","Array","iroh::docs::PeerIdBytes"],["§impl<const N: usize, T> AsBytes for [T; N]where\n T: AsBytes,
§fn write_to_prefix(&self, bytes: &mut [u8]) -> Option<()>
","AsBytes","iroh::docs::PeerIdBytes"],["","AsBytes","iroh::docs::PeerIdBytes"],["","AsMut<[T]>","iroh::docs::PeerIdBytes"],["","AsRef<[T]>","iroh::docs::PeerIdBytes"],["§impl<T, const N: usize> BitView for [T; N]where\n T: BitStore,
Note that overly-large arrays may cause the conversions to fail.
\n§fn view_bits<O>(&self) -> &BitSlice<T, O>where\n O: BitOrder,
Views a memory region as an immutable bit-slice.§fn try_view_bits<O>(&self) -> Result<&BitSlice<T, O>, BitSpanError<T>>where\n O: BitOrder,
Attempts to view a memory region as an immutable bit-slice. Read more§fn view_bits_mut<O>(&mut self) -> &mut BitSlice<T, O>where\n O: BitOrder,
Views a memory region as a mutable bit-slice.§fn try_view_bits_mut<O>(\n &mut self\n) -> Result<&mut BitSlice<T, O>, BitSpanError<T>>where\n O: BitOrder,
Attempts to view a memory region as a mutable bit-slice. Read more","BitView","iroh::docs::PeerIdBytes"],["§impl<T, const N: usize> BitViewSized for [T; N]where\n T: BitStore,
§fn as_raw_slice(&self) -> &[<[T; N] as BitView>::Store]
Views the type as a slice of its elements.§fn as_raw_mut_slice(&mut self) -> &mut [<[T; N] as BitView>::Store]
Views the type as a mutable slice of its elements.§fn into_bitarray<O>(self) -> BitArray<Self, O>where\n O: BitOrder,
Wraps self in a BitArray.","BitViewSized","iroh::docs::PeerIdBytes"],["","Borrow<[T]>","iroh::docs::PeerIdBytes"],["1.4.0 · source§impl<T, const N: usize> BorrowMut<[T]> for [T; N]
source§fn borrow_mut(&mut self) -> &mut [T]
Mutably borrows from an owned value. Read more","BorrowMut<[T]>","iroh::docs::PeerIdBytes"],["","Chain","iroh::docs::PeerIdBytes"],["","Clone","iroh::docs::PeerIdBytes"],["","Debug","iroh::docs::PeerIdBytes"],["§impl<const N: usize> Decode for [u8; N]
Decodes a byte array from byte[n] as described in RFC4251 § 5:
\n\nA byte represents an arbitrary 8-bit value (octet). Fixed length\ndata is sometimes represented as an array of bytes, written\nbyte[n], where n is the number of bytes in the array.
\n
\n","Decode","iroh::docs::PeerIdBytes"],["§impl<'a, T, const N: usize> DecodeValue<'a> for [T; N]where\n T: Decode<'a>,
§fn decode_value<R>(reader: &mut R, header: Header) -> Result<[T; N], Error>where\n R: Reader<'a>,
Attempt to decode this message using the provided [Reader].","DecodeValue<'a>","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["source§impl<'de, T> Deserialize<'de> for [T; 32]where\n T: Deserialize<'de>,
source§fn deserialize<D>(\n deserializer: D\n) -> Result<[T; 32], <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more","Deserialize<'de>","iroh::docs::PeerIdBytes"],["source§impl<'de, const N: usize> Deserialize<'de> for [u8; N]
source§fn deserialize<D>(\n deserializer: D\n) -> Result<[u8; N], <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
","Deserialize<'de>","iroh::docs::PeerIdBytes"],["§impl<const N: usize> Encode for [u8; N]
Encodes [u8; N] into byte[n] as described in RFC4251 § 5:
\n\nA byte represents an arbitrary 8-bit value (octet). Fixed length\ndata is sometimes represented as an array of bytes, written\nbyte[n], where n is the number of bytes in the array.
\n
\n§fn encoded_len(&self) -> Result<usize, Error>
Get the length of this type encoded in bytes, prior to Base64 encoding.§fn encode(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value using the provided [Writer].§fn encoded_len_prefixed(&self) -> Result<usize, Error>
Return the length of this type after encoding when prepended with a\nuint32 length prefix.§fn encode_prefixed(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value, first prepending a uint32 length prefix\nset to [Encode::encoded_len].","Encode","iroh::docs::PeerIdBytes"],["","EncodeLabelSet","iroh::docs::PeerIdBytes"],["§impl<T, const N: usize> EncodeValue for [T; N]where\n T: Encode,
","EncodeValue","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["§impl<'a> FindToken<&'a u8> for [u8; 32]
§fn find_token(&self, token: &u8) -> bool
Returns true if self contains the token","FindToken<&'a u8>","iroh::docs::PeerIdBytes"],["§impl FindToken<u8> for [u8; 32]
§fn find_token(&self, token: u8) -> bool
Returns true if self contains the token","FindToken","iroh::docs::PeerIdBytes"],["","FixedTag","iroh::docs::PeerIdBytes"],["","From<&Signature>","iroh::docs::PeerIdBytes"],["","From","iroh::docs::PeerIdBytes"],["§impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>>> for [T; 32]
","From, B0>, B0>, B0>, B0>, B0>>>","iroh::docs::PeerIdBytes"],["","From","iroh::docs::PeerIdBytes"],["","From","iroh::docs::PeerIdBytes"],["","From>","iroh::docs::PeerIdBytes"],["","From","iroh::docs::PeerIdBytes"],["","From","iroh::docs::PeerIdBytes"],["","From","iroh::docs::PeerIdBytes"],["","From>","iroh::docs::PeerIdBytes"],["§impl<const N: usize, T> FromBytes for [T; N]where\n T: FromBytes,
§fn slice_from_prefix(bytes: &[u8], count: usize) -> Option<(&[Self], &[u8])>where\n Self: Sized,
Interprets the prefix of the given bytes as a &[Self] with length\nequal to count without copying. Read more§fn slice_from_suffix(bytes: &[u8], count: usize) -> Option<(&[u8], &[Self])>where\n Self: Sized,
Interprets the suffix of the given bytes as a &[Self] with length\nequal to count without copying. Read more§fn read_from_prefix(bytes: &[u8]) -> Option<Self>where\n Self: Sized,
","FromBytes","iroh::docs::PeerIdBytes"],["","FromHex","iroh::docs::PeerIdBytes"],["","FromZeroes","iroh::docs::PeerIdBytes"],["","Hash","iroh::docs::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Hash for [T; N]where\n T: Hash,
The hash of an array is the same as that of the corresponding slice,\nas required by the Borrow implementation.
\n\nuse std::hash::BuildHasher;\n\nlet b = std::hash::RandomState::new();\nlet a: [u8; 3] = [0xa8, 0x3c, 0x09];\nlet s: &[u8] = &[0xa8, 0x3c, 0x09];\nassert_eq!(b.hash_one(a), b.hash_one(s));
\n","Hash","iroh::docs::PeerIdBytes"],["","Index","iroh::docs::PeerIdBytes"],["","IndexMut","iroh::docs::PeerIdBytes"],["","InputLength","iroh::docs::PeerIdBytes"],["1.53.0 · source§impl<T, const N: usize> IntoIterator for [T; N]
source§fn into_iter(self) -> <[T; N] as IntoIterator>::IntoIter
Creates a consuming iterator, that is, one that moves each value out of\nthe array (from start to end). The array cannot be used after calling\nthis unless T implements Copy, so the whole array is copied.
\nArrays have special behavior when calling .into_iter() prior to the\n2021 edition – see the array Editions section for more information.
\n","IntoIterator","iroh::docs::PeerIdBytes"],["§impl<const N: usize> IntoResponse for [u8; N]
§fn into_response(self) -> Response<Body>
Create a response.","IntoResponse","iroh::docs::PeerIdBytes"],["§impl<Fut, const N: usize> Join for [Fut; N]where\n Fut: IntoFuture,
§type Output = [<Fut as IntoFuture>::Output; N]
The resulting output type.§type Future = Join<<Fut as IntoFuture>::IntoFuture, N>
The Future implementation returned by this method.","Join","iroh::docs::PeerIdBytes"],["","Key","iroh::docs::PeerIdBytes"],["§impl<T, const N: usize> MaxSize for [T; N]where\n T: MaxSize,
§const POSTCARD_MAX_SIZE: usize = _
The maximum possible size that the serialization of this\ntype can have, in bytes.","MaxSize","iroh::docs::PeerIdBytes"],["","Merge","iroh::docs::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Ord for [T; N]where\n T: Ord,
Implements comparison of arrays lexicographically.
\n1.21.0 · source§fn max(self, other: Self) -> Selfwhere\n Self: Sized,
Compares and returns the maximum of two values. Read more","Ord","iroh::docs::PeerIdBytes"],["","PartialEq<&[U]>","iroh::docs::PeerIdBytes"],["1.0.0 · source§impl<T, U, const N: usize> PartialEq<&mut [U]> for [T; N]where\n T: PartialEq<U>,
","PartialEq<&mut [U]>","iroh::docs::PeerIdBytes"],["","PartialEq<[U]>","iroh::docs::PeerIdBytes"],["","PartialEq<[U; N]>","iroh::docs::PeerIdBytes"],["","PartialEq","iroh::docs::PeerIdBytes"],["§impl<A, B, const N: usize, const M: usize> PartialEq<Vec<A, N>> for [B; M]where\n A: PartialEq<B>,
","PartialEq>","iroh::docs::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> PartialOrd for [T; N]where\n T: PartialOrd,
Implements comparison of arrays lexicographically.
\nsource§fn le(&self, other: &[T; N]) -> bool
This method tests less than or equal to (for self and other) and is used by the <=\noperator. Read more","PartialOrd","iroh::docs::PeerIdBytes"],["§impl<Fut, const N: usize> Race for [Fut; N]where\n Fut: IntoFuture,
§type Output = <Fut as IntoFuture>::Output
The resulting output type.§type Future = Race<<Fut as IntoFuture>::IntoFuture, N>
Which kind of future are we turning this into?","Race","iroh::docs::PeerIdBytes"],["§impl<Fut, T, E, const N: usize> RaceOk for [Fut; N]where\n Fut: IntoFuture<Output = Result<T, E>>,
§type Future = RaceOk<<Fut as IntoFuture>::IntoFuture, T, E, N>
Which kind of future are we turning this into?","RaceOk","iroh::docs::PeerIdBytes"],["","Schema","iroh::docs::PeerIdBytes"],["source§impl<T> Serialize for [T; 32]where\n T: 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","iroh::docs::PeerIdBytes"],["source§impl<const N: usize> Serialize for [u8; N]
source§fn serialize<S>(\n &self,\n serializer: S\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where\n S: Serializer,
","Serialize","iroh::docs::PeerIdBytes"],["1.51.0 · source§impl<T, const N: usize> SlicePattern for [T; N]
","SlicePattern","iroh::docs::PeerIdBytes"],["1.34.0 · source§impl<T, const N: usize> TryFrom<&[T]> for [T; N]where\n T: Copy,
Tries to create an array [T; N] by copying from a slice &[T]. Succeeds if\nslice.len() == N.
\n\nlet bytes: [u8; 3] = [1, 0, 2];\n\nlet bytes_head: [u8; 2] = <[u8; 2]>::try_from(&bytes[0..2]).unwrap();\nassert_eq!(1, u16::from_le_bytes(bytes_head));\n\nlet bytes_tail: [u8; 2] = bytes[1..3].try_into().unwrap();\nassert_eq!(512, u16::from_le_bytes(bytes_tail));
\n§type Error = TryFromSliceError
The type returned in the event of a conversion error.","TryFrom<&[T]>","iroh::docs::PeerIdBytes"],["1.59.0 · source§impl<T, const N: usize> TryFrom<&mut [T]> for [T; N]where\n T: Copy,
Tries to create an array [T; N] by copying from a mutable slice &mut [T].\nSucceeds if slice.len() == N.
\n\nlet mut bytes: [u8; 3] = [1, 0, 2];\n\nlet bytes_head: [u8; 2] = <[u8; 2]>::try_from(&mut bytes[0..2]).unwrap();\nassert_eq!(1, u16::from_le_bytes(bytes_head));\n\nlet bytes_tail: [u8; 2] = (&mut bytes[1..3]).try_into().unwrap();\nassert_eq!(512, u16::from_le_bytes(bytes_tail));
\n§type Error = TryFromSliceError
The type returned in the event of a conversion error.","TryFrom<&mut [T]>","iroh::docs::PeerIdBytes"],["§impl<T, A, const N: usize> TryFrom<Vec<T, A>> for [T; N]where\n A: Allocator,
§fn try_from(vec: Vec<T, A>) -> Result<[T; N], Vec<T, A>>
Gets the entire contents of the Vec<T> as an array,\nif its size exactly matches that of the requested array.
\n§Examples
\nassert_eq!(vec![1, 2, 3].try_into(), Ok([1, 2, 3]));\nassert_eq!(<Vec<i32>>::new().try_into(), Ok([]));
\nIf the length doesn’t match, the input comes back in Err:
\n\nlet r: Result<[i32; 4], _> = (0..10).collect::<Vec<_>>().try_into();\nassert_eq!(r, Err(vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9]));
\nIf you’re fine with just getting a prefix of the Vec<T>,\nyou can call .truncate(N) first.
\n\nlet mut v = String::from(\"hello world\").into_bytes();\nv.sort();\nv.truncate(2);\nlet [a, b]: [_; 2] = v.try_into().unwrap();\nassert_eq!(a, b' ');\nassert_eq!(b, b'd');
\n","TryFrom>","iroh::docs::PeerIdBytes"],["1.48.0 · source§impl<T, A, const N: usize> TryFrom<Vec<T, A>> for [T; N]where\n A: Allocator,
source§fn try_from(vec: Vec<T, A>) -> Result<[T; N], Vec<T, A>>
Gets the entire contents of the Vec<T> as an array,\nif its size exactly matches that of the requested array.
\n§Examples
\nassert_eq!(vec![1, 2, 3].try_into(), Ok([1, 2, 3]));\nassert_eq!(<Vec<i32>>::new().try_into(), Ok([]));
\nIf the length doesn’t match, the input comes back in Err:
\n\nlet r: Result<[i32; 4], _> = (0..10).collect::<Vec<_>>().try_into();\nassert_eq!(r, Err(vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9]));
\nIf you’re fine with just getting a prefix of the Vec<T>,\nyou can call .truncate(N) first.
\n\nlet mut v = String::from(\"hello world\").into_bytes();\nv.sort();\nv.truncate(2);\nlet [a, b]: [_; 2] = v.try_into().unwrap();\nassert_eq!(a, b' ');\nassert_eq!(b, b'd');
\n","TryFrom>","iroh::docs::PeerIdBytes"],["§impl<Fut, T, E, const N: usize> TryJoin for [Fut; N]where\n Fut: IntoFuture<Output = Result<T, E>>,
§type Future = TryJoin<<Fut as IntoFuture>::IntoFuture, T, E, N>
Which kind of future are we turning this into?","TryJoin","iroh::docs::PeerIdBytes"],["§impl<const N: usize, T> Value for [T; N]where\n T: Value,
§type SelfType<'a> = [<T as Value>::SelfType<'a>; N]\nwhere\n [T; N]: 'a
SelfType<’a> must be the same type as Self with all lifetimes replaced with ’a§type AsBytes<'a> = Vec<u8>\nwhere\n [T; N]: 'a
§fn fixed_width() -> Option<usize>
Width of a fixed type, or None for variable width§fn from_bytes<'a>(data: &'a [u8]) -> [<T as Value>::SelfType<'a>; N]where\n [T; N]: 'a,
Deserializes data\nImplementations may return a view over data, or an owned type","Value","iroh::docs::PeerIdBytes"],["","ValueOrd","iroh::docs::PeerIdBytes"],["§impl<Z, const N: usize> Zeroize for [Z; N]where\n Z: Zeroize,
Impl [Zeroize] on arrays of types that impl [Zeroize].
\n","Zeroize","iroh::docs::PeerIdBytes"],["","Zip","iroh::docs::PeerIdBytes"],["source§impl<T, const N: usize> ConstParamTy for [T; N]where\n T: ConstParamTy,
","ConstParamTy","iroh::docs::PeerIdBytes"],["1.58.0 · source§impl<T, const N: usize> Copy for [T; N]where\n T: Copy,
","Copy","iroh::docs::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Eq for [T; N]where\n T: Eq,
","Eq","iroh::docs::PeerIdBytes"],["source§impl<T, const N: usize> StructuralPartialEq for [T; N]
","StructuralPartialEq","iroh::docs::PeerIdBytes"],["§impl<const N: usize, T> Unaligned for [T; N]where\n T: Unaligned,
","Unaligned","iroh::docs::PeerIdBytes"],["§impl<Z, const N: usize> ZeroizeOnDrop for [Z; N]where\n Z: ZeroizeOnDrop,
Impl [ZeroizeOnDrop] on arrays of types that impl [ZeroizeOnDrop].
\n","ZeroizeOnDrop","iroh::docs::PeerIdBytes"]],
-"iroh_docs":[["source§impl<T, const N: usize> [T; N]
1.55.0 · sourcepub fn map<F, U>(self, f: F) -> [U; N]where\n F: FnMut(T) -> U,
Returns an array of the same size as self, with function f applied to each element\nin order.
\nIf you don’t necessarily need a new fixed-size array, consider using\nIterator::map instead.
\n§Note on performance and stack usage
\nUnfortunately, usages of this method are currently not always optimized\nas well as they could be. This mainly concerns large arrays, as mapping\nover small arrays seem to be optimized just fine. Also note that in\ndebug mode (i.e. without any optimizations), this method can use a lot\nof stack space (a few times the size of the array or more).
\nTherefore, in performance-critical code, try to avoid using this method\non large arrays or check the emitted code. Also try to avoid chained\nmaps (e.g. arr.map(...).map(...)).
\nIn many cases, you can instead use Iterator::map by calling .iter()\nor .into_iter() on your array. [T; N]::map is only necessary if you\nreally need a new array of the same size as the result. Rust’s lazy\niterators tend to get optimized very well.
\n§Examples
\nlet x = [1, 2, 3];\nlet y = x.map(|v| v + 1);\nassert_eq!(y, [2, 3, 4]);\n\nlet x = [1, 2, 3];\nlet mut temp = 0;\nlet y = x.map(|v| { temp += 1; v * temp });\nassert_eq!(y, [1, 4, 9]);\n\nlet x = [\"Ferris\", \"Bueller's\", \"Day\", \"Off\"];\nlet y = x.map(|v| v.len());\nassert_eq!(y, [6, 9, 3, 3]);
\nsourcepub fn try_map<F, R>(\n self,\n f: F\n) -> <<R as Try>::Residual as Residual<[<R as Try>::Output; N]>>::TryType
🔬This is a nightly-only experimental API. (array_try_map)
A fallible function f applied to each element on array self in order to\nreturn an array the same size as self or the first error encountered.
\nThe return type of this function depends on the return type of the closure.\nIf you return Result<T, E> from the closure, you’ll get a Result<[T; N], E>.\nIf you return Option<T> from the closure, you’ll get an Option<[T; N]>.
\n§Examples
\n#![feature(array_try_map)]\n\nlet a = [\"1\", \"2\", \"3\"];\nlet b = a.try_map(|v| v.parse::<u32>()).unwrap().map(|v| v + 1);\nassert_eq!(b, [2, 3, 4]);\n\nlet a = [\"1\", \"2a\", \"3\"];\nlet b = a.try_map(|v| v.parse::<u32>());\nassert!(b.is_err());\n\nuse std::num::NonZero;\n\nlet z = [1, 2, 0, 3, 4];\nassert_eq!(z.try_map(NonZero::new), None);\n\nlet a = [1, 2, 3];\nlet b = a.try_map(NonZero::new);\nlet c = b.map(|x| x.map(NonZero::get));\nassert_eq!(c, Some(a));
\n1.57.0 (const: 1.57.0) · sourcepub const fn as_slice(&self) -> &[T]
Returns a slice containing the entire array. Equivalent to &s[..].
\n1.57.0 · sourcepub fn as_mut_slice(&mut self) -> &mut [T]
Returns a mutable slice containing the entire array. Equivalent to\n&mut s[..].
\n1.77.0 · sourcepub fn each_ref(&self) -> [&T; N]
Borrows each element and returns an array of references with the same\nsize as self.
\n§Example
\nlet floats = [3.1, 2.7, -1.0];\nlet float_refs: [&f64; 3] = floats.each_ref();\nassert_eq!(float_refs, [&3.1, &2.7, &-1.0]);
\nThis method is particularly useful if combined with other methods, like\nmap. This way, you can avoid moving the original\narray if its elements are not Copy.
\n\nlet strings = [\"Ferris\".to_string(), \"♥\".to_string(), \"Rust\".to_string()];\nlet is_ascii = strings.each_ref().map(|s| s.is_ascii());\nassert_eq!(is_ascii, [true, false, true]);\n\n// We can still access the original array: it has not been moved.\nassert_eq!(strings.len(), 3);
\n1.77.0 · sourcepub fn each_mut(&mut self) -> [&mut T; N]
Borrows each element mutably and returns an array of mutable references\nwith the same size as self.
\n§Example
\n\nlet mut floats = [3.1, 2.7, -1.0];\nlet float_refs: [&mut f64; 3] = floats.each_mut();\n*float_refs[0] = 0.0;\nassert_eq!(float_refs, [&mut 0.0, &mut 2.7, &mut -1.0]);\nassert_eq!(floats, [0.0, 2.7, -1.0]);
\nsourcepub fn split_array_ref<const M: usize>(&self) -> (&[T; M], &[T])
🔬This is a nightly-only experimental API. (split_array)
Divides one array reference into two at an index.
\nThe first will contain all indices from [0, M) (excluding\nthe index M itself) and the second will contain all\nindices from [M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet v = [1, 2, 3, 4, 5, 6];\n\n{\n let (left, right) = v.split_array_ref::<0>();\n assert_eq!(left, &[]);\n assert_eq!(right, &[1, 2, 3, 4, 5, 6]);\n}\n\n{\n let (left, right) = v.split_array_ref::<2>();\n assert_eq!(left, &[1, 2]);\n assert_eq!(right, &[3, 4, 5, 6]);\n}\n\n{\n let (left, right) = v.split_array_ref::<6>();\n assert_eq!(left, &[1, 2, 3, 4, 5, 6]);\n assert_eq!(right, &[]);\n}
\nsourcepub fn split_array_mut<const M: usize>(&mut self) -> (&mut [T; M], &mut [T])
🔬This is a nightly-only experimental API. (split_array)
Divides one mutable array reference into two at an index.
\nThe first will contain all indices from [0, M) (excluding\nthe index M itself) and the second will contain all\nindices from [M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet mut v = [1, 0, 3, 0, 5, 6];\nlet (left, right) = v.split_array_mut::<2>();\nassert_eq!(left, &mut [1, 0][..]);\nassert_eq!(right, &mut [3, 0, 5, 6]);\nleft[1] = 2;\nright[1] = 4;\nassert_eq!(v, [1, 2, 3, 4, 5, 6]);
\nsourcepub fn rsplit_array_ref<const M: usize>(&self) -> (&[T], &[T; M])
🔬This is a nightly-only experimental API. (split_array)
Divides one array reference into two at an index from the end.
\nThe first will contain all indices from [0, N - M) (excluding\nthe index N - M itself) and the second will contain all\nindices from [N - M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet v = [1, 2, 3, 4, 5, 6];\n\n{\n let (left, right) = v.rsplit_array_ref::<0>();\n assert_eq!(left, &[1, 2, 3, 4, 5, 6]);\n assert_eq!(right, &[]);\n}\n\n{\n let (left, right) = v.rsplit_array_ref::<2>();\n assert_eq!(left, &[1, 2, 3, 4]);\n assert_eq!(right, &[5, 6]);\n}\n\n{\n let (left, right) = v.rsplit_array_ref::<6>();\n assert_eq!(left, &[]);\n assert_eq!(right, &[1, 2, 3, 4, 5, 6]);\n}
\nsourcepub fn rsplit_array_mut<const M: usize>(&mut self) -> (&mut [T], &mut [T; M])
🔬This is a nightly-only experimental API. (split_array)
Divides one mutable array reference into two at an index from the end.
\nThe first will contain all indices from [0, N - M) (excluding\nthe index N - M itself) and the second will contain all\nindices from [N - M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet mut v = [1, 0, 3, 0, 5, 6];\nlet (left, right) = v.rsplit_array_mut::<4>();\nassert_eq!(left, &mut [1, 0]);\nassert_eq!(right, &mut [3, 0, 5, 6][..]);\nleft[1] = 2;\nright[1] = 4;\nassert_eq!(v, [1, 2, 3, 4, 5, 6]);
\n",0,"iroh_docs::sync::PeerIdBytes"],["source§impl<const N: usize> [u8; N]
sourcepub const fn as_ascii(&self) -> Option<&[AsciiChar; N]>
🔬This is a nightly-only experimental API. (ascii_char)
Converts this array of bytes into a array of ASCII characters,\nor returns None if any of the characters is non-ASCII.
\n§Examples
\n#![feature(ascii_char)]\n#![feature(const_option)]\n\nconst HEX_DIGITS: [std::ascii::Char; 16] =\n *b\"0123456789abcdef\".as_ascii().unwrap();\n\nassert_eq!(HEX_DIGITS[1].as_str(), \"1\");\nassert_eq!(HEX_DIGITS[10].as_str(), \"a\");
\nsourcepub const unsafe fn as_ascii_unchecked(&self) -> &[AsciiChar; N]
🔬This is a nightly-only experimental API. (ascii_char)
Converts this array of bytes into a array of ASCII characters,\nwithout checking whether they’re valid.
\n§Safety
\nEvery byte in the array must be in 0..=127, or else this is UB.
\n",0,"iroh_docs::sync::PeerIdBytes"],["§impl<T> Array for [T; 32]where\n T: Default,
§fn as_slice_mut(&mut self) -> &mut [T]
Gives a unique slice over the whole thing. Read more","Array","iroh_docs::sync::PeerIdBytes"],["","Array","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> AsBytes for [T; N]where\n T: AsBytes,
§fn write_to_prefix(&self, bytes: &mut [u8]) -> Option<()>
","AsBytes","iroh_docs::sync::PeerIdBytes"],["","AsBytes","iroh_docs::sync::PeerIdBytes"],["","AsMut<[T]>","iroh_docs::sync::PeerIdBytes"],["","AsRef<[T]>","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> BitView for [T; N]where\n T: BitStore,
Note that overly-large arrays may cause the conversions to fail.
\n§fn view_bits<O>(&self) -> &BitSlice<T, O>where\n O: BitOrder,
Views a memory region as an immutable bit-slice.§fn try_view_bits<O>(&self) -> Result<&BitSlice<T, O>, BitSpanError<T>>where\n O: BitOrder,
Attempts to view a memory region as an immutable bit-slice. Read more§fn view_bits_mut<O>(&mut self) -> &mut BitSlice<T, O>where\n O: BitOrder,
Views a memory region as a mutable bit-slice.§fn try_view_bits_mut<O>(\n &mut self\n) -> Result<&mut BitSlice<T, O>, BitSpanError<T>>where\n O: BitOrder,
Attempts to view a memory region as a mutable bit-slice. Read more","BitView","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> BitViewSized for [T; N]where\n T: BitStore,
§fn as_raw_slice(&self) -> &[<[T; N] as BitView>::Store]
Views the type as a slice of its elements.§fn as_raw_mut_slice(&mut self) -> &mut [<[T; N] as BitView>::Store]
Views the type as a mutable slice of its elements.§fn into_bitarray<O>(self) -> BitArray<Self, O>where\n O: BitOrder,
Wraps self in a BitArray.","BitViewSized","iroh_docs::sync::PeerIdBytes"],["","Borrow<[T]>","iroh_docs::sync::PeerIdBytes"],["1.4.0 · source§impl<T, const N: usize> BorrowMut<[T]> for [T; N]
source§fn borrow_mut(&mut self) -> &mut [T]
Mutably borrows from an owned value. Read more","BorrowMut<[T]>","iroh_docs::sync::PeerIdBytes"],["","Chain","iroh_docs::sync::PeerIdBytes"],["","Clone","iroh_docs::sync::PeerIdBytes"],["","Debug","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize> Decode for [u8; N]
Decodes a byte array from byte[n] as described in RFC4251 § 5:
\n\nA byte represents an arbitrary 8-bit value (octet). Fixed length\ndata is sometimes represented as an array of bytes, written\nbyte[n], where n is the number of bytes in the array.
\n
\n","Decode","iroh_docs::sync::PeerIdBytes"],["§impl<'a, T, const N: usize> DecodeValue<'a> for [T; N]where\n T: Decode<'a>,
§fn decode_value<R>(reader: &mut R, header: Header) -> Result<[T; N], Error>where\n R: Reader<'a>,
Attempt to decode this message using the provided [Reader].","DecodeValue<'a>","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["source§impl<'de, T> Deserialize<'de> for [T; 32]where\n T: Deserialize<'de>,
source§fn deserialize<D>(\n deserializer: D\n) -> Result<[T; 32], <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more","Deserialize<'de>","iroh_docs::sync::PeerIdBytes"],["source§impl<'de, const N: usize> Deserialize<'de> for [u8; N]
source§fn deserialize<D>(\n deserializer: D\n) -> Result<[u8; N], <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
","Deserialize<'de>","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize> Encode for [u8; N]
Encodes [u8; N] into byte[n] as described in RFC4251 § 5:
\n\nA byte represents an arbitrary 8-bit value (octet). Fixed length\ndata is sometimes represented as an array of bytes, written\nbyte[n], where n is the number of bytes in the array.
\n
\n§fn encoded_len(&self) -> Result<usize, Error>
Get the length of this type encoded in bytes, prior to Base64 encoding.§fn encode(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value using the provided [Writer].§fn encoded_len_prefixed(&self) -> Result<usize, Error>
Return the length of this type after encoding when prepended with a\nuint32 length prefix.§fn encode_prefixed(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value, first prepending a uint32 length prefix\nset to [Encode::encoded_len].","Encode","iroh_docs::sync::PeerIdBytes"],["","EncodeLabelSet","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> EncodeValue for [T; N]where\n T: Encode,
","EncodeValue","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["§impl<'a> FindToken<&'a u8> for [u8; 32]
§fn find_token(&self, token: &u8) -> bool
Returns true if self contains the token","FindToken<&'a u8>","iroh_docs::sync::PeerIdBytes"],["§impl FindToken<u8> for [u8; 32]
§fn find_token(&self, token: u8) -> bool
Returns true if self contains the token","FindToken","iroh_docs::sync::PeerIdBytes"],["","FixedTag","iroh_docs::sync::PeerIdBytes"],["","From<&Signature>","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["§impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>>> for [T; 32]
","From, B0>, B0>, B0>, B0>, B0>>>","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["","From>","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["source§impl From<NamespaceId> for [u8; 32]
source§fn from(value: NamespaceId) -> Self
Converts to this type from the input type.","From","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["","From>","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> FromBytes for [T; N]where\n T: FromBytes,
§fn slice_from_prefix(bytes: &[u8], count: usize) -> Option<(&[Self], &[u8])>where\n Self: Sized,
Interprets the prefix of the given bytes as a &[Self] with length\nequal to count without copying. Read more§fn slice_from_suffix(bytes: &[u8], count: usize) -> Option<(&[u8], &[Self])>where\n Self: Sized,
Interprets the suffix of the given bytes as a &[Self] with length\nequal to count without copying. Read more§fn read_from_prefix(bytes: &[u8]) -> Option<Self>where\n Self: Sized,
","FromBytes","iroh_docs::sync::PeerIdBytes"],["","FromHex","iroh_docs::sync::PeerIdBytes"],["","FromZeroes","iroh_docs::sync::PeerIdBytes"],["","Hash","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Hash for [T; N]where\n T: Hash,
The hash of an array is the same as that of the corresponding slice,\nas required by the Borrow implementation.
\n\nuse std::hash::BuildHasher;\n\nlet b = std::hash::RandomState::new();\nlet a: [u8; 3] = [0xa8, 0x3c, 0x09];\nlet s: &[u8] = &[0xa8, 0x3c, 0x09];\nassert_eq!(b.hash_one(a), b.hash_one(s));
\n","Hash","iroh_docs::sync::PeerIdBytes"],["","Index","iroh_docs::sync::PeerIdBytes"],["","IndexMut","iroh_docs::sync::PeerIdBytes"],["","InputLength","iroh_docs::sync::PeerIdBytes"],["1.53.0 · source§impl<T, const N: usize> IntoIterator for [T; N]
source§fn into_iter(self) -> <[T; N] as IntoIterator>::IntoIter
Creates a consuming iterator, that is, one that moves each value out of\nthe array (from start to end). The array cannot be used after calling\nthis unless T implements Copy, so the whole array is copied.
\nArrays have special behavior when calling .into_iter() prior to the\n2021 edition – see the array Editions section for more information.
\n","IntoIterator","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize> IntoResponse for [u8; N]
§fn into_response(self) -> Response<Body>
Create a response.","IntoResponse","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, const N: usize> Join for [Fut; N]where\n Fut: IntoFuture,
§type Output = [<Fut as IntoFuture>::Output; N]
The resulting output type.§type Future = Join<<Fut as IntoFuture>::IntoFuture, N>
The Future implementation returned by this method.","Join","iroh_docs::sync::PeerIdBytes"],["","Key","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> MaxSize for [T; N]where\n T: MaxSize,
§const POSTCARD_MAX_SIZE: usize = _
The maximum possible size that the serialization of this\ntype can have, in bytes.","MaxSize","iroh_docs::sync::PeerIdBytes"],["","Merge","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Ord for [T; N]where\n T: Ord,
Implements comparison of arrays lexicographically.
\n1.21.0 · source§fn max(self, other: Self) -> Selfwhere\n Self: Sized,
Compares and returns the maximum of two values. Read more","Ord","iroh_docs::sync::PeerIdBytes"],["","PartialEq<&[U]>","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, U, const N: usize> PartialEq<&mut [U]> for [T; N]where\n T: PartialEq<U>,
","PartialEq<&mut [U]>","iroh_docs::sync::PeerIdBytes"],["","PartialEq<[U]>","iroh_docs::sync::PeerIdBytes"],["","PartialEq<[U; N]>","iroh_docs::sync::PeerIdBytes"],["","PartialEq","iroh_docs::sync::PeerIdBytes"],["§impl<A, B, const N: usize, const M: usize> PartialEq<Vec<A, N>> for [B; M]where\n A: PartialEq<B>,
","PartialEq>","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> PartialOrd for [T; N]where\n T: PartialOrd,
Implements comparison of arrays lexicographically.
\nsource§fn le(&self, other: &[T; N]) -> bool
This method tests less than or equal to (for self and other) and is used by the <=\noperator. Read more","PartialOrd","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, const N: usize> Race for [Fut; N]where\n Fut: IntoFuture,
§type Output = <Fut as IntoFuture>::Output
The resulting output type.§type Future = Race<<Fut as IntoFuture>::IntoFuture, N>
Which kind of future are we turning this into?","Race","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, T, E, const N: usize> RaceOk for [Fut; N]where\n Fut: IntoFuture<Output = Result<T, E>>,
§type Future = RaceOk<<Fut as IntoFuture>::IntoFuture, T, E, N>
Which kind of future are we turning this into?","RaceOk","iroh_docs::sync::PeerIdBytes"],["","Schema","iroh_docs::sync::PeerIdBytes"],["source§impl<T> Serialize for [T; 32]where\n T: 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","iroh_docs::sync::PeerIdBytes"],["source§impl<const N: usize> Serialize for [u8; N]
source§fn serialize<S>(\n &self,\n serializer: S\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where\n S: Serializer,
","Serialize","iroh_docs::sync::PeerIdBytes"],["1.51.0 · source§impl<T, const N: usize> SlicePattern for [T; N]
","SlicePattern","iroh_docs::sync::PeerIdBytes"],["1.34.0 · source§impl<T, const N: usize> TryFrom<&[T]> for [T; N]where\n T: Copy,
Tries to create an array [T; N] by copying from a slice &[T]. Succeeds if\nslice.len() == N.
\n\nlet bytes: [u8; 3] = [1, 0, 2];\n\nlet bytes_head: [u8; 2] = <[u8; 2]>::try_from(&bytes[0..2]).unwrap();\nassert_eq!(1, u16::from_le_bytes(bytes_head));\n\nlet bytes_tail: [u8; 2] = bytes[1..3].try_into().unwrap();\nassert_eq!(512, u16::from_le_bytes(bytes_tail));
\n§type Error = TryFromSliceError
The type returned in the event of a conversion error.","TryFrom<&[T]>","iroh_docs::sync::PeerIdBytes"],["1.59.0 · source§impl<T, const N: usize> TryFrom<&mut [T]> for [T; N]where\n T: Copy,
Tries to create an array [T; N] by copying from a mutable slice &mut [T].\nSucceeds if slice.len() == N.
\n\nlet mut bytes: [u8; 3] = [1, 0, 2];\n\nlet bytes_head: [u8; 2] = <[u8; 2]>::try_from(&mut bytes[0..2]).unwrap();\nassert_eq!(1, u16::from_le_bytes(bytes_head));\n\nlet bytes_tail: [u8; 2] = (&mut bytes[1..3]).try_into().unwrap();\nassert_eq!(512, u16::from_le_bytes(bytes_tail));
\n§type Error = TryFromSliceError
The type returned in the event of a conversion error.","TryFrom<&mut [T]>","iroh_docs::sync::PeerIdBytes"],["§impl<T, A, const N: usize> TryFrom<Vec<T, A>> for [T; N]where\n A: Allocator,
§fn try_from(vec: Vec<T, A>) -> Result<[T; N], Vec<T, A>>
Gets the entire contents of the Vec<T> as an array,\nif its size exactly matches that of the requested array.
\n§Examples
\nassert_eq!(vec![1, 2, 3].try_into(), Ok([1, 2, 3]));\nassert_eq!(<Vec<i32>>::new().try_into(), Ok([]));
\nIf the length doesn’t match, the input comes back in Err:
\n\nlet r: Result<[i32; 4], _> = (0..10).collect::<Vec<_>>().try_into();\nassert_eq!(r, Err(vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9]));
\nIf you’re fine with just getting a prefix of the Vec<T>,\nyou can call .truncate(N) first.
\n\nlet mut v = String::from(\"hello world\").into_bytes();\nv.sort();\nv.truncate(2);\nlet [a, b]: [_; 2] = v.try_into().unwrap();\nassert_eq!(a, b' ');\nassert_eq!(b, b'd');
\n","TryFrom>","iroh_docs::sync::PeerIdBytes"],["1.48.0 · source§impl<T, A, const N: usize> TryFrom<Vec<T, A>> for [T; N]where\n A: Allocator,
source§fn try_from(vec: Vec<T, A>) -> Result<[T; N], Vec<T, A>>
Gets the entire contents of the Vec<T> as an array,\nif its size exactly matches that of the requested array.
\n§Examples
\nassert_eq!(vec![1, 2, 3].try_into(), Ok([1, 2, 3]));\nassert_eq!(<Vec<i32>>::new().try_into(), Ok([]));
\nIf the length doesn’t match, the input comes back in Err:
\n\nlet r: Result<[i32; 4], _> = (0..10).collect::<Vec<_>>().try_into();\nassert_eq!(r, Err(vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9]));
\nIf you’re fine with just getting a prefix of the Vec<T>,\nyou can call .truncate(N) first.
\n\nlet mut v = String::from(\"hello world\").into_bytes();\nv.sort();\nv.truncate(2);\nlet [a, b]: [_; 2] = v.try_into().unwrap();\nassert_eq!(a, b' ');\nassert_eq!(b, b'd');
\n","TryFrom>","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, T, E, const N: usize> TryJoin for [Fut; N]where\n Fut: IntoFuture<Output = Result<T, E>>,
§type Future = TryJoin<<Fut as IntoFuture>::IntoFuture, T, E, N>
Which kind of future are we turning this into?","TryJoin","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> Value for [T; N]where\n T: Value,
§type SelfType<'a> = [<T as Value>::SelfType<'a>; N]\nwhere\n [T; N]: 'a
SelfType<’a> must be the same type as Self with all lifetimes replaced with ’a§type AsBytes<'a> = Vec<u8>\nwhere\n [T; N]: 'a
§fn fixed_width() -> Option<usize>
Width of a fixed type, or None for variable width§fn from_bytes<'a>(data: &'a [u8]) -> [<T as Value>::SelfType<'a>; N]where\n [T; N]: 'a,
Deserializes data\nImplementations may return a view over data, or an owned type","Value","iroh_docs::sync::PeerIdBytes"],["","ValueOrd","iroh_docs::sync::PeerIdBytes"],["§impl<Z, const N: usize> Zeroize for [Z; N]where\n Z: Zeroize,
Impl [Zeroize] on arrays of types that impl [Zeroize].
\n","Zeroize","iroh_docs::sync::PeerIdBytes"],["","Zip","iroh_docs::sync::PeerIdBytes"],["source§impl<T, const N: usize> ConstParamTy for [T; N]where\n T: ConstParamTy,
","ConstParamTy","iroh_docs::sync::PeerIdBytes"],["1.58.0 · source§impl<T, const N: usize> Copy for [T; N]where\n T: Copy,
","Copy","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Eq for [T; N]where\n T: Eq,
","Eq","iroh_docs::sync::PeerIdBytes"],["source§impl<T, const N: usize> StructuralPartialEq for [T; N]
","StructuralPartialEq","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> Unaligned for [T; N]where\n T: Unaligned,
","Unaligned","iroh_docs::sync::PeerIdBytes"],["§impl<Z, const N: usize> ZeroizeOnDrop for [Z; N]where\n Z: ZeroizeOnDrop,
Impl [ZeroizeOnDrop] on arrays of types that impl [ZeroizeOnDrop].
\n","ZeroizeOnDrop","iroh_docs::sync::PeerIdBytes"]]
+"iroh_docs":[["source§impl<T, const N: usize> [T; N]
1.55.0 · sourcepub fn map<F, U>(self, f: F) -> [U; N]where\n F: FnMut(T) -> U,
Returns an array of the same size as self, with function f applied to each element\nin order.
\nIf you don’t necessarily need a new fixed-size array, consider using\nIterator::map instead.
\n§Note on performance and stack usage
\nUnfortunately, usages of this method are currently not always optimized\nas well as they could be. This mainly concerns large arrays, as mapping\nover small arrays seem to be optimized just fine. Also note that in\ndebug mode (i.e. without any optimizations), this method can use a lot\nof stack space (a few times the size of the array or more).
\nTherefore, in performance-critical code, try to avoid using this method\non large arrays or check the emitted code. Also try to avoid chained\nmaps (e.g. arr.map(...).map(...)).
\nIn many cases, you can instead use Iterator::map by calling .iter()\nor .into_iter() on your array. [T; N]::map is only necessary if you\nreally need a new array of the same size as the result. Rust’s lazy\niterators tend to get optimized very well.
\n§Examples
\nlet x = [1, 2, 3];\nlet y = x.map(|v| v + 1);\nassert_eq!(y, [2, 3, 4]);\n\nlet x = [1, 2, 3];\nlet mut temp = 0;\nlet y = x.map(|v| { temp += 1; v * temp });\nassert_eq!(y, [1, 4, 9]);\n\nlet x = [\"Ferris\", \"Bueller's\", \"Day\", \"Off\"];\nlet y = x.map(|v| v.len());\nassert_eq!(y, [6, 9, 3, 3]);
\nsourcepub fn try_map<F, R>(\n self,\n f: F\n) -> <<R as Try>::Residual as Residual<[<R as Try>::Output; N]>>::TryType
🔬This is a nightly-only experimental API. (array_try_map)
A fallible function f applied to each element on array self in order to\nreturn an array the same size as self or the first error encountered.
\nThe return type of this function depends on the return type of the closure.\nIf you return Result<T, E> from the closure, you’ll get a Result<[T; N], E>.\nIf you return Option<T> from the closure, you’ll get an Option<[T; N]>.
\n§Examples
\n#![feature(array_try_map)]\n\nlet a = [\"1\", \"2\", \"3\"];\nlet b = a.try_map(|v| v.parse::<u32>()).unwrap().map(|v| v + 1);\nassert_eq!(b, [2, 3, 4]);\n\nlet a = [\"1\", \"2a\", \"3\"];\nlet b = a.try_map(|v| v.parse::<u32>());\nassert!(b.is_err());\n\nuse std::num::NonZero;\n\nlet z = [1, 2, 0, 3, 4];\nassert_eq!(z.try_map(NonZero::new), None);\n\nlet a = [1, 2, 3];\nlet b = a.try_map(NonZero::new);\nlet c = b.map(|x| x.map(NonZero::get));\nassert_eq!(c, Some(a));
\n1.57.0 (const: 1.57.0) · sourcepub const fn as_slice(&self) -> &[T]
Returns a slice containing the entire array. Equivalent to &s[..].
\n1.57.0 · sourcepub fn as_mut_slice(&mut self) -> &mut [T]
Returns a mutable slice containing the entire array. Equivalent to\n&mut s[..].
\n1.77.0 · sourcepub fn each_ref(&self) -> [&T; N]
Borrows each element and returns an array of references with the same\nsize as self.
\n§Example
\nlet floats = [3.1, 2.7, -1.0];\nlet float_refs: [&f64; 3] = floats.each_ref();\nassert_eq!(float_refs, [&3.1, &2.7, &-1.0]);
\nThis method is particularly useful if combined with other methods, like\nmap. This way, you can avoid moving the original\narray if its elements are not Copy.
\n\nlet strings = [\"Ferris\".to_string(), \"♥\".to_string(), \"Rust\".to_string()];\nlet is_ascii = strings.each_ref().map(|s| s.is_ascii());\nassert_eq!(is_ascii, [true, false, true]);\n\n// We can still access the original array: it has not been moved.\nassert_eq!(strings.len(), 3);
\n1.77.0 · sourcepub fn each_mut(&mut self) -> [&mut T; N]
Borrows each element mutably and returns an array of mutable references\nwith the same size as self.
\n§Example
\n\nlet mut floats = [3.1, 2.7, -1.0];\nlet float_refs: [&mut f64; 3] = floats.each_mut();\n*float_refs[0] = 0.0;\nassert_eq!(float_refs, [&mut 0.0, &mut 2.7, &mut -1.0]);\nassert_eq!(floats, [0.0, 2.7, -1.0]);
\nsourcepub fn split_array_ref<const M: usize>(&self) -> (&[T; M], &[T])
🔬This is a nightly-only experimental API. (split_array)
Divides one array reference into two at an index.
\nThe first will contain all indices from [0, M) (excluding\nthe index M itself) and the second will contain all\nindices from [M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet v = [1, 2, 3, 4, 5, 6];\n\n{\n let (left, right) = v.split_array_ref::<0>();\n assert_eq!(left, &[]);\n assert_eq!(right, &[1, 2, 3, 4, 5, 6]);\n}\n\n{\n let (left, right) = v.split_array_ref::<2>();\n assert_eq!(left, &[1, 2]);\n assert_eq!(right, &[3, 4, 5, 6]);\n}\n\n{\n let (left, right) = v.split_array_ref::<6>();\n assert_eq!(left, &[1, 2, 3, 4, 5, 6]);\n assert_eq!(right, &[]);\n}
\nsourcepub fn split_array_mut<const M: usize>(&mut self) -> (&mut [T; M], &mut [T])
🔬This is a nightly-only experimental API. (split_array)
Divides one mutable array reference into two at an index.
\nThe first will contain all indices from [0, M) (excluding\nthe index M itself) and the second will contain all\nindices from [M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet mut v = [1, 0, 3, 0, 5, 6];\nlet (left, right) = v.split_array_mut::<2>();\nassert_eq!(left, &mut [1, 0][..]);\nassert_eq!(right, &mut [3, 0, 5, 6]);\nleft[1] = 2;\nright[1] = 4;\nassert_eq!(v, [1, 2, 3, 4, 5, 6]);
\nsourcepub fn rsplit_array_ref<const M: usize>(&self) -> (&[T], &[T; M])
🔬This is a nightly-only experimental API. (split_array)
Divides one array reference into two at an index from the end.
\nThe first will contain all indices from [0, N - M) (excluding\nthe index N - M itself) and the second will contain all\nindices from [N - M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet v = [1, 2, 3, 4, 5, 6];\n\n{\n let (left, right) = v.rsplit_array_ref::<0>();\n assert_eq!(left, &[1, 2, 3, 4, 5, 6]);\n assert_eq!(right, &[]);\n}\n\n{\n let (left, right) = v.rsplit_array_ref::<2>();\n assert_eq!(left, &[1, 2, 3, 4]);\n assert_eq!(right, &[5, 6]);\n}\n\n{\n let (left, right) = v.rsplit_array_ref::<6>();\n assert_eq!(left, &[]);\n assert_eq!(right, &[1, 2, 3, 4, 5, 6]);\n}
\nsourcepub fn rsplit_array_mut<const M: usize>(&mut self) -> (&mut [T], &mut [T; M])
🔬This is a nightly-only experimental API. (split_array)
Divides one mutable array reference into two at an index from the end.
\nThe first will contain all indices from [0, N - M) (excluding\nthe index N - M itself) and the second will contain all\nindices from [N - M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet mut v = [1, 0, 3, 0, 5, 6];\nlet (left, right) = v.rsplit_array_mut::<4>();\nassert_eq!(left, &mut [1, 0]);\nassert_eq!(right, &mut [3, 0, 5, 6][..]);\nleft[1] = 2;\nright[1] = 4;\nassert_eq!(v, [1, 2, 3, 4, 5, 6]);
\n",0,"iroh_docs::sync::PeerIdBytes"],["source§impl<const N: usize> [u8; N]
sourcepub const fn as_ascii(&self) -> Option<&[AsciiChar; N]>
🔬This is a nightly-only experimental API. (ascii_char)
Converts this array of bytes into a array of ASCII characters,\nor returns None if any of the characters is non-ASCII.
\n§Examples
\n#![feature(ascii_char)]\n#![feature(const_option)]\n\nconst HEX_DIGITS: [std::ascii::Char; 16] =\n *b\"0123456789abcdef\".as_ascii().unwrap();\n\nassert_eq!(HEX_DIGITS[1].as_str(), \"1\");\nassert_eq!(HEX_DIGITS[10].as_str(), \"a\");
\nsourcepub const unsafe fn as_ascii_unchecked(&self) -> &[AsciiChar; N]
🔬This is a nightly-only experimental API. (ascii_char)
Converts this array of bytes into a array of ASCII characters,\nwithout checking whether they’re valid.
\n§Safety
\nEvery byte in the array must be in 0..=127, or else this is UB.
\n",0,"iroh_docs::sync::PeerIdBytes"],["§impl<T> Array for [T; 32]where\n T: Default,
§fn as_slice_mut(&mut self) -> &mut [T]
Gives a unique slice over the whole thing. Read more","Array","iroh_docs::sync::PeerIdBytes"],["","Array","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> AsBytes for [T; N]where\n T: AsBytes,
§fn write_to_prefix(&self, bytes: &mut [u8]) -> Option<()>
","AsBytes","iroh_docs::sync::PeerIdBytes"],["","AsBytes","iroh_docs::sync::PeerIdBytes"],["","AsMut<[T]>","iroh_docs::sync::PeerIdBytes"],["","AsRef<[T]>","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> BitView for [T; N]where\n T: BitStore,
Note that overly-large arrays may cause the conversions to fail.
\n§fn view_bits<O>(&self) -> &BitSlice<T, O>where\n O: BitOrder,
Views a memory region as an immutable bit-slice.§fn try_view_bits<O>(&self) -> Result<&BitSlice<T, O>, BitSpanError<T>>where\n O: BitOrder,
Attempts to view a memory region as an immutable bit-slice. Read more§fn view_bits_mut<O>(&mut self) -> &mut BitSlice<T, O>where\n O: BitOrder,
Views a memory region as a mutable bit-slice.§fn try_view_bits_mut<O>(\n &mut self\n) -> Result<&mut BitSlice<T, O>, BitSpanError<T>>where\n O: BitOrder,
Attempts to view a memory region as a mutable bit-slice. Read more","BitView","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> BitViewSized for [T; N]where\n T: BitStore,
§fn as_raw_slice(&self) -> &[<[T; N] as BitView>::Store]
Views the type as a slice of its elements.§fn as_raw_mut_slice(&mut self) -> &mut [<[T; N] as BitView>::Store]
Views the type as a mutable slice of its elements.§fn into_bitarray<O>(self) -> BitArray<Self, O>where\n O: BitOrder,
Wraps self in a BitArray.","BitViewSized","iroh_docs::sync::PeerIdBytes"],["","Borrow<[T]>","iroh_docs::sync::PeerIdBytes"],["1.4.0 · source§impl<T, const N: usize> BorrowMut<[T]> for [T; N]
source§fn borrow_mut(&mut self) -> &mut [T]
Mutably borrows from an owned value. Read more","BorrowMut<[T]>","iroh_docs::sync::PeerIdBytes"],["","Chain","iroh_docs::sync::PeerIdBytes"],["","Clone","iroh_docs::sync::PeerIdBytes"],["","Debug","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize> Decode for [u8; N]
Decodes a byte array from byte[n] as described in RFC4251 § 5:
\n\nA byte represents an arbitrary 8-bit value (octet). Fixed length\ndata is sometimes represented as an array of bytes, written\nbyte[n], where n is the number of bytes in the array.
\n
\n","Decode","iroh_docs::sync::PeerIdBytes"],["§impl<'a, T, const N: usize> DecodeValue<'a> for [T; N]where\n T: Decode<'a>,
§fn decode_value<R>(reader: &mut R, header: Header) -> Result<[T; N], Error>where\n R: Reader<'a>,
Attempt to decode this message using the provided [Reader].","DecodeValue<'a>","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["source§impl<'de, T> Deserialize<'de> for [T; 32]where\n T: Deserialize<'de>,
source§fn deserialize<D>(\n deserializer: D\n) -> Result<[T; 32], <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more","Deserialize<'de>","iroh_docs::sync::PeerIdBytes"],["source§impl<'de, const N: usize> Deserialize<'de> for [u8; N]
source§fn deserialize<D>(\n deserializer: D\n) -> Result<[u8; N], <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
","Deserialize<'de>","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize> Encode for [u8; N]
Encodes [u8; N] into byte[n] as described in RFC4251 § 5:
\n\nA byte represents an arbitrary 8-bit value (octet). Fixed length\ndata is sometimes represented as an array of bytes, written\nbyte[n], where n is the number of bytes in the array.
\n
\n§fn encoded_len(&self) -> Result<usize, Error>
Get the length of this type encoded in bytes, prior to Base64 encoding.§fn encode(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value using the provided [Writer].§fn encoded_len_prefixed(&self) -> Result<usize, Error>
Return the length of this type after encoding when prepended with a\nuint32 length prefix.§fn encode_prefixed(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value, first prepending a uint32 length prefix\nset to [Encode::encoded_len].","Encode","iroh_docs::sync::PeerIdBytes"],["","EncodeLabelSet","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> EncodeValue for [T; N]where\n T: Encode,
","EncodeValue","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["§impl<'a> FindToken<&'a u8> for [u8; 32]
§fn find_token(&self, token: &u8) -> bool
Returns true if self contains the token","FindToken<&'a u8>","iroh_docs::sync::PeerIdBytes"],["§impl FindToken<u8> for [u8; 32]
§fn find_token(&self, token: u8) -> bool
Returns true if self contains the token","FindToken","iroh_docs::sync::PeerIdBytes"],["","FixedTag","iroh_docs::sync::PeerIdBytes"],["","From<&Signature>","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["§impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>>> for [T; 32]
","From, B0>, B0>, B0>, B0>, B0>>>","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["","From>","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["source§impl From<NamespaceId> for [u8; 32]
source§fn from(value: NamespaceId) -> Self
Converts to this type from the input type.","From","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["","From>","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> FromBytes for [T; N]where\n T: FromBytes,
§fn slice_from_prefix(bytes: &[u8], count: usize) -> Option<(&[Self], &[u8])>where\n Self: Sized,
Interprets the prefix of the given bytes as a &[Self] with length\nequal to count without copying. Read more§fn slice_from_suffix(bytes: &[u8], count: usize) -> Option<(&[u8], &[Self])>where\n Self: Sized,
Interprets the suffix of the given bytes as a &[Self] with length\nequal to count without copying. Read more§fn read_from_prefix(bytes: &[u8]) -> Option<Self>where\n Self: Sized,
","FromBytes","iroh_docs::sync::PeerIdBytes"],["","FromHex","iroh_docs::sync::PeerIdBytes"],["","FromZeroes","iroh_docs::sync::PeerIdBytes"],["","Hash","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Hash for [T; N]where\n T: Hash,
The hash of an array is the same as that of the corresponding slice,\nas required by the Borrow implementation.
\n\nuse std::hash::BuildHasher;\n\nlet b = std::hash::RandomState::new();\nlet a: [u8; 3] = [0xa8, 0x3c, 0x09];\nlet s: &[u8] = &[0xa8, 0x3c, 0x09];\nassert_eq!(b.hash_one(a), b.hash_one(s));
\n","Hash","iroh_docs::sync::PeerIdBytes"],["","Index","iroh_docs::sync::PeerIdBytes"],["","IndexMut","iroh_docs::sync::PeerIdBytes"],["","InputLength","iroh_docs::sync::PeerIdBytes"],["1.53.0 · source§impl<T, const N: usize> IntoIterator for [T; N]
source§fn into_iter(self) -> <[T; N] as IntoIterator>::IntoIter
Creates a consuming iterator, that is, one that moves each value out of\nthe array (from start to end). The array cannot be used after calling\nthis unless T implements Copy, so the whole array is copied.
\nArrays have special behavior when calling .into_iter() prior to the\n2021 edition – see the array Editions section for more information.
\n","IntoIterator","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize> IntoResponse for [u8; N]
§fn into_response(self) -> Response<Body>
Create a response.","IntoResponse","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, const N: usize> Join for [Fut; N]where\n Fut: IntoFuture,
§type Output = [<Fut as IntoFuture>::Output; N]
The resulting output type.§type Future = Join<<Fut as IntoFuture>::IntoFuture, N>
The Future implementation returned by this method.","Join","iroh_docs::sync::PeerIdBytes"],["","Key","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> MaxSize for [T; N]where\n T: MaxSize,
§const POSTCARD_MAX_SIZE: usize = _
The maximum possible size that the serialization of this\ntype can have, in bytes.","MaxSize","iroh_docs::sync::PeerIdBytes"],["","Merge","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Ord for [T; N]where\n T: Ord,
Implements comparison of arrays lexicographically.
\n1.21.0 · source§fn max(self, other: Self) -> Selfwhere\n Self: Sized,
Compares and returns the maximum of two values. Read more","Ord","iroh_docs::sync::PeerIdBytes"],["","PartialEq<&[U]>","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, U, const N: usize> PartialEq<&mut [U]> for [T; N]where\n T: PartialEq<U>,
","PartialEq<&mut [U]>","iroh_docs::sync::PeerIdBytes"],["","PartialEq<[U]>","iroh_docs::sync::PeerIdBytes"],["","PartialEq<[U; N]>","iroh_docs::sync::PeerIdBytes"],["","PartialEq","iroh_docs::sync::PeerIdBytes"],["§impl<A, B, const N: usize, const M: usize> PartialEq<Vec<A, N>> for [B; M]where\n A: PartialEq<B>,
","PartialEq>","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> PartialOrd for [T; N]where\n T: PartialOrd,
Implements comparison of arrays lexicographically.
\nsource§fn le(&self, other: &[T; N]) -> bool
This method tests less than or equal to (for self and other) and is used by the <=\noperator. Read more","PartialOrd","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, const N: usize> Race for [Fut; N]where\n Fut: IntoFuture,
§type Output = <Fut as IntoFuture>::Output
The resulting output type.§type Future = Race<<Fut as IntoFuture>::IntoFuture, N>
Which kind of future are we turning this into?","Race","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, T, E, const N: usize> RaceOk for [Fut; N]where\n Fut: IntoFuture<Output = Result<T, E>>,
§type Future = RaceOk<<Fut as IntoFuture>::IntoFuture, T, E, N>
Which kind of future are we turning this into?","RaceOk","iroh_docs::sync::PeerIdBytes"],["","Schema","iroh_docs::sync::PeerIdBytes"],["source§impl<T> Serialize for [T; 32]where\n T: 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","iroh_docs::sync::PeerIdBytes"],["source§impl<const N: usize> Serialize for [u8; N]
source§fn serialize<S>(\n &self,\n serializer: S\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where\n S: Serializer,
","Serialize","iroh_docs::sync::PeerIdBytes"],["1.51.0 · source§impl<T, const N: usize> SlicePattern for [T; N]
","SlicePattern","iroh_docs::sync::PeerIdBytes"],["1.34.0 · source§impl<T, const N: usize> TryFrom<&[T]> for [T; N]where\n T: Copy,
Tries to create an array [T; N] by copying from a slice &[T]. Succeeds if\nslice.len() == N.
\n\nlet bytes: [u8; 3] = [1, 0, 2];\n\nlet bytes_head: [u8; 2] = <[u8; 2]>::try_from(&bytes[0..2]).unwrap();\nassert_eq!(1, u16::from_le_bytes(bytes_head));\n\nlet bytes_tail: [u8; 2] = bytes[1..3].try_into().unwrap();\nassert_eq!(512, u16::from_le_bytes(bytes_tail));
\n§type Error = TryFromSliceError
The type returned in the event of a conversion error.","TryFrom<&[T]>","iroh_docs::sync::PeerIdBytes"],["1.59.0 · source§impl<T, const N: usize> TryFrom<&mut [T]> for [T; N]where\n T: Copy,
Tries to create an array [T; N] by copying from a mutable slice &mut [T].\nSucceeds if slice.len() == N.
\n\nlet mut bytes: [u8; 3] = [1, 0, 2];\n\nlet bytes_head: [u8; 2] = <[u8; 2]>::try_from(&mut bytes[0..2]).unwrap();\nassert_eq!(1, u16::from_le_bytes(bytes_head));\n\nlet bytes_tail: [u8; 2] = (&mut bytes[1..3]).try_into().unwrap();\nassert_eq!(512, u16::from_le_bytes(bytes_tail));
\n§type Error = TryFromSliceError
The type returned in the event of a conversion error.","TryFrom<&mut [T]>","iroh_docs::sync::PeerIdBytes"],["§impl<T, A, const N: usize> TryFrom<Vec<T, A>> for [T; N]where\n A: Allocator,
§fn try_from(vec: Vec<T, A>) -> Result<[T; N], Vec<T, A>>
Gets the entire contents of the Vec<T> as an array,\nif its size exactly matches that of the requested array.
\n§Examples
\nassert_eq!(vec![1, 2, 3].try_into(), Ok([1, 2, 3]));\nassert_eq!(<Vec<i32>>::new().try_into(), Ok([]));
\nIf the length doesn’t match, the input comes back in Err:
\n\nlet r: Result<[i32; 4], _> = (0..10).collect::<Vec<_>>().try_into();\nassert_eq!(r, Err(vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9]));
\nIf you’re fine with just getting a prefix of the Vec<T>,\nyou can call .truncate(N) first.
\n\nlet mut v = String::from(\"hello world\").into_bytes();\nv.sort();\nv.truncate(2);\nlet [a, b]: [_; 2] = v.try_into().unwrap();\nassert_eq!(a, b' ');\nassert_eq!(b, b'd');
\n","TryFrom>","iroh_docs::sync::PeerIdBytes"],["1.48.0 · source§impl<T, A, const N: usize> TryFrom<Vec<T, A>> for [T; N]where\n A: Allocator,
source§fn try_from(vec: Vec<T, A>) -> Result<[T; N], Vec<T, A>>
Gets the entire contents of the Vec<T> as an array,\nif its size exactly matches that of the requested array.
\n§Examples
\nassert_eq!(vec![1, 2, 3].try_into(), Ok([1, 2, 3]));\nassert_eq!(<Vec<i32>>::new().try_into(), Ok([]));
\nIf the length doesn’t match, the input comes back in Err:
\n\nlet r: Result<[i32; 4], _> = (0..10).collect::<Vec<_>>().try_into();\nassert_eq!(r, Err(vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9]));
\nIf you’re fine with just getting a prefix of the Vec<T>,\nyou can call .truncate(N) first.
\n\nlet mut v = String::from(\"hello world\").into_bytes();\nv.sort();\nv.truncate(2);\nlet [a, b]: [_; 2] = v.try_into().unwrap();\nassert_eq!(a, b' ');\nassert_eq!(b, b'd');
\n","TryFrom>","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, T, E, const N: usize> TryJoin for [Fut; N]where\n Fut: IntoFuture<Output = Result<T, E>>,
§type Future = TryJoin<<Fut as IntoFuture>::IntoFuture, T, E, N>
Which kind of future are we turning this into?","TryJoin","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> Value for [T; N]where\n T: Value,
§type SelfType<'a> = [<T as Value>::SelfType<'a>; N]\nwhere\n [T; N]: 'a
SelfType<’a> must be the same type as Self with all lifetimes replaced with ’a§type AsBytes<'a> = Vec<u8>\nwhere\n [T; N]: 'a
§fn fixed_width() -> Option<usize>
Width of a fixed type, or None for variable width§fn from_bytes<'a>(data: &'a [u8]) -> [<T as Value>::SelfType<'a>; N]where\n [T; N]: 'a,
Deserializes data\nImplementations may return a view over data, or an owned type","Value","iroh_docs::sync::PeerIdBytes"],["","ValueOrd","iroh_docs::sync::PeerIdBytes"],["§impl<Z, const N: usize> Zeroize for [Z; N]where\n Z: Zeroize,
Impl [Zeroize] on arrays of types that impl [Zeroize].
\n","Zeroize","iroh_docs::sync::PeerIdBytes"],["","Zip","iroh_docs::sync::PeerIdBytes"],["source§impl<T, const N: usize> ConstParamTy for [T; N]where\n T: ConstParamTy,
","ConstParamTy","iroh_docs::sync::PeerIdBytes"],["1.58.0 · source§impl<T, const N: usize> Copy for [T; N]where\n T: Copy,
","Copy","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Eq for [T; N]where\n T: Eq,
","Eq","iroh_docs::sync::PeerIdBytes"],["source§impl<T, const N: usize> StructuralPartialEq for [T; N]
","StructuralPartialEq","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> Unaligned for [T; N]where\n T: Unaligned,
","Unaligned","iroh_docs::sync::PeerIdBytes"],["§impl<Z, const N: usize> ZeroizeOnDrop for [Z; N]where\n Z: ZeroizeOnDrop,
Impl [ZeroizeOnDrop] on arrays of types that impl [ZeroizeOnDrop].
\n","ZeroizeOnDrop","iroh_docs::sync::PeerIdBytes"]]
};if (window.register_type_impls) {window.register_type_impls(type_impls);} else {window.pending_type_impls = type_impls;}})()
\ No newline at end of file
pub async fn delete_prefix(
&self,
diff --git a/pr/2595/docs/iroh_docs/engine/enum.LiveEvent.html b/pr/2595/docs/iroh_docs/engine/enum.LiveEvent.html
index ceb8545b50..f0d33bcb21 100644
--- a/pr/2595/docs/iroh_docs/engine/enum.LiveEvent.html
+++ b/pr/2595/docs/iroh_docs/engine/enum.LiveEvent.html
@@ -3,34 +3,34 @@
entry: Entry,
},
InsertRemote {
- from: PublicKey,
+ from: PublicKey,
entry: Entry,
content_status: ContentStatus,
},
ContentReady {
- hash: Hash,
+ hash: Hash,
},
PendingContentReady,
- NeighborUp(PublicKey),
- NeighborDown(PublicKey),
+ NeighborUp(PublicKey),
+ NeighborDown(PublicKey),
SyncFinished(SyncEvent),
}Expand description
Events informing about actions of the live sync progress.
Variants§
§InsertLocal
A local insertion.
§InsertRemote
Received a remote insert.
-Fields
§from: PublicKeyThe peer that sent us the entry.
+Fields
§content_status: ContentStatusIf the content is available at the local node
§ContentReady
The content of an entry was downloaded and is now available at the local node
-Fields
§hash: HashThe content hash of the newly available entry content
+§PendingContentReady
All pending content is now ready.
This event signals that all queued content downloads from the last sync run have either
completed or failed.
It will only be emitted after a Self::SyncFinished event, never before.
Receiving this event does not guarantee that all content in the document is available. If
blobs failed to download, this event will still be emitted after all operations completed.
-§NeighborUp(PublicKey)
We have a new neighbor in the swarm.
-§NeighborDown(PublicKey)
We lost a neighbor in the swarm.
+§NeighborUp(PublicKey)
We have a new neighbor in the swarm.
+§NeighborDown(PublicKey)
We lost a neighbor in the swarm.
§SyncFinished(SyncEvent)
A set-reconciliation sync finished.
Trait Implementations§
source§impl<'de> Deserialize<'de> for LiveEvent
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl PartialEq for LiveEvent
source§fn eq(&self, other: &LiveEvent) -> bool
This method tests for self and other values to be equal, and is used
diff --git a/pr/2595/docs/iroh_docs/engine/fn.entry_to_content_status.html b/pr/2595/docs/iroh_docs/engine/fn.entry_to_content_status.html
index 459a6719d2..3b39df6428 100644
--- a/pr/2595/docs/iroh_docs/engine/fn.entry_to_content_status.html
+++ b/pr/2595/docs/iroh_docs/engine/fn.entry_to_content_status.html
@@ -1,2 +1,2 @@
-entry_to_content_status in iroh_docs::engine - Rust Function iroh_docs::engine::entry_to_content_status
source · pub fn entry_to_content_status(entry: Result<EntryStatus>) -> ContentStatus
Expand description
Converts an [EntryStatus] into a [‘ContentStatus’].
+entry_to_content_status in iroh_docs::engine - Rust Function iroh_docs::engine::entry_to_content_status
source · pub fn entry_to_content_status(entry: Result<EntryStatus>) -> ContentStatus
Expand description
Converts an EntryStatus into a [‘ContentStatus’].
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_docs/engine/index.html b/pr/2595/docs/iroh_docs/engine/index.html
index 5f78e23386..622ab4b871 100644
--- a/pr/2595/docs/iroh_docs/engine/index.html
+++ b/pr/2595/docs/iroh_docs/engine/index.html
@@ -1,4 +1,4 @@
iroh_docs::engine - Rust Expand description
Handlers and actors to for live syncing replicas.
crate::Replica is also called documents here.
Structs§
- Persistent default author for a docs engine.
- The sync engine coordinates actors that manage open documents, set-reconciliation syncs with
-peers and a gossip swarm for each syncing document.
- Event emitted when a sync operation completes
Enums§
- Where to persist the default author.
- Events informing about actions of the live sync progress.
- Why we performed a sync exchange
- Why we started a sync request
Functions§
- Converts an [
EntryStatus] into a [‘ContentStatus’].
\ No newline at end of file
+peers and a gossip swarm for each syncing document.Event emitted when a sync operation completes Enums§
- Where to persist the default author.
- Events informing about actions of the live sync progress.
- Why we performed a sync exchange
- Why we started a sync request
Functions§
- Converts an
EntryStatus into a [‘ContentStatus’].
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_docs/engine/struct.Engine.html b/pr/2595/docs/iroh_docs/engine/struct.Engine.html
index 1b88a96726..46cd25179e 100644
--- a/pr/2595/docs/iroh_docs/engine/struct.Engine.html
+++ b/pr/2595/docs/iroh_docs/engine/struct.Engine.html
@@ -8,12 +8,12 @@ peers and a gossip swarm for each syncing document.
Fields§
§endpoint: EndpointEndpoint used by the engine.
§sync: SyncHandleHandle to the actor thread.
The persistent default author for this engine.
-Implementations§
source§impl Engine
Implementations§
source§impl Engine
sourcepub async fn spawn<B: Store>(
endpoint: Endpoint,
- gossip: Gossip,
+ gossip: Gossip,
replica_store: Store,
bao_store: B,
- downloader: Downloader,
+ downloader: Downloader,
default_author_storage: DefaultAuthorStorage
) -> Result<Self>
Start the sync engine.
This will spawn two tokio tasks for the live sync coordination and gossip actors, and a
@@ -21,7 +21,7 @@ thread for the sourcepub async fn start_sync(
&self,
namespace: NamespaceId,
- peers: Vec<NodeAddr>
+ peers: Vec<NodeAddr>
) -> Result<()>
Start to sync a document.
If peers is non-empty, it will both do an initial set-reconciliation sync with each peer,
and join an iroh-gossip swarm with these peers to receive and broadcast document updates.
diff --git a/pr/2595/docs/iroh_docs/engine/struct.SyncEvent.html b/pr/2595/docs/iroh_docs/engine/struct.SyncEvent.html
index 49ba954022..d7eb730d81 100644
--- a/pr/2595/docs/iroh_docs/engine/struct.SyncEvent.html
+++ b/pr/2595/docs/iroh_docs/engine/struct.SyncEvent.html
@@ -1,11 +1,11 @@
SyncEvent in iroh_docs::engine - Rust pub struct SyncEvent {
- pub peer: PublicKey,
+ pub peer: PublicKey,
pub origin: Origin,
pub finished: SystemTime,
pub started: SystemTime,
pub result: Result<SyncDetails, String>,
}
Expand description
Event emitted when a sync operation completes
-Fields§
§peer: PublicKeyPeer we synced with
+Fields§
§peer: PublicKeyPeer we synced with
§origin: OriginOrigin of the sync exchange
§finished: SystemTimeTimestamp when the sync started
§started: SystemTimeTimestamp when the sync finished
diff --git a/pr/2595/docs/iroh_docs/index.html b/pr/2595/docs/iroh_docs/index.html
index a37d30e2a6..41c792c5e5 100644
--- a/pr/2595/docs/iroh_docs/index.html
+++ b/pr/2595/docs/iroh_docs/index.html
@@ -1,7 +1,7 @@
iroh_docs - Rust Expand description
Multi-dimensional key-value documents with an efficient synchronization protocol
The crate operates on Replicas. A replica contains an unlimited number of
Entries. Each entry is identified by a key, its author, and the replica’s
-namespace. Its value is the 32-byte BLAKE3 hash
+namespace. Its value is the 32-byte BLAKE3 hash
of the entry’s content data, the size of this content data, and a timestamp.
The content data itself is not stored or transferred through a replica.
All entries in a replica are signed with two keypairs:
diff --git a/pr/2595/docs/iroh_docs/net/enum.AcceptError.html b/pr/2595/docs/iroh_docs/net/enum.AcceptError.html
index 87e9a07ad3..cf11b5b695 100644
--- a/pr/2595/docs/iroh_docs/net/enum.AcceptError.html
+++ b/pr/2595/docs/iroh_docs/net/enum.AcceptError.html
@@ -3,31 +3,31 @@
error: Error,
},
Open {
- peer: PublicKey,
+ peer: PublicKey,
error: Error,
},
Abort {
- peer: PublicKey,
+ peer: PublicKey,
namespace: NamespaceId,
reason: AbortReason,
},
Sync {
- peer: PublicKey,
+ peer: PublicKey,
namespace: Option<NamespaceId>,
error: Error,
},
Close {
- peer: PublicKey,
+ peer: PublicKey,
namespace: Option<NamespaceId>,
error: Error,
},
}Expand description
Errors that may occur on handling incoming sync connections.
Variants§
§Connect
Failed to establish connection
§Open
Failed to open replica
-§Abort
We aborted the sync request.
-§Sync
Failed to run sync
-§Close
Failed to close
-Implementations§
source§impl AcceptError
Implementations§
Trait Implementations§
source§impl Debug for AcceptError
source§impl Display for AcceptError
source§impl Error for AcceptError
source§fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more1.0.0 · source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()Auto Trait Implementations§
§impl Freeze for AcceptError
§impl RefUnwindSafe for AcceptError
§impl Send for AcceptError
§impl Sync for AcceptError
§impl Unpin for AcceptError
§impl UnwindSafe for AcceptError
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
diff --git a/pr/2595/docs/iroh_docs/net/fn.connect_and_sync.html b/pr/2595/docs/iroh_docs/net/fn.connect_and_sync.html
index 1ee6909d53..7bec313309 100644
--- a/pr/2595/docs/iroh_docs/net/fn.connect_and_sync.html
+++ b/pr/2595/docs/iroh_docs/net/fn.connect_and_sync.html
@@ -2,6 +2,6 @@
endpoint: &Endpoint,
sync: &SyncHandle,
namespace: NamespaceId,
- peer: NodeAddr
+ peer: NodeAddr
) -> Result<SyncFinished, ConnectError>Expand description
Connect to a peer and sync a replica
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_docs/net/fn.handle_connection.html b/pr/2595/docs/iroh_docs/net/fn.handle_connection.html
index 347a0c22bf..e96816b362 100644
--- a/pr/2595/docs/iroh_docs/net/fn.handle_connection.html
+++ b/pr/2595/docs/iroh_docs/net/fn.handle_connection.html
@@ -3,6 +3,6 @@
connecting: Connecting,
accept_cb: F
) -> Result<SyncFinished, AcceptError>where
- F: Fn(NamespaceId, PublicKey) -> Fut,
+ F: Fn(NamespaceId, PublicKey) -> Fut,
Fut: Future<Output = AcceptOutcome>,Expand description
Handle an iroh-docs connection and sync all shared documents in the replica store.
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_docs/net/struct.SyncFinished.html b/pr/2595/docs/iroh_docs/net/struct.SyncFinished.html
index 74ab2f6632..dcd549e6fc 100644
--- a/pr/2595/docs/iroh_docs/net/struct.SyncFinished.html
+++ b/pr/2595/docs/iroh_docs/net/struct.SyncFinished.html
@@ -1,11 +1,11 @@
SyncFinished in iroh_docs::net - Rust Struct iroh_docs::net::SyncFinished
source · pub struct SyncFinished {
pub namespace: NamespaceId,
- pub peer: PublicKey,
+ pub peer: PublicKey,
pub outcome: SyncOutcome,
pub timings: Timings,
}
Expand description
Details of a finished sync operation.
Fields§
§namespace: NamespaceIdThe namespace that was synced.
-§peer: PublicKeyThe peer we syned with.
+§peer: PublicKeyThe peer we syned with.
§outcome: SyncOutcomeThe outcome of the sync operation
§timings: TimingsThe time this operation took
Trait Implementations§
source§impl Clone for SyncFinished
source§fn clone(&self) -> SyncFinished
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moreAuto Trait Implementations§
§impl Freeze for SyncFinished
§impl RefUnwindSafe for SyncFinished
§impl Send for SyncFinished
§impl Sync for SyncFinished
§impl Unpin for SyncFinished
§impl UnwindSafe for SyncFinished
Blanket Implementations§
source§impl<T> Any for Twhere
diff --git a/pr/2595/docs/iroh_docs/store/fs/struct.ContentHashesIterator.html b/pr/2595/docs/iroh_docs/store/fs/struct.ContentHashesIterator.html
index 8bebf68ec6..df1fc8865f 100644
--- a/pr/2595/docs/iroh_docs/store/fs/struct.ContentHashesIterator.html
+++ b/pr/2595/docs/iroh_docs/store/fs/struct.ContentHashesIterator.html
@@ -6,7 +6,7 @@ It needs a copy of a redb::ReadOnlyTable to be self-contained.
Implementations§
Trait Implementations§
source§impl Debug for ContentHashesIterator
Trait Implementations§
source§impl Debug for ContentHashesIterator
source§impl Iterator for ContentHashesIterator
source§fn next(&mut self) -> Option<Self::Item>
Advances the iterator and returns the next value. Read moresource§fn next_chunk<const N: usize>(
&mut self
) -> Result<[Self::Item; N], IntoIter<Self::Item, N>>where
Self: Sized,
🔬This is a nightly-only experimental API. (iter_next_chunk)Advances the iterator and returns an array containing the next N values. Read more1.0.0 · source§fn size_hint(&self) -> (usize, Option<usize>)
Returns the bounds on the remaining length of the iterator. Read more1.0.0 · source§fn count(self) -> usizewhere
diff --git a/pr/2595/docs/iroh_docs/struct.AuthorId.html b/pr/2595/docs/iroh_docs/struct.AuthorId.html
index 7dfa3dea5b..02221b0eb6 100644
--- a/pr/2595/docs/iroh_docs/struct.AuthorId.html
+++ b/pr/2595/docs/iroh_docs/struct.AuthorId.html
@@ -156,6 +156,6 @@ letters are used (e.g. F9B4CA)
Into<Dispatch>, source§fn with_current_subscriber(self) -> WithDispatch<Self>
source§impl<T> DeserializeOwned for Twhere
- T: for<'de> Deserialize<'de>,
§impl<T> PeerIdentity for Twhere
+ T: for<'de> Deserialize<'de>,
source§impl<T> PeerIdentity for T
source§impl<T> RuleType for T
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_docs/struct.AuthorPublicKey.html b/pr/2595/docs/iroh_docs/struct.AuthorPublicKey.html
index 8e72b11c8a..7a83ce68e4 100644
--- a/pr/2595/docs/iroh_docs/struct.AuthorPublicKey.html
+++ b/pr/2595/docs/iroh_docs/struct.AuthorPublicKey.html
@@ -148,6 +148,6 @@ builds. Into<Dispatch>,source§fn with_current_subscriber(self) -> WithDispatch<Self>
source§impl<T> DeserializeOwned for Twhere
- T: for<'de> Deserialize<'de>,
§impl<T> PeerIdentity for Twhere
+ T: for<'de> Deserialize<'de>,
source§impl<T> PeerIdentity for T
source§impl<T> RuleType for T
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_docs/struct.DocTicket.html b/pr/2595/docs/iroh_docs/struct.DocTicket.html
index d53a93c4c4..fd1bb5eb02 100644
--- a/pr/2595/docs/iroh_docs/struct.DocTicket.html
+++ b/pr/2595/docs/iroh_docs/struct.DocTicket.html
@@ -1,13 +1,13 @@
DocTicket in iroh_docs - Rust pub struct DocTicket {
pub capability: Capability,
- pub nodes: Vec<NodeAddr>,
+ pub nodes: Vec<NodeAddr>,
}
Expand description
Contains both a key (either secret or public) to a document, and a list of peers to join.
Fields§
§capability: Capabilityeither a public or private key
-§nodes: Vec<NodeAddr>A list of nodes to contact.
-Implementations§
source§impl DocTicket
sourcepub fn new(capability: Capability, peers: Vec<NodeAddr>) -> Self
Create a new doc ticket
+§nodes: Vec<NodeAddr>A list of nodes to contact.
+Implementations§
Trait Implementations§
source§impl<'de> Deserialize<'de> for DocTicket
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
- __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreAuto Trait Implementations§
§impl Freeze for DocTicket
§impl RefUnwindSafe for DocTicket
§impl Send for DocTicket
§impl Sync for DocTicket
§impl Unpin for DocTicket
§impl UnwindSafe for DocTicket
Blanket Implementations§
source§impl<T> Any for Twhere
+ __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moreAuto Trait Implementations§
§impl Freeze for DocTicket
§impl RefUnwindSafe for DocTicket
§impl Send for DocTicket
§impl Sync for DocTicket
§impl Unpin for DocTicket
§impl UnwindSafe for DocTicket
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
diff --git a/pr/2595/docs/iroh_docs/struct.NamespaceId.html b/pr/2595/docs/iroh_docs/struct.NamespaceId.html
index 433d51afc6..f9acda8e94 100644
--- a/pr/2595/docs/iroh_docs/struct.NamespaceId.html
+++ b/pr/2595/docs/iroh_docs/struct.NamespaceId.html
@@ -156,6 +156,6 @@ letters are used (e.g. F9B4CA)
Into<Dispatch>, source§fn with_current_subscriber(self) -> WithDispatch<Self>
source§impl<T> DeserializeOwned for Twhere
- T: for<'de> Deserialize<'de>,
§impl<T> PeerIdentity for Twhere
+ T: for<'de> Deserialize<'de>,
source§impl<T> PeerIdentity for T
source§impl<T> RuleType for T
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_docs/struct.NamespacePublicKey.html b/pr/2595/docs/iroh_docs/struct.NamespacePublicKey.html
index 350dea9049..72b75ed510 100644
--- a/pr/2595/docs/iroh_docs/struct.NamespacePublicKey.html
+++ b/pr/2595/docs/iroh_docs/struct.NamespacePublicKey.html
@@ -147,6 +147,6 @@ builds.Into<Dispatch>,source§fn with_current_subscriber(self) -> WithDispatch<Self>
source§impl<T> DeserializeOwned for Twhere
- T: for<'de> Deserialize<'de>,
§impl<T> PeerIdentity for Twhere
+ T: for<'de> Deserialize<'de>,
source§impl<T> PeerIdentity for T
source§impl<T> RuleType for T
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_docs/sync/struct.Entry.html b/pr/2595/docs/iroh_docs/sync/struct.Entry.html
index 55bf06044f..055a4b6f54 100644
--- a/pr/2595/docs/iroh_docs/sync/struct.Entry.html
+++ b/pr/2595/docs/iroh_docs/sync/struct.Entry.html
@@ -1,6 +1,6 @@
Entry in iroh_docs::sync - Rust pub struct Entry { /* private fields */ }
Expand description
A single entry in a Replica
An entry is identified by a key, its Author, and the Replica’s
-NamespaceSecret. Its value is the 32-byte BLAKE3 hash
+NamespaceSecret. Its value is the 32-byte BLAKE3 hash
of the entry’s content data, the size of this content data, and a timestamp.
Implementations§
source§impl Entry
sourcepub fn new(id: RecordIdentifier, record: Record) -> Self
Create a new entry
sourcepub fn new_empty(id: RecordIdentifier) -> Self
Create a new empty entry with the current timestamp.
@@ -15,7 +15,7 @@ of the entry’s content data, the size of this content data, and a timestamp.
sourcepub fn sign(self, namespace: &NamespaceSecret, author: &Author) -> SignedEntry
Sign this entry with a NamespaceSecret and Author.
Methods from Deref<Target = Record>§
sourcepub fn content_len(&self) -> u64
Get the length of the data addressed by this record’s content hash.
-sourcepub fn content_hash(&self) -> Hash
Get the [struct@Hash] of the content data of this record.
+sourcepub fn content_hash(&self) -> Hash
Get the Hash of the content data of this record.
Trait Implementations§
source§impl<'de> Deserialize<'de> for Entry
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl From<SignedEntry> for Entry
source§fn from(value: SignedEntry) -> Self
Converts to this type from the input type.source§impl Ord for Entry
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
diff --git a/pr/2595/docs/iroh_docs/sync/struct.Record.html b/pr/2595/docs/iroh_docs/sync/struct.Record.html
index 94479a973e..f06cccab52 100644
--- a/pr/2595/docs/iroh_docs/sync/struct.Record.html
+++ b/pr/2595/docs/iroh_docs/sync/struct.Record.html
@@ -1,11 +1,11 @@
Record in iroh_docs::sync - Rust pub struct Record { /* private fields */ }
Expand description
The data part of an entry in a Replica.
-Implementations§
source§impl Record
Implementations§
source§impl Record
sourcepub fn empty_current() -> Self
Create a tombstone record with the timestamp set to now.
sourcepub fn new_current(hash: Hash, len: u64) -> Self
Create a new Record with the timestamp set to now.
+sourcepub fn new_current(hash: Hash, len: u64) -> Self
Create a new Record with the timestamp set to now.
sourcepub fn content_len(&self) -> u64
Get the length of the data addressed by this record’s content hash.
-sourcepub fn content_hash(&self) -> Hash
Get the [struct@Hash] of the content data of this record.
+sourcepub fn content_hash(&self) -> Hash
Get the Hash of the content data of this record.
Trait Implementations§
source§impl<'de> Deserialize<'de> for Record
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl Ord for Record
Ordering for entry values.
diff --git a/pr/2595/docs/iroh_docs/sync/struct.Replica.html b/pr/2595/docs/iroh_docs/sync/struct.Replica.html
index 23a9798651..c4e161f3c3 100644
--- a/pr/2595/docs/iroh_docs/sync/struct.Replica.html
+++ b/pr/2595/docs/iroh_docs/sync/struct.Replica.html
@@ -5,7 +5,7 @@
&mut self,
key: impl AsRef<[u8]>,
author: &Author,
- hash: Hash,
+ hash: Hash,
len: u64
) -> Result<usize, InsertError>Insert a new record at the given key.
The entry will by signed by the provided author.
@@ -35,7 +35,7 @@ or an error if the entry failed to validate or if a store operation failed.
key: impl AsRef<[u8]>,
author: &Author,
data: impl AsRef<[u8]>
-) -> Result<Hash, InsertError>Hashes the given data and inserts it.
+) -> Result<Hash, InsertError>Hashes the given data and inserts it.
This does not store the content, just the record of it.
Returns the calculated hash.
sourcepub fn record_id(
diff --git a/pr/2595/docs/iroh_docs/sync/struct.SignedEntry.html b/pr/2595/docs/iroh_docs/sync/struct.SignedEntry.html
index 21644eacb1..9ef5e98134 100644
--- a/pr/2595/docs/iroh_docs/sync/struct.SignedEntry.html
+++ b/pr/2595/docs/iroh_docs/sync/struct.SignedEntry.html
@@ -14,7 +14,7 @@
sourcepub fn signature(&self) -> &EntrySignature
Get the signature.
sourcepub fn validate_empty(&self) -> Result<(), ValidationFailure>
Validate that the entry has the empty hash if the length is 0, or a non-zero length.
sourcepub fn content_hash(&self) -> Hash
Get the content [struct@Hash] of the entry.
+sourcepub fn content_hash(&self) -> Hash
Get the content Hash of the entry.
sourcepub fn content_len(&self) -> u64
Get the content length of the entry.
Get the author bytes of this entry.
Methods from Deref<Target = Record>§
sourcepub fn content_len(&self) -> u64
Get the length of the data addressed by this record’s content hash.
-sourcepub fn content_hash(&self) -> Hash
Get the [struct@Hash] of the content data of this record.
+sourcepub fn content_hash(&self) -> Hash
Get the Hash of the content data of this record.
Trait Implementations§
source§impl Clone for SignedEntry
source§fn clone(&self) -> SignedEntry
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moresource§impl Debug for SignedEntry
source§impl Deref for SignedEntry
source§impl<'de> Deserialize<'de> for SignedEntry
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl From<SignedEntry> for Entry
source§fn from(value: SignedEntry) -> Self
Converts to this type from the input type.source§impl Ord for SignedEntry
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
diff --git a/pr/2595/docs/iroh_docs/sync/type.ContentStatusCallback.html b/pr/2595/docs/iroh_docs/sync/type.ContentStatusCallback.html
index 46d5a5a49c..84ffdbe8ee 100644
--- a/pr/2595/docs/iroh_docs/sync/type.ContentStatusCallback.html
+++ b/pr/2595/docs/iroh_docs/sync/type.ContentStatusCallback.html
@@ -1,2 +1,2 @@
-ContentStatusCallback in iroh_docs::sync - Rust Type Alias iroh_docs::sync::ContentStatusCallback
source · pub type ContentStatusCallback = Arc<dyn Fn(Hash) -> ContentStatus + Send + Sync + 'static>;
Expand description
Callback that may be set on a replica to determine the availability status for a content hash.
+ContentStatusCallback in iroh_docs::sync - Rust Type Alias iroh_docs::sync::ContentStatusCallback
source · pub type ContentStatusCallback = Arc<dyn Fn(Hash) -> ContentStatus + Send + Sync + 'static>;
Expand description
Callback that may be set on a replica to determine the availability status for a content hash.
Aliased Type§
struct ContentStatusCallback { /* private fields */ }
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_net/discovery/dns/index.html b/pr/2595/docs/iroh_net/discovery/dns/index.html
index 5a80538422..a752b49d78 100644
--- a/pr/2595/docs/iroh_net/discovery/dns/index.html
+++ b/pr/2595/docs/iroh_net/discovery/dns/index.html
@@ -1,2 +1,2 @@
-iroh_net::discovery::dns - Rust Expand description
DNS node discovery for iroh-net
+iroh_net::discovery::dns - Rust Expand description
DNS node discovery for iroh-net
Structs§
- DNS node discovery
Constants§
- The n0 testing DNS node origin, for production.
- The n0 testing DNS node origin, for testing.
- Testing DNS node origin, must run server from
crate::test_utils::DnsPkarrServer.
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_net/discovery/dns/struct.DnsDiscovery.html b/pr/2595/docs/iroh_net/discovery/dns/struct.DnsDiscovery.html
index 3e7d5d71cc..7628fb45a9 100644
--- a/pr/2595/docs/iroh_net/discovery/dns/struct.DnsDiscovery.html
+++ b/pr/2595/docs/iroh_net/discovery/dns/struct.DnsDiscovery.html
@@ -28,7 +28,7 @@ custom discovery mechanism.
For testing it is also possible to use the N0_DNS_NODE_ORIGIN_STAGING domain
with DnsDiscovery::new. This would then use a hosted discovery service again,
but for testing purposes.
-Trait Implementations§
Trait Implementations§
source§impl Debug for DnsDiscovery
source§impl Discovery for DnsDiscovery
source§fn resolve(
&self,
ep: Endpoint,
node_id: NodeId
diff --git a/pr/2595/docs/iroh_net/discovery/trait.Discovery.html b/pr/2595/docs/iroh_net/discovery/trait.Discovery.html
index a53a618708..d3832a56b5 100644
--- a/pr/2595/docs/iroh_net/discovery/trait.Discovery.html
+++ b/pr/2595/docs/iroh_net/discovery/trait.Discovery.html
@@ -29,4 +29,4 @@ These tasks will be run on the runtime of the Option<BoxStream<Result<DiscoveryItem>>>
Implementors§
source§impl Discovery for DnsDiscovery
source§impl Discovery for LocalSwarmDiscovery
source§impl Discovery for PkarrPublisher
source§impl Discovery for PkarrResolver
source§impl Discovery for ConcurrentDiscovery
\ No newline at end of file
+
Implementors§
source§impl Discovery for DnsDiscovery
source§impl Discovery for LocalSwarmDiscovery
source§impl Discovery for PkarrPublisher
source§impl Discovery for PkarrResolver
source§impl Discovery for ConcurrentDiscovery
\ No newline at end of file
diff --git a/pr/2595/docs/src/iroh_net/discovery/dns.rs.html b/pr/2595/docs/src/iroh_net/discovery/dns.rs.html
index dd1a279fb3..1d32545ed3 100644
--- a/pr/2595/docs/src/iroh_net/discovery/dns.rs.html
+++ b/pr/2595/docs/src/iroh_net/discovery/dns.rs.html
@@ -97,6 +97,10 @@
97
98
99
+100
+101
+102
+103
//! DNS node discovery for iroh-net
use anyhow::Result;
@@ -182,6 +186,10 @@
fn resolve(&self, ep: Endpoint, node_id: NodeId) -> Option<BoxStream<Result<DiscoveryItem>>> {
let resolver = ep.dns_resolver().clone();
let origin_domain = self.origin_domain.clone();
+ #[cfg(any(test, feature = "test-utils"))]
+ if origin_domain.contains(&TEST_DNS_NODE_ORIGIN.to_string()) {
+ panic!("wait. THIS IS ILLEGAL!");
+ }
let fut = async move {
let node_addr = resolver
.lookup_by_id_staggered(&node_id, &origin_domain, DNS_STAGGERING_MS)
diff --git a/pr/2595/docs/trait.impl/iroh_base/ticket/trait.Ticket.js b/pr/2595/docs/trait.impl/iroh_base/ticket/trait.Ticket.js
index 12fa1e3ee5..5d209fabd2 100644
--- a/pr/2595/docs/trait.impl/iroh_base/ticket/trait.Ticket.js
+++ b/pr/2595/docs/trait.impl/iroh_base/ticket/trait.Ticket.js
@@ -1,5 +1,5 @@
(function() {var implementors = {
"iroh":[],
"iroh_base":[],
-"iroh_docs":[["impl Ticket for DocTicket"]]
+"iroh_docs":[["impl Ticket for DocTicket"]]
};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
diff --git a/pr/2595/docs/type.impl/std/primitive.array.js b/pr/2595/docs/type.impl/std/primitive.array.js
index 588a8b53a3..3006964922 100644
--- a/pr/2595/docs/type.impl/std/primitive.array.js
+++ b/pr/2595/docs/type.impl/std/primitive.array.js
@@ -1,4 +1,4 @@
(function() {var type_impls = {
"iroh":[["source§impl<T, const N: usize> [T; N]
1.55.0 · sourcepub fn map<F, U>(self, f: F) -> [U; N]where\n F: FnMut(T) -> U,
Returns an array of the same size as self, with function f applied to each element\nin order.
\nIf you don’t necessarily need a new fixed-size array, consider using\nIterator::map instead.
\n§Note on performance and stack usage
\nUnfortunately, usages of this method are currently not always optimized\nas well as they could be. This mainly concerns large arrays, as mapping\nover small arrays seem to be optimized just fine. Also note that in\ndebug mode (i.e. without any optimizations), this method can use a lot\nof stack space (a few times the size of the array or more).
\nTherefore, in performance-critical code, try to avoid using this method\non large arrays or check the emitted code. Also try to avoid chained\nmaps (e.g. arr.map(...).map(...)).
\nIn many cases, you can instead use Iterator::map by calling .iter()\nor .into_iter() on your array. [T; N]::map is only necessary if you\nreally need a new array of the same size as the result. Rust’s lazy\niterators tend to get optimized very well.
\n§Examples
\nlet x = [1, 2, 3];\nlet y = x.map(|v| v + 1);\nassert_eq!(y, [2, 3, 4]);\n\nlet x = [1, 2, 3];\nlet mut temp = 0;\nlet y = x.map(|v| { temp += 1; v * temp });\nassert_eq!(y, [1, 4, 9]);\n\nlet x = [\"Ferris\", \"Bueller's\", \"Day\", \"Off\"];\nlet y = x.map(|v| v.len());\nassert_eq!(y, [6, 9, 3, 3]);
\nsourcepub fn try_map<F, R>(\n self,\n f: F\n) -> <<R as Try>::Residual as Residual<[<R as Try>::Output; N]>>::TryType
🔬This is a nightly-only experimental API. (array_try_map)
A fallible function f applied to each element on array self in order to\nreturn an array the same size as self or the first error encountered.
\nThe return type of this function depends on the return type of the closure.\nIf you return Result<T, E> from the closure, you’ll get a Result<[T; N], E>.\nIf you return Option<T> from the closure, you’ll get an Option<[T; N]>.
\n§Examples
\n#![feature(array_try_map)]\n\nlet a = [\"1\", \"2\", \"3\"];\nlet b = a.try_map(|v| v.parse::<u32>()).unwrap().map(|v| v + 1);\nassert_eq!(b, [2, 3, 4]);\n\nlet a = [\"1\", \"2a\", \"3\"];\nlet b = a.try_map(|v| v.parse::<u32>());\nassert!(b.is_err());\n\nuse std::num::NonZero;\n\nlet z = [1, 2, 0, 3, 4];\nassert_eq!(z.try_map(NonZero::new), None);\n\nlet a = [1, 2, 3];\nlet b = a.try_map(NonZero::new);\nlet c = b.map(|x| x.map(NonZero::get));\nassert_eq!(c, Some(a));
\n1.57.0 (const: 1.57.0) · sourcepub const fn as_slice(&self) -> &[T]
Returns a slice containing the entire array. Equivalent to &s[..].
\n1.57.0 · sourcepub fn as_mut_slice(&mut self) -> &mut [T]
Returns a mutable slice containing the entire array. Equivalent to\n&mut s[..].
\n1.77.0 · sourcepub fn each_ref(&self) -> [&T; N]
Borrows each element and returns an array of references with the same\nsize as self.
\n§Example
\nlet floats = [3.1, 2.7, -1.0];\nlet float_refs: [&f64; 3] = floats.each_ref();\nassert_eq!(float_refs, [&3.1, &2.7, &-1.0]);
\nThis method is particularly useful if combined with other methods, like\nmap. This way, you can avoid moving the original\narray if its elements are not Copy.
\n\nlet strings = [\"Ferris\".to_string(), \"♥\".to_string(), \"Rust\".to_string()];\nlet is_ascii = strings.each_ref().map(|s| s.is_ascii());\nassert_eq!(is_ascii, [true, false, true]);\n\n// We can still access the original array: it has not been moved.\nassert_eq!(strings.len(), 3);
\n1.77.0 · sourcepub fn each_mut(&mut self) -> [&mut T; N]
Borrows each element mutably and returns an array of mutable references\nwith the same size as self.
\n§Example
\n\nlet mut floats = [3.1, 2.7, -1.0];\nlet float_refs: [&mut f64; 3] = floats.each_mut();\n*float_refs[0] = 0.0;\nassert_eq!(float_refs, [&mut 0.0, &mut 2.7, &mut -1.0]);\nassert_eq!(floats, [0.0, 2.7, -1.0]);
\nsourcepub fn split_array_ref<const M: usize>(&self) -> (&[T; M], &[T])
🔬This is a nightly-only experimental API. (split_array)
Divides one array reference into two at an index.
\nThe first will contain all indices from [0, M) (excluding\nthe index M itself) and the second will contain all\nindices from [M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet v = [1, 2, 3, 4, 5, 6];\n\n{\n let (left, right) = v.split_array_ref::<0>();\n assert_eq!(left, &[]);\n assert_eq!(right, &[1, 2, 3, 4, 5, 6]);\n}\n\n{\n let (left, right) = v.split_array_ref::<2>();\n assert_eq!(left, &[1, 2]);\n assert_eq!(right, &[3, 4, 5, 6]);\n}\n\n{\n let (left, right) = v.split_array_ref::<6>();\n assert_eq!(left, &[1, 2, 3, 4, 5, 6]);\n assert_eq!(right, &[]);\n}
\nsourcepub fn split_array_mut<const M: usize>(&mut self) -> (&mut [T; M], &mut [T])
🔬This is a nightly-only experimental API. (split_array)
Divides one mutable array reference into two at an index.
\nThe first will contain all indices from [0, M) (excluding\nthe index M itself) and the second will contain all\nindices from [M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet mut v = [1, 0, 3, 0, 5, 6];\nlet (left, right) = v.split_array_mut::<2>();\nassert_eq!(left, &mut [1, 0][..]);\nassert_eq!(right, &mut [3, 0, 5, 6]);\nleft[1] = 2;\nright[1] = 4;\nassert_eq!(v, [1, 2, 3, 4, 5, 6]);
\nsourcepub fn rsplit_array_ref<const M: usize>(&self) -> (&[T], &[T; M])
🔬This is a nightly-only experimental API. (split_array)
Divides one array reference into two at an index from the end.
\nThe first will contain all indices from [0, N - M) (excluding\nthe index N - M itself) and the second will contain all\nindices from [N - M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet v = [1, 2, 3, 4, 5, 6];\n\n{\n let (left, right) = v.rsplit_array_ref::<0>();\n assert_eq!(left, &[1, 2, 3, 4, 5, 6]);\n assert_eq!(right, &[]);\n}\n\n{\n let (left, right) = v.rsplit_array_ref::<2>();\n assert_eq!(left, &[1, 2, 3, 4]);\n assert_eq!(right, &[5, 6]);\n}\n\n{\n let (left, right) = v.rsplit_array_ref::<6>();\n assert_eq!(left, &[]);\n assert_eq!(right, &[1, 2, 3, 4, 5, 6]);\n}
\nsourcepub fn rsplit_array_mut<const M: usize>(&mut self) -> (&mut [T], &mut [T; M])
🔬This is a nightly-only experimental API. (split_array)
Divides one mutable array reference into two at an index from the end.
\nThe first will contain all indices from [0, N - M) (excluding\nthe index N - M itself) and the second will contain all\nindices from [N - M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet mut v = [1, 0, 3, 0, 5, 6];\nlet (left, right) = v.rsplit_array_mut::<4>();\nassert_eq!(left, &mut [1, 0]);\nassert_eq!(right, &mut [3, 0, 5, 6][..]);\nleft[1] = 2;\nright[1] = 4;\nassert_eq!(v, [1, 2, 3, 4, 5, 6]);
\n",0,"iroh::docs::PeerIdBytes"],["source§impl<const N: usize> [u8; N]
sourcepub const fn as_ascii(&self) -> Option<&[AsciiChar; N]>
🔬This is a nightly-only experimental API. (ascii_char)
Converts this array of bytes into a array of ASCII characters,\nor returns None if any of the characters is non-ASCII.
\n§Examples
\n#![feature(ascii_char)]\n#![feature(const_option)]\n\nconst HEX_DIGITS: [std::ascii::Char; 16] =\n *b\"0123456789abcdef\".as_ascii().unwrap();\n\nassert_eq!(HEX_DIGITS[1].as_str(), \"1\");\nassert_eq!(HEX_DIGITS[10].as_str(), \"a\");
\nsourcepub const unsafe fn as_ascii_unchecked(&self) -> &[AsciiChar; N]
🔬This is a nightly-only experimental API. (ascii_char)
Converts this array of bytes into a array of ASCII characters,\nwithout checking whether they’re valid.
\n§Safety
\nEvery byte in the array must be in 0..=127, or else this is UB.
\n",0,"iroh::docs::PeerIdBytes"],["§impl<T> Array for [T; 32]where\n T: Default,
§fn as_slice_mut(&mut self) -> &mut [T]
Gives a unique slice over the whole thing. Read more","Array","iroh::docs::PeerIdBytes"],["","Array","iroh::docs::PeerIdBytes"],["§impl<const N: usize, T> AsBytes for [T; N]where\n T: AsBytes,
§fn write_to_prefix(&self, bytes: &mut [u8]) -> Option<()>
","AsBytes","iroh::docs::PeerIdBytes"],["","AsBytes","iroh::docs::PeerIdBytes"],["","AsMut<[T]>","iroh::docs::PeerIdBytes"],["","AsRef<[T]>","iroh::docs::PeerIdBytes"],["§impl<T, const N: usize> BitView for [T; N]where\n T: BitStore,
Note that overly-large arrays may cause the conversions to fail.
\n§fn view_bits<O>(&self) -> &BitSlice<T, O>where\n O: BitOrder,
Views a memory region as an immutable bit-slice.§fn try_view_bits<O>(&self) -> Result<&BitSlice<T, O>, BitSpanError<T>>where\n O: BitOrder,
Attempts to view a memory region as an immutable bit-slice. Read more§fn view_bits_mut<O>(&mut self) -> &mut BitSlice<T, O>where\n O: BitOrder,
Views a memory region as a mutable bit-slice.§fn try_view_bits_mut<O>(\n &mut self\n) -> Result<&mut BitSlice<T, O>, BitSpanError<T>>where\n O: BitOrder,
Attempts to view a memory region as a mutable bit-slice. Read more","BitView","iroh::docs::PeerIdBytes"],["§impl<T, const N: usize> BitViewSized for [T; N]where\n T: BitStore,
§fn as_raw_slice(&self) -> &[<[T; N] as BitView>::Store]
Views the type as a slice of its elements.§fn as_raw_mut_slice(&mut self) -> &mut [<[T; N] as BitView>::Store]
Views the type as a mutable slice of its elements.§fn into_bitarray<O>(self) -> BitArray<Self, O>where\n O: BitOrder,
Wraps self in a BitArray.","BitViewSized","iroh::docs::PeerIdBytes"],["","Borrow<[T]>","iroh::docs::PeerIdBytes"],["1.4.0 · source§impl<T, const N: usize> BorrowMut<[T]> for [T; N]
source§fn borrow_mut(&mut self) -> &mut [T]
Mutably borrows from an owned value. Read more","BorrowMut<[T]>","iroh::docs::PeerIdBytes"],["","Chain","iroh::docs::PeerIdBytes"],["","Clone","iroh::docs::PeerIdBytes"],["","Debug","iroh::docs::PeerIdBytes"],["§impl<const N: usize> Decode for [u8; N]
Decodes a byte array from byte[n] as described in RFC4251 § 5:
\n\nA byte represents an arbitrary 8-bit value (octet). Fixed length\ndata is sometimes represented as an array of bytes, written\nbyte[n], where n is the number of bytes in the array.
\n
\n","Decode","iroh::docs::PeerIdBytes"],["§impl<'a, T, const N: usize> DecodeValue<'a> for [T; N]where\n T: Decode<'a>,
§fn decode_value<R>(reader: &mut R, header: Header) -> Result<[T; N], Error>where\n R: Reader<'a>,
Attempt to decode this message using the provided [Reader].","DecodeValue<'a>","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["source§impl<'de, T> Deserialize<'de> for [T; 32]where\n T: Deserialize<'de>,
source§fn deserialize<D>(\n deserializer: D\n) -> Result<[T; 32], <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more","Deserialize<'de>","iroh::docs::PeerIdBytes"],["source§impl<'de, const N: usize> Deserialize<'de> for [u8; N]
source§fn deserialize<D>(\n deserializer: D\n) -> Result<[u8; N], <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
","Deserialize<'de>","iroh::docs::PeerIdBytes"],["§impl<const N: usize> Encode for [u8; N]
Encodes [u8; N] into byte[n] as described in RFC4251 § 5:
\n\nA byte represents an arbitrary 8-bit value (octet). Fixed length\ndata is sometimes represented as an array of bytes, written\nbyte[n], where n is the number of bytes in the array.
\n
\n§fn encoded_len(&self) -> Result<usize, Error>
Get the length of this type encoded in bytes, prior to Base64 encoding.§fn encode(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value using the provided [Writer].§fn encoded_len_prefixed(&self) -> Result<usize, Error>
Return the length of this type after encoding when prepended with a\nuint32 length prefix.§fn encode_prefixed(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value, first prepending a uint32 length prefix\nset to [Encode::encoded_len].","Encode","iroh::docs::PeerIdBytes"],["","EncodeLabelSet","iroh::docs::PeerIdBytes"],["§impl<T, const N: usize> EncodeValue for [T; N]where\n T: Encode,
","EncodeValue","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["§impl<'a> FindToken<&'a u8> for [u8; 32]
§fn find_token(&self, token: &u8) -> bool
Returns true if self contains the token","FindToken<&'a u8>","iroh::docs::PeerIdBytes"],["§impl FindToken<u8> for [u8; 32]
§fn find_token(&self, token: u8) -> bool
Returns true if self contains the token","FindToken","iroh::docs::PeerIdBytes"],["","FixedTag","iroh::docs::PeerIdBytes"],["","From<&Signature>","iroh::docs::PeerIdBytes"],["","From","iroh::docs::PeerIdBytes"],["§impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>>> for [T; 32]
","From, B0>, B0>, B0>, B0>, B0>>>","iroh::docs::PeerIdBytes"],["","From","iroh::docs::PeerIdBytes"],["","From","iroh::docs::PeerIdBytes"],["","From>","iroh::docs::PeerIdBytes"],["","From","iroh::docs::PeerIdBytes"],["","From","iroh::docs::PeerIdBytes"],["","From","iroh::docs::PeerIdBytes"],["","From>","iroh::docs::PeerIdBytes"],["§impl<const N: usize, T> FromBytes for [T; N]where\n T: FromBytes,
§fn slice_from_prefix(bytes: &[u8], count: usize) -> Option<(&[Self], &[u8])>where\n Self: Sized,
Interprets the prefix of the given bytes as a &[Self] with length\nequal to count without copying. Read more§fn slice_from_suffix(bytes: &[u8], count: usize) -> Option<(&[u8], &[Self])>where\n Self: Sized,
Interprets the suffix of the given bytes as a &[Self] with length\nequal to count without copying. Read more§fn read_from_prefix(bytes: &[u8]) -> Option<Self>where\n Self: Sized,
","FromBytes","iroh::docs::PeerIdBytes"],["","FromHex","iroh::docs::PeerIdBytes"],["","FromZeroes","iroh::docs::PeerIdBytes"],["","Hash","iroh::docs::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Hash for [T; N]where\n T: Hash,
The hash of an array is the same as that of the corresponding slice,\nas required by the Borrow implementation.
\n\nuse std::hash::BuildHasher;\n\nlet b = std::hash::RandomState::new();\nlet a: [u8; 3] = [0xa8, 0x3c, 0x09];\nlet s: &[u8] = &[0xa8, 0x3c, 0x09];\nassert_eq!(b.hash_one(a), b.hash_one(s));
\n","Hash","iroh::docs::PeerIdBytes"],["","Index","iroh::docs::PeerIdBytes"],["","IndexMut","iroh::docs::PeerIdBytes"],["","InputLength","iroh::docs::PeerIdBytes"],["1.53.0 · source§impl<T, const N: usize> IntoIterator for [T; N]
source§fn into_iter(self) -> <[T; N] as IntoIterator>::IntoIter
Creates a consuming iterator, that is, one that moves each value out of\nthe array (from start to end). The array cannot be used after calling\nthis unless T implements Copy, so the whole array is copied.
\nArrays have special behavior when calling .into_iter() prior to the\n2021 edition – see the array Editions section for more information.
\n","IntoIterator","iroh::docs::PeerIdBytes"],["§impl<const N: usize> IntoResponse for [u8; N]
§fn into_response(self) -> Response<Body>
Create a response.","IntoResponse","iroh::docs::PeerIdBytes"],["§impl<Fut, const N: usize> Join for [Fut; N]where\n Fut: IntoFuture,
§type Output = [<Fut as IntoFuture>::Output; N]
The resulting output type.§type Future = Join<<Fut as IntoFuture>::IntoFuture, N>
The Future implementation returned by this method.","Join","iroh::docs::PeerIdBytes"],["","Key","iroh::docs::PeerIdBytes"],["§impl<T, const N: usize> MaxSize for [T; N]where\n T: MaxSize,
§const POSTCARD_MAX_SIZE: usize = _
The maximum possible size that the serialization of this\ntype can have, in bytes.","MaxSize","iroh::docs::PeerIdBytes"],["","Merge","iroh::docs::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Ord for [T; N]where\n T: Ord,
Implements comparison of arrays lexicographically.
\n1.21.0 · source§fn max(self, other: Self) -> Selfwhere\n Self: Sized,
Compares and returns the maximum of two values. Read more","Ord","iroh::docs::PeerIdBytes"],["","PartialEq<&[U]>","iroh::docs::PeerIdBytes"],["1.0.0 · source§impl<T, U, const N: usize> PartialEq<&mut [U]> for [T; N]where\n T: PartialEq<U>,
","PartialEq<&mut [U]>","iroh::docs::PeerIdBytes"],["","PartialEq<[U]>","iroh::docs::PeerIdBytes"],["","PartialEq<[U; N]>","iroh::docs::PeerIdBytes"],["","PartialEq","iroh::docs::PeerIdBytes"],["§impl<A, B, const N: usize, const M: usize> PartialEq<Vec<A, N>> for [B; M]where\n A: PartialEq<B>,
","PartialEq>","iroh::docs::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> PartialOrd for [T; N]where\n T: PartialOrd,
Implements comparison of arrays lexicographically.
\nsource§fn le(&self, other: &[T; N]) -> bool
This method tests less than or equal to (for self and other) and is used by the <=\noperator. Read more","PartialOrd","iroh::docs::PeerIdBytes"],["§impl<Fut, const N: usize> Race for [Fut; N]where\n Fut: IntoFuture,
§type Output = <Fut as IntoFuture>::Output
The resulting output type.§type Future = Race<<Fut as IntoFuture>::IntoFuture, N>
Which kind of future are we turning this into?","Race","iroh::docs::PeerIdBytes"],["§impl<Fut, T, E, const N: usize> RaceOk for [Fut; N]where\n Fut: IntoFuture<Output = Result<T, E>>,
§type Future = RaceOk<<Fut as IntoFuture>::IntoFuture, T, E, N>
Which kind of future are we turning this into?","RaceOk","iroh::docs::PeerIdBytes"],["","Schema","iroh::docs::PeerIdBytes"],["source§impl<T> Serialize for [T; 32]where\n T: 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","iroh::docs::PeerIdBytes"],["source§impl<const N: usize> Serialize for [u8; N]
source§fn serialize<S>(\n &self,\n serializer: S\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where\n S: Serializer,
","Serialize","iroh::docs::PeerIdBytes"],["1.51.0 · source§impl<T, const N: usize> SlicePattern for [T; N]
","SlicePattern","iroh::docs::PeerIdBytes"],["1.34.0 · source§impl<T, const N: usize> TryFrom<&[T]> for [T; N]where\n T: Copy,
Tries to create an array [T; N] by copying from a slice &[T]. Succeeds if\nslice.len() == N.
\n\nlet bytes: [u8; 3] = [1, 0, 2];\n\nlet bytes_head: [u8; 2] = <[u8; 2]>::try_from(&bytes[0..2]).unwrap();\nassert_eq!(1, u16::from_le_bytes(bytes_head));\n\nlet bytes_tail: [u8; 2] = bytes[1..3].try_into().unwrap();\nassert_eq!(512, u16::from_le_bytes(bytes_tail));
\n§type Error = TryFromSliceError
The type returned in the event of a conversion error.","TryFrom<&[T]>","iroh::docs::PeerIdBytes"],["1.59.0 · source§impl<T, const N: usize> TryFrom<&mut [T]> for [T; N]where\n T: Copy,
Tries to create an array [T; N] by copying from a mutable slice &mut [T].\nSucceeds if slice.len() == N.
\n\nlet mut bytes: [u8; 3] = [1, 0, 2];\n\nlet bytes_head: [u8; 2] = <[u8; 2]>::try_from(&mut bytes[0..2]).unwrap();\nassert_eq!(1, u16::from_le_bytes(bytes_head));\n\nlet bytes_tail: [u8; 2] = (&mut bytes[1..3]).try_into().unwrap();\nassert_eq!(512, u16::from_le_bytes(bytes_tail));
\n§type Error = TryFromSliceError
The type returned in the event of a conversion error.","TryFrom<&mut [T]>","iroh::docs::PeerIdBytes"],["§impl<T, A, const N: usize> TryFrom<Vec<T, A>> for [T; N]where\n A: Allocator,
§fn try_from(vec: Vec<T, A>) -> Result<[T; N], Vec<T, A>>
Gets the entire contents of the Vec<T> as an array,\nif its size exactly matches that of the requested array.
\n§Examples
\nassert_eq!(vec![1, 2, 3].try_into(), Ok([1, 2, 3]));\nassert_eq!(<Vec<i32>>::new().try_into(), Ok([]));
\nIf the length doesn’t match, the input comes back in Err:
\n\nlet r: Result<[i32; 4], _> = (0..10).collect::<Vec<_>>().try_into();\nassert_eq!(r, Err(vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9]));
\nIf you’re fine with just getting a prefix of the Vec<T>,\nyou can call .truncate(N) first.
\n\nlet mut v = String::from(\"hello world\").into_bytes();\nv.sort();\nv.truncate(2);\nlet [a, b]: [_; 2] = v.try_into().unwrap();\nassert_eq!(a, b' ');\nassert_eq!(b, b'd');
\n","TryFrom>","iroh::docs::PeerIdBytes"],["1.48.0 · source§impl<T, A, const N: usize> TryFrom<Vec<T, A>> for [T; N]where\n A: Allocator,
source§fn try_from(vec: Vec<T, A>) -> Result<[T; N], Vec<T, A>>
Gets the entire contents of the Vec<T> as an array,\nif its size exactly matches that of the requested array.
\n§Examples
\nassert_eq!(vec![1, 2, 3].try_into(), Ok([1, 2, 3]));\nassert_eq!(<Vec<i32>>::new().try_into(), Ok([]));
\nIf the length doesn’t match, the input comes back in Err:
\n\nlet r: Result<[i32; 4], _> = (0..10).collect::<Vec<_>>().try_into();\nassert_eq!(r, Err(vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9]));
\nIf you’re fine with just getting a prefix of the Vec<T>,\nyou can call .truncate(N) first.
\n\nlet mut v = String::from(\"hello world\").into_bytes();\nv.sort();\nv.truncate(2);\nlet [a, b]: [_; 2] = v.try_into().unwrap();\nassert_eq!(a, b' ');\nassert_eq!(b, b'd');
\n","TryFrom>","iroh::docs::PeerIdBytes"],["§impl<Fut, T, E, const N: usize> TryJoin for [Fut; N]where\n Fut: IntoFuture<Output = Result<T, E>>,
§type Future = TryJoin<<Fut as IntoFuture>::IntoFuture, T, E, N>
Which kind of future are we turning this into?","TryJoin","iroh::docs::PeerIdBytes"],["§impl<const N: usize, T> Value for [T; N]where\n T: Value,
§type SelfType<'a> = [<T as Value>::SelfType<'a>; N]\nwhere\n [T; N]: 'a
SelfType<’a> must be the same type as Self with all lifetimes replaced with ’a§type AsBytes<'a> = Vec<u8>\nwhere\n [T; N]: 'a
§fn fixed_width() -> Option<usize>
Width of a fixed type, or None for variable width§fn from_bytes<'a>(data: &'a [u8]) -> [<T as Value>::SelfType<'a>; N]where\n [T; N]: 'a,
Deserializes data\nImplementations may return a view over data, or an owned type","Value","iroh::docs::PeerIdBytes"],["","ValueOrd","iroh::docs::PeerIdBytes"],["§impl<Z, const N: usize> Zeroize for [Z; N]where\n Z: Zeroize,
Impl [Zeroize] on arrays of types that impl [Zeroize].
\n","Zeroize","iroh::docs::PeerIdBytes"],["","Zip","iroh::docs::PeerIdBytes"],["source§impl<T, const N: usize> ConstParamTy for [T; N]where\n T: ConstParamTy,
","ConstParamTy","iroh::docs::PeerIdBytes"],["1.58.0 · source§impl<T, const N: usize> Copy for [T; N]where\n T: Copy,
","Copy","iroh::docs::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Eq for [T; N]where\n T: Eq,
","Eq","iroh::docs::PeerIdBytes"],["source§impl<T, const N: usize> StructuralPartialEq for [T; N]
","StructuralPartialEq","iroh::docs::PeerIdBytes"],["§impl<const N: usize, T> Unaligned for [T; N]where\n T: Unaligned,
","Unaligned","iroh::docs::PeerIdBytes"],["§impl<Z, const N: usize> ZeroizeOnDrop for [Z; N]where\n Z: ZeroizeOnDrop,
Impl [ZeroizeOnDrop] on arrays of types that impl [ZeroizeOnDrop].
\n","ZeroizeOnDrop","iroh::docs::PeerIdBytes"]],
-"iroh_docs":[["source§impl<T, const N: usize> [T; N]
1.55.0 · sourcepub fn map<F, U>(self, f: F) -> [U; N]where\n F: FnMut(T) -> U,
Returns an array of the same size as self, with function f applied to each element\nin order.
\nIf you don’t necessarily need a new fixed-size array, consider using\nIterator::map instead.
\n§Note on performance and stack usage
\nUnfortunately, usages of this method are currently not always optimized\nas well as they could be. This mainly concerns large arrays, as mapping\nover small arrays seem to be optimized just fine. Also note that in\ndebug mode (i.e. without any optimizations), this method can use a lot\nof stack space (a few times the size of the array or more).
\nTherefore, in performance-critical code, try to avoid using this method\non large arrays or check the emitted code. Also try to avoid chained\nmaps (e.g. arr.map(...).map(...)).
\nIn many cases, you can instead use Iterator::map by calling .iter()\nor .into_iter() on your array. [T; N]::map is only necessary if you\nreally need a new array of the same size as the result. Rust’s lazy\niterators tend to get optimized very well.
\n§Examples
\nlet x = [1, 2, 3];\nlet y = x.map(|v| v + 1);\nassert_eq!(y, [2, 3, 4]);\n\nlet x = [1, 2, 3];\nlet mut temp = 0;\nlet y = x.map(|v| { temp += 1; v * temp });\nassert_eq!(y, [1, 4, 9]);\n\nlet x = [\"Ferris\", \"Bueller's\", \"Day\", \"Off\"];\nlet y = x.map(|v| v.len());\nassert_eq!(y, [6, 9, 3, 3]);
\nsourcepub fn try_map<F, R>(\n self,\n f: F\n) -> <<R as Try>::Residual as Residual<[<R as Try>::Output; N]>>::TryType
🔬This is a nightly-only experimental API. (array_try_map)
A fallible function f applied to each element on array self in order to\nreturn an array the same size as self or the first error encountered.
\nThe return type of this function depends on the return type of the closure.\nIf you return Result<T, E> from the closure, you’ll get a Result<[T; N], E>.\nIf you return Option<T> from the closure, you’ll get an Option<[T; N]>.
\n§Examples
\n#![feature(array_try_map)]\n\nlet a = [\"1\", \"2\", \"3\"];\nlet b = a.try_map(|v| v.parse::<u32>()).unwrap().map(|v| v + 1);\nassert_eq!(b, [2, 3, 4]);\n\nlet a = [\"1\", \"2a\", \"3\"];\nlet b = a.try_map(|v| v.parse::<u32>());\nassert!(b.is_err());\n\nuse std::num::NonZero;\n\nlet z = [1, 2, 0, 3, 4];\nassert_eq!(z.try_map(NonZero::new), None);\n\nlet a = [1, 2, 3];\nlet b = a.try_map(NonZero::new);\nlet c = b.map(|x| x.map(NonZero::get));\nassert_eq!(c, Some(a));
\n1.57.0 (const: 1.57.0) · sourcepub const fn as_slice(&self) -> &[T]
Returns a slice containing the entire array. Equivalent to &s[..].
\n1.57.0 · sourcepub fn as_mut_slice(&mut self) -> &mut [T]
Returns a mutable slice containing the entire array. Equivalent to\n&mut s[..].
\n1.77.0 · sourcepub fn each_ref(&self) -> [&T; N]
Borrows each element and returns an array of references with the same\nsize as self.
\n§Example
\nlet floats = [3.1, 2.7, -1.0];\nlet float_refs: [&f64; 3] = floats.each_ref();\nassert_eq!(float_refs, [&3.1, &2.7, &-1.0]);
\nThis method is particularly useful if combined with other methods, like\nmap. This way, you can avoid moving the original\narray if its elements are not Copy.
\n\nlet strings = [\"Ferris\".to_string(), \"♥\".to_string(), \"Rust\".to_string()];\nlet is_ascii = strings.each_ref().map(|s| s.is_ascii());\nassert_eq!(is_ascii, [true, false, true]);\n\n// We can still access the original array: it has not been moved.\nassert_eq!(strings.len(), 3);
\n1.77.0 · sourcepub fn each_mut(&mut self) -> [&mut T; N]
Borrows each element mutably and returns an array of mutable references\nwith the same size as self.
\n§Example
\n\nlet mut floats = [3.1, 2.7, -1.0];\nlet float_refs: [&mut f64; 3] = floats.each_mut();\n*float_refs[0] = 0.0;\nassert_eq!(float_refs, [&mut 0.0, &mut 2.7, &mut -1.0]);\nassert_eq!(floats, [0.0, 2.7, -1.0]);
\nsourcepub fn split_array_ref<const M: usize>(&self) -> (&[T; M], &[T])
🔬This is a nightly-only experimental API. (split_array)
Divides one array reference into two at an index.
\nThe first will contain all indices from [0, M) (excluding\nthe index M itself) and the second will contain all\nindices from [M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet v = [1, 2, 3, 4, 5, 6];\n\n{\n let (left, right) = v.split_array_ref::<0>();\n assert_eq!(left, &[]);\n assert_eq!(right, &[1, 2, 3, 4, 5, 6]);\n}\n\n{\n let (left, right) = v.split_array_ref::<2>();\n assert_eq!(left, &[1, 2]);\n assert_eq!(right, &[3, 4, 5, 6]);\n}\n\n{\n let (left, right) = v.split_array_ref::<6>();\n assert_eq!(left, &[1, 2, 3, 4, 5, 6]);\n assert_eq!(right, &[]);\n}
\nsourcepub fn split_array_mut<const M: usize>(&mut self) -> (&mut [T; M], &mut [T])
🔬This is a nightly-only experimental API. (split_array)
Divides one mutable array reference into two at an index.
\nThe first will contain all indices from [0, M) (excluding\nthe index M itself) and the second will contain all\nindices from [M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet mut v = [1, 0, 3, 0, 5, 6];\nlet (left, right) = v.split_array_mut::<2>();\nassert_eq!(left, &mut [1, 0][..]);\nassert_eq!(right, &mut [3, 0, 5, 6]);\nleft[1] = 2;\nright[1] = 4;\nassert_eq!(v, [1, 2, 3, 4, 5, 6]);
\nsourcepub fn rsplit_array_ref<const M: usize>(&self) -> (&[T], &[T; M])
🔬This is a nightly-only experimental API. (split_array)
Divides one array reference into two at an index from the end.
\nThe first will contain all indices from [0, N - M) (excluding\nthe index N - M itself) and the second will contain all\nindices from [N - M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet v = [1, 2, 3, 4, 5, 6];\n\n{\n let (left, right) = v.rsplit_array_ref::<0>();\n assert_eq!(left, &[1, 2, 3, 4, 5, 6]);\n assert_eq!(right, &[]);\n}\n\n{\n let (left, right) = v.rsplit_array_ref::<2>();\n assert_eq!(left, &[1, 2, 3, 4]);\n assert_eq!(right, &[5, 6]);\n}\n\n{\n let (left, right) = v.rsplit_array_ref::<6>();\n assert_eq!(left, &[]);\n assert_eq!(right, &[1, 2, 3, 4, 5, 6]);\n}
\nsourcepub fn rsplit_array_mut<const M: usize>(&mut self) -> (&mut [T], &mut [T; M])
🔬This is a nightly-only experimental API. (split_array)
Divides one mutable array reference into two at an index from the end.
\nThe first will contain all indices from [0, N - M) (excluding\nthe index N - M itself) and the second will contain all\nindices from [N - M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet mut v = [1, 0, 3, 0, 5, 6];\nlet (left, right) = v.rsplit_array_mut::<4>();\nassert_eq!(left, &mut [1, 0]);\nassert_eq!(right, &mut [3, 0, 5, 6][..]);\nleft[1] = 2;\nright[1] = 4;\nassert_eq!(v, [1, 2, 3, 4, 5, 6]);
\n",0,"iroh_docs::sync::PeerIdBytes"],["source§impl<const N: usize> [u8; N]
sourcepub const fn as_ascii(&self) -> Option<&[AsciiChar; N]>
🔬This is a nightly-only experimental API. (ascii_char)
Converts this array of bytes into a array of ASCII characters,\nor returns None if any of the characters is non-ASCII.
\n§Examples
\n#![feature(ascii_char)]\n#![feature(const_option)]\n\nconst HEX_DIGITS: [std::ascii::Char; 16] =\n *b\"0123456789abcdef\".as_ascii().unwrap();\n\nassert_eq!(HEX_DIGITS[1].as_str(), \"1\");\nassert_eq!(HEX_DIGITS[10].as_str(), \"a\");
\nsourcepub const unsafe fn as_ascii_unchecked(&self) -> &[AsciiChar; N]
🔬This is a nightly-only experimental API. (ascii_char)
Converts this array of bytes into a array of ASCII characters,\nwithout checking whether they’re valid.
\n§Safety
\nEvery byte in the array must be in 0..=127, or else this is UB.
\n",0,"iroh_docs::sync::PeerIdBytes"],["§impl<T> Array for [T; 32]where\n T: Default,
§fn as_slice_mut(&mut self) -> &mut [T]
Gives a unique slice over the whole thing. Read more","Array","iroh_docs::sync::PeerIdBytes"],["","Array","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> AsBytes for [T; N]where\n T: AsBytes,
§fn write_to_prefix(&self, bytes: &mut [u8]) -> Option<()>
","AsBytes","iroh_docs::sync::PeerIdBytes"],["","AsBytes","iroh_docs::sync::PeerIdBytes"],["","AsMut<[T]>","iroh_docs::sync::PeerIdBytes"],["","AsRef<[T]>","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> BitView for [T; N]where\n T: BitStore,
Note that overly-large arrays may cause the conversions to fail.
\n§fn view_bits<O>(&self) -> &BitSlice<T, O>where\n O: BitOrder,
Views a memory region as an immutable bit-slice.§fn try_view_bits<O>(&self) -> Result<&BitSlice<T, O>, BitSpanError<T>>where\n O: BitOrder,
Attempts to view a memory region as an immutable bit-slice. Read more§fn view_bits_mut<O>(&mut self) -> &mut BitSlice<T, O>where\n O: BitOrder,
Views a memory region as a mutable bit-slice.§fn try_view_bits_mut<O>(\n &mut self\n) -> Result<&mut BitSlice<T, O>, BitSpanError<T>>where\n O: BitOrder,
Attempts to view a memory region as a mutable bit-slice. Read more","BitView","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> BitViewSized for [T; N]where\n T: BitStore,
§fn as_raw_slice(&self) -> &[<[T; N] as BitView>::Store]
Views the type as a slice of its elements.§fn as_raw_mut_slice(&mut self) -> &mut [<[T; N] as BitView>::Store]
Views the type as a mutable slice of its elements.§fn into_bitarray<O>(self) -> BitArray<Self, O>where\n O: BitOrder,
Wraps self in a BitArray.","BitViewSized","iroh_docs::sync::PeerIdBytes"],["","Borrow<[T]>","iroh_docs::sync::PeerIdBytes"],["1.4.0 · source§impl<T, const N: usize> BorrowMut<[T]> for [T; N]
source§fn borrow_mut(&mut self) -> &mut [T]
Mutably borrows from an owned value. Read more","BorrowMut<[T]>","iroh_docs::sync::PeerIdBytes"],["","Chain","iroh_docs::sync::PeerIdBytes"],["","Clone","iroh_docs::sync::PeerIdBytes"],["","Debug","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize> Decode for [u8; N]
Decodes a byte array from byte[n] as described in RFC4251 § 5:
\n\nA byte represents an arbitrary 8-bit value (octet). Fixed length\ndata is sometimes represented as an array of bytes, written\nbyte[n], where n is the number of bytes in the array.
\n
\n","Decode","iroh_docs::sync::PeerIdBytes"],["§impl<'a, T, const N: usize> DecodeValue<'a> for [T; N]where\n T: Decode<'a>,
§fn decode_value<R>(reader: &mut R, header: Header) -> Result<[T; N], Error>where\n R: Reader<'a>,
Attempt to decode this message using the provided [Reader].","DecodeValue<'a>","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["source§impl<'de, T> Deserialize<'de> for [T; 32]where\n T: Deserialize<'de>,
source§fn deserialize<D>(\n deserializer: D\n) -> Result<[T; 32], <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more","Deserialize<'de>","iroh_docs::sync::PeerIdBytes"],["source§impl<'de, const N: usize> Deserialize<'de> for [u8; N]
source§fn deserialize<D>(\n deserializer: D\n) -> Result<[u8; N], <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
","Deserialize<'de>","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize> Encode for [u8; N]
Encodes [u8; N] into byte[n] as described in RFC4251 § 5:
\n\nA byte represents an arbitrary 8-bit value (octet). Fixed length\ndata is sometimes represented as an array of bytes, written\nbyte[n], where n is the number of bytes in the array.
\n
\n§fn encoded_len(&self) -> Result<usize, Error>
Get the length of this type encoded in bytes, prior to Base64 encoding.§fn encode(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value using the provided [Writer].§fn encoded_len_prefixed(&self) -> Result<usize, Error>
Return the length of this type after encoding when prepended with a\nuint32 length prefix.§fn encode_prefixed(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value, first prepending a uint32 length prefix\nset to [Encode::encoded_len].","Encode","iroh_docs::sync::PeerIdBytes"],["","EncodeLabelSet","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> EncodeValue for [T; N]where\n T: Encode,
","EncodeValue","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["§impl<'a> FindToken<&'a u8> for [u8; 32]
§fn find_token(&self, token: &u8) -> bool
Returns true if self contains the token","FindToken<&'a u8>","iroh_docs::sync::PeerIdBytes"],["§impl FindToken<u8> for [u8; 32]
§fn find_token(&self, token: u8) -> bool
Returns true if self contains the token","FindToken","iroh_docs::sync::PeerIdBytes"],["","FixedTag","iroh_docs::sync::PeerIdBytes"],["","From<&Signature>","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["§impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>>> for [T; 32]
","From, B0>, B0>, B0>, B0>, B0>>>","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["","From>","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["source§impl From<NamespaceId> for [u8; 32]
source§fn from(value: NamespaceId) -> Self
Converts to this type from the input type.","From","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["","From>","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> FromBytes for [T; N]where\n T: FromBytes,
§fn slice_from_prefix(bytes: &[u8], count: usize) -> Option<(&[Self], &[u8])>where\n Self: Sized,
Interprets the prefix of the given bytes as a &[Self] with length\nequal to count without copying. Read more§fn slice_from_suffix(bytes: &[u8], count: usize) -> Option<(&[u8], &[Self])>where\n Self: Sized,
Interprets the suffix of the given bytes as a &[Self] with length\nequal to count without copying. Read more§fn read_from_prefix(bytes: &[u8]) -> Option<Self>where\n Self: Sized,
","FromBytes","iroh_docs::sync::PeerIdBytes"],["","FromHex","iroh_docs::sync::PeerIdBytes"],["","FromZeroes","iroh_docs::sync::PeerIdBytes"],["","Hash","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Hash for [T; N]where\n T: Hash,
The hash of an array is the same as that of the corresponding slice,\nas required by the Borrow implementation.
\n\nuse std::hash::BuildHasher;\n\nlet b = std::hash::RandomState::new();\nlet a: [u8; 3] = [0xa8, 0x3c, 0x09];\nlet s: &[u8] = &[0xa8, 0x3c, 0x09];\nassert_eq!(b.hash_one(a), b.hash_one(s));
\n","Hash","iroh_docs::sync::PeerIdBytes"],["","Index","iroh_docs::sync::PeerIdBytes"],["","IndexMut","iroh_docs::sync::PeerIdBytes"],["","InputLength","iroh_docs::sync::PeerIdBytes"],["1.53.0 · source§impl<T, const N: usize> IntoIterator for [T; N]
source§fn into_iter(self) -> <[T; N] as IntoIterator>::IntoIter
Creates a consuming iterator, that is, one that moves each value out of\nthe array (from start to end). The array cannot be used after calling\nthis unless T implements Copy, so the whole array is copied.
\nArrays have special behavior when calling .into_iter() prior to the\n2021 edition – see the array Editions section for more information.
\n","IntoIterator","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize> IntoResponse for [u8; N]
§fn into_response(self) -> Response<Body>
Create a response.","IntoResponse","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, const N: usize> Join for [Fut; N]where\n Fut: IntoFuture,
§type Output = [<Fut as IntoFuture>::Output; N]
The resulting output type.§type Future = Join<<Fut as IntoFuture>::IntoFuture, N>
The Future implementation returned by this method.","Join","iroh_docs::sync::PeerIdBytes"],["","Key","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> MaxSize for [T; N]where\n T: MaxSize,
§const POSTCARD_MAX_SIZE: usize = _
The maximum possible size that the serialization of this\ntype can have, in bytes.","MaxSize","iroh_docs::sync::PeerIdBytes"],["","Merge","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Ord for [T; N]where\n T: Ord,
Implements comparison of arrays lexicographically.
\n1.21.0 · source§fn max(self, other: Self) -> Selfwhere\n Self: Sized,
Compares and returns the maximum of two values. Read more","Ord","iroh_docs::sync::PeerIdBytes"],["","PartialEq<&[U]>","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, U, const N: usize> PartialEq<&mut [U]> for [T; N]where\n T: PartialEq<U>,
","PartialEq<&mut [U]>","iroh_docs::sync::PeerIdBytes"],["","PartialEq<[U]>","iroh_docs::sync::PeerIdBytes"],["","PartialEq<[U; N]>","iroh_docs::sync::PeerIdBytes"],["","PartialEq","iroh_docs::sync::PeerIdBytes"],["§impl<A, B, const N: usize, const M: usize> PartialEq<Vec<A, N>> for [B; M]where\n A: PartialEq<B>,
","PartialEq>","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> PartialOrd for [T; N]where\n T: PartialOrd,
Implements comparison of arrays lexicographically.
\nsource§fn le(&self, other: &[T; N]) -> bool
This method tests less than or equal to (for self and other) and is used by the <=\noperator. Read more","PartialOrd","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, const N: usize> Race for [Fut; N]where\n Fut: IntoFuture,
§type Output = <Fut as IntoFuture>::Output
The resulting output type.§type Future = Race<<Fut as IntoFuture>::IntoFuture, N>
Which kind of future are we turning this into?","Race","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, T, E, const N: usize> RaceOk for [Fut; N]where\n Fut: IntoFuture<Output = Result<T, E>>,
§type Future = RaceOk<<Fut as IntoFuture>::IntoFuture, T, E, N>
Which kind of future are we turning this into?","RaceOk","iroh_docs::sync::PeerIdBytes"],["","Schema","iroh_docs::sync::PeerIdBytes"],["source§impl<T> Serialize for [T; 32]where\n T: 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","iroh_docs::sync::PeerIdBytes"],["source§impl<const N: usize> Serialize for [u8; N]
source§fn serialize<S>(\n &self,\n serializer: S\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where\n S: Serializer,
","Serialize","iroh_docs::sync::PeerIdBytes"],["1.51.0 · source§impl<T, const N: usize> SlicePattern for [T; N]
","SlicePattern","iroh_docs::sync::PeerIdBytes"],["1.34.0 · source§impl<T, const N: usize> TryFrom<&[T]> for [T; N]where\n T: Copy,
Tries to create an array [T; N] by copying from a slice &[T]. Succeeds if\nslice.len() == N.
\n\nlet bytes: [u8; 3] = [1, 0, 2];\n\nlet bytes_head: [u8; 2] = <[u8; 2]>::try_from(&bytes[0..2]).unwrap();\nassert_eq!(1, u16::from_le_bytes(bytes_head));\n\nlet bytes_tail: [u8; 2] = bytes[1..3].try_into().unwrap();\nassert_eq!(512, u16::from_le_bytes(bytes_tail));
\n§type Error = TryFromSliceError
The type returned in the event of a conversion error.","TryFrom<&[T]>","iroh_docs::sync::PeerIdBytes"],["1.59.0 · source§impl<T, const N: usize> TryFrom<&mut [T]> for [T; N]where\n T: Copy,
Tries to create an array [T; N] by copying from a mutable slice &mut [T].\nSucceeds if slice.len() == N.
\n\nlet mut bytes: [u8; 3] = [1, 0, 2];\n\nlet bytes_head: [u8; 2] = <[u8; 2]>::try_from(&mut bytes[0..2]).unwrap();\nassert_eq!(1, u16::from_le_bytes(bytes_head));\n\nlet bytes_tail: [u8; 2] = (&mut bytes[1..3]).try_into().unwrap();\nassert_eq!(512, u16::from_le_bytes(bytes_tail));
\n§type Error = TryFromSliceError
The type returned in the event of a conversion error.","TryFrom<&mut [T]>","iroh_docs::sync::PeerIdBytes"],["§impl<T, A, const N: usize> TryFrom<Vec<T, A>> for [T; N]where\n A: Allocator,
§fn try_from(vec: Vec<T, A>) -> Result<[T; N], Vec<T, A>>
Gets the entire contents of the Vec<T> as an array,\nif its size exactly matches that of the requested array.
\n§Examples
\nassert_eq!(vec![1, 2, 3].try_into(), Ok([1, 2, 3]));\nassert_eq!(<Vec<i32>>::new().try_into(), Ok([]));
\nIf the length doesn’t match, the input comes back in Err:
\n\nlet r: Result<[i32; 4], _> = (0..10).collect::<Vec<_>>().try_into();\nassert_eq!(r, Err(vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9]));
\nIf you’re fine with just getting a prefix of the Vec<T>,\nyou can call .truncate(N) first.
\n\nlet mut v = String::from(\"hello world\").into_bytes();\nv.sort();\nv.truncate(2);\nlet [a, b]: [_; 2] = v.try_into().unwrap();\nassert_eq!(a, b' ');\nassert_eq!(b, b'd');
\n","TryFrom>","iroh_docs::sync::PeerIdBytes"],["1.48.0 · source§impl<T, A, const N: usize> TryFrom<Vec<T, A>> for [T; N]where\n A: Allocator,
source§fn try_from(vec: Vec<T, A>) -> Result<[T; N], Vec<T, A>>
Gets the entire contents of the Vec<T> as an array,\nif its size exactly matches that of the requested array.
\n§Examples
\nassert_eq!(vec![1, 2, 3].try_into(), Ok([1, 2, 3]));\nassert_eq!(<Vec<i32>>::new().try_into(), Ok([]));
\nIf the length doesn’t match, the input comes back in Err:
\n\nlet r: Result<[i32; 4], _> = (0..10).collect::<Vec<_>>().try_into();\nassert_eq!(r, Err(vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9]));
\nIf you’re fine with just getting a prefix of the Vec<T>,\nyou can call .truncate(N) first.
\n\nlet mut v = String::from(\"hello world\").into_bytes();\nv.sort();\nv.truncate(2);\nlet [a, b]: [_; 2] = v.try_into().unwrap();\nassert_eq!(a, b' ');\nassert_eq!(b, b'd');
\n","TryFrom>","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, T, E, const N: usize> TryJoin for [Fut; N]where\n Fut: IntoFuture<Output = Result<T, E>>,
§type Future = TryJoin<<Fut as IntoFuture>::IntoFuture, T, E, N>
Which kind of future are we turning this into?","TryJoin","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> Value for [T; N]where\n T: Value,
§type SelfType<'a> = [<T as Value>::SelfType<'a>; N]\nwhere\n [T; N]: 'a
SelfType<’a> must be the same type as Self with all lifetimes replaced with ’a§type AsBytes<'a> = Vec<u8>\nwhere\n [T; N]: 'a
§fn fixed_width() -> Option<usize>
Width of a fixed type, or None for variable width§fn from_bytes<'a>(data: &'a [u8]) -> [<T as Value>::SelfType<'a>; N]where\n [T; N]: 'a,
Deserializes data\nImplementations may return a view over data, or an owned type","Value","iroh_docs::sync::PeerIdBytes"],["","ValueOrd","iroh_docs::sync::PeerIdBytes"],["§impl<Z, const N: usize> Zeroize for [Z; N]where\n Z: Zeroize,
Impl [Zeroize] on arrays of types that impl [Zeroize].
\n","Zeroize","iroh_docs::sync::PeerIdBytes"],["","Zip","iroh_docs::sync::PeerIdBytes"],["source§impl<T, const N: usize> ConstParamTy for [T; N]where\n T: ConstParamTy,
","ConstParamTy","iroh_docs::sync::PeerIdBytes"],["1.58.0 · source§impl<T, const N: usize> Copy for [T; N]where\n T: Copy,
","Copy","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Eq for [T; N]where\n T: Eq,
","Eq","iroh_docs::sync::PeerIdBytes"],["source§impl<T, const N: usize> StructuralPartialEq for [T; N]
","StructuralPartialEq","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> Unaligned for [T; N]where\n T: Unaligned,
","Unaligned","iroh_docs::sync::PeerIdBytes"],["§impl<Z, const N: usize> ZeroizeOnDrop for [Z; N]where\n Z: ZeroizeOnDrop,
Impl [ZeroizeOnDrop] on arrays of types that impl [ZeroizeOnDrop].
\n","ZeroizeOnDrop","iroh_docs::sync::PeerIdBytes"]]
+"iroh_docs":[["source§impl<T, const N: usize> [T; N]
1.55.0 · sourcepub fn map<F, U>(self, f: F) -> [U; N]where\n F: FnMut(T) -> U,
Returns an array of the same size as self, with function f applied to each element\nin order.
\nIf you don’t necessarily need a new fixed-size array, consider using\nIterator::map instead.
\n§Note on performance and stack usage
\nUnfortunately, usages of this method are currently not always optimized\nas well as they could be. This mainly concerns large arrays, as mapping\nover small arrays seem to be optimized just fine. Also note that in\ndebug mode (i.e. without any optimizations), this method can use a lot\nof stack space (a few times the size of the array or more).
\nTherefore, in performance-critical code, try to avoid using this method\non large arrays or check the emitted code. Also try to avoid chained\nmaps (e.g. arr.map(...).map(...)).
\nIn many cases, you can instead use Iterator::map by calling .iter()\nor .into_iter() on your array. [T; N]::map is only necessary if you\nreally need a new array of the same size as the result. Rust’s lazy\niterators tend to get optimized very well.
\n§Examples
\nlet x = [1, 2, 3];\nlet y = x.map(|v| v + 1);\nassert_eq!(y, [2, 3, 4]);\n\nlet x = [1, 2, 3];\nlet mut temp = 0;\nlet y = x.map(|v| { temp += 1; v * temp });\nassert_eq!(y, [1, 4, 9]);\n\nlet x = [\"Ferris\", \"Bueller's\", \"Day\", \"Off\"];\nlet y = x.map(|v| v.len());\nassert_eq!(y, [6, 9, 3, 3]);
\nsourcepub fn try_map<F, R>(\n self,\n f: F\n) -> <<R as Try>::Residual as Residual<[<R as Try>::Output; N]>>::TryType
🔬This is a nightly-only experimental API. (array_try_map)
A fallible function f applied to each element on array self in order to\nreturn an array the same size as self or the first error encountered.
\nThe return type of this function depends on the return type of the closure.\nIf you return Result<T, E> from the closure, you’ll get a Result<[T; N], E>.\nIf you return Option<T> from the closure, you’ll get an Option<[T; N]>.
\n§Examples
\n#![feature(array_try_map)]\n\nlet a = [\"1\", \"2\", \"3\"];\nlet b = a.try_map(|v| v.parse::<u32>()).unwrap().map(|v| v + 1);\nassert_eq!(b, [2, 3, 4]);\n\nlet a = [\"1\", \"2a\", \"3\"];\nlet b = a.try_map(|v| v.parse::<u32>());\nassert!(b.is_err());\n\nuse std::num::NonZero;\n\nlet z = [1, 2, 0, 3, 4];\nassert_eq!(z.try_map(NonZero::new), None);\n\nlet a = [1, 2, 3];\nlet b = a.try_map(NonZero::new);\nlet c = b.map(|x| x.map(NonZero::get));\nassert_eq!(c, Some(a));
\n1.57.0 (const: 1.57.0) · sourcepub const fn as_slice(&self) -> &[T]
Returns a slice containing the entire array. Equivalent to &s[..].
\n1.57.0 · sourcepub fn as_mut_slice(&mut self) -> &mut [T]
Returns a mutable slice containing the entire array. Equivalent to\n&mut s[..].
\n1.77.0 · sourcepub fn each_ref(&self) -> [&T; N]
Borrows each element and returns an array of references with the same\nsize as self.
\n§Example
\nlet floats = [3.1, 2.7, -1.0];\nlet float_refs: [&f64; 3] = floats.each_ref();\nassert_eq!(float_refs, [&3.1, &2.7, &-1.0]);
\nThis method is particularly useful if combined with other methods, like\nmap. This way, you can avoid moving the original\narray if its elements are not Copy.
\n\nlet strings = [\"Ferris\".to_string(), \"♥\".to_string(), \"Rust\".to_string()];\nlet is_ascii = strings.each_ref().map(|s| s.is_ascii());\nassert_eq!(is_ascii, [true, false, true]);\n\n// We can still access the original array: it has not been moved.\nassert_eq!(strings.len(), 3);
\n1.77.0 · sourcepub fn each_mut(&mut self) -> [&mut T; N]
Borrows each element mutably and returns an array of mutable references\nwith the same size as self.
\n§Example
\n\nlet mut floats = [3.1, 2.7, -1.0];\nlet float_refs: [&mut f64; 3] = floats.each_mut();\n*float_refs[0] = 0.0;\nassert_eq!(float_refs, [&mut 0.0, &mut 2.7, &mut -1.0]);\nassert_eq!(floats, [0.0, 2.7, -1.0]);
\nsourcepub fn split_array_ref<const M: usize>(&self) -> (&[T; M], &[T])
🔬This is a nightly-only experimental API. (split_array)
Divides one array reference into two at an index.
\nThe first will contain all indices from [0, M) (excluding\nthe index M itself) and the second will contain all\nindices from [M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet v = [1, 2, 3, 4, 5, 6];\n\n{\n let (left, right) = v.split_array_ref::<0>();\n assert_eq!(left, &[]);\n assert_eq!(right, &[1, 2, 3, 4, 5, 6]);\n}\n\n{\n let (left, right) = v.split_array_ref::<2>();\n assert_eq!(left, &[1, 2]);\n assert_eq!(right, &[3, 4, 5, 6]);\n}\n\n{\n let (left, right) = v.split_array_ref::<6>();\n assert_eq!(left, &[1, 2, 3, 4, 5, 6]);\n assert_eq!(right, &[]);\n}
\nsourcepub fn split_array_mut<const M: usize>(&mut self) -> (&mut [T; M], &mut [T])
🔬This is a nightly-only experimental API. (split_array)
Divides one mutable array reference into two at an index.
\nThe first will contain all indices from [0, M) (excluding\nthe index M itself) and the second will contain all\nindices from [M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet mut v = [1, 0, 3, 0, 5, 6];\nlet (left, right) = v.split_array_mut::<2>();\nassert_eq!(left, &mut [1, 0][..]);\nassert_eq!(right, &mut [3, 0, 5, 6]);\nleft[1] = 2;\nright[1] = 4;\nassert_eq!(v, [1, 2, 3, 4, 5, 6]);
\nsourcepub fn rsplit_array_ref<const M: usize>(&self) -> (&[T], &[T; M])
🔬This is a nightly-only experimental API. (split_array)
Divides one array reference into two at an index from the end.
\nThe first will contain all indices from [0, N - M) (excluding\nthe index N - M itself) and the second will contain all\nindices from [N - M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet v = [1, 2, 3, 4, 5, 6];\n\n{\n let (left, right) = v.rsplit_array_ref::<0>();\n assert_eq!(left, &[1, 2, 3, 4, 5, 6]);\n assert_eq!(right, &[]);\n}\n\n{\n let (left, right) = v.rsplit_array_ref::<2>();\n assert_eq!(left, &[1, 2, 3, 4]);\n assert_eq!(right, &[5, 6]);\n}\n\n{\n let (left, right) = v.rsplit_array_ref::<6>();\n assert_eq!(left, &[]);\n assert_eq!(right, &[1, 2, 3, 4, 5, 6]);\n}
\nsourcepub fn rsplit_array_mut<const M: usize>(&mut self) -> (&mut [T], &mut [T; M])
🔬This is a nightly-only experimental API. (split_array)
Divides one mutable array reference into two at an index from the end.
\nThe first will contain all indices from [0, N - M) (excluding\nthe index N - M itself) and the second will contain all\nindices from [N - M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet mut v = [1, 0, 3, 0, 5, 6];\nlet (left, right) = v.rsplit_array_mut::<4>();\nassert_eq!(left, &mut [1, 0]);\nassert_eq!(right, &mut [3, 0, 5, 6][..]);\nleft[1] = 2;\nright[1] = 4;\nassert_eq!(v, [1, 2, 3, 4, 5, 6]);
\n",0,"iroh_docs::sync::PeerIdBytes"],["source§impl<const N: usize> [u8; N]
sourcepub const fn as_ascii(&self) -> Option<&[AsciiChar; N]>
🔬This is a nightly-only experimental API. (ascii_char)
Converts this array of bytes into a array of ASCII characters,\nor returns None if any of the characters is non-ASCII.
\n§Examples
\n#![feature(ascii_char)]\n#![feature(const_option)]\n\nconst HEX_DIGITS: [std::ascii::Char; 16] =\n *b\"0123456789abcdef\".as_ascii().unwrap();\n\nassert_eq!(HEX_DIGITS[1].as_str(), \"1\");\nassert_eq!(HEX_DIGITS[10].as_str(), \"a\");
\nsourcepub const unsafe fn as_ascii_unchecked(&self) -> &[AsciiChar; N]
🔬This is a nightly-only experimental API. (ascii_char)
Converts this array of bytes into a array of ASCII characters,\nwithout checking whether they’re valid.
\n§Safety
\nEvery byte in the array must be in 0..=127, or else this is UB.
\n",0,"iroh_docs::sync::PeerIdBytes"],["§impl<T> Array for [T; 32]where\n T: Default,
§fn as_slice_mut(&mut self) -> &mut [T]
Gives a unique slice over the whole thing. Read more","Array","iroh_docs::sync::PeerIdBytes"],["","Array","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> AsBytes for [T; N]where\n T: AsBytes,
§fn write_to_prefix(&self, bytes: &mut [u8]) -> Option<()>
","AsBytes","iroh_docs::sync::PeerIdBytes"],["","AsBytes","iroh_docs::sync::PeerIdBytes"],["","AsMut<[T]>","iroh_docs::sync::PeerIdBytes"],["","AsRef<[T]>","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> BitView for [T; N]where\n T: BitStore,
Note that overly-large arrays may cause the conversions to fail.
\n§fn view_bits<O>(&self) -> &BitSlice<T, O>where\n O: BitOrder,
Views a memory region as an immutable bit-slice.§fn try_view_bits<O>(&self) -> Result<&BitSlice<T, O>, BitSpanError<T>>where\n O: BitOrder,
Attempts to view a memory region as an immutable bit-slice. Read more§fn view_bits_mut<O>(&mut self) -> &mut BitSlice<T, O>where\n O: BitOrder,
Views a memory region as a mutable bit-slice.§fn try_view_bits_mut<O>(\n &mut self\n) -> Result<&mut BitSlice<T, O>, BitSpanError<T>>where\n O: BitOrder,
Attempts to view a memory region as a mutable bit-slice. Read more","BitView","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> BitViewSized for [T; N]where\n T: BitStore,
§fn as_raw_slice(&self) -> &[<[T; N] as BitView>::Store]
Views the type as a slice of its elements.§fn as_raw_mut_slice(&mut self) -> &mut [<[T; N] as BitView>::Store]
Views the type as a mutable slice of its elements.§fn into_bitarray<O>(self) -> BitArray<Self, O>where\n O: BitOrder,
Wraps self in a BitArray.","BitViewSized","iroh_docs::sync::PeerIdBytes"],["","Borrow<[T]>","iroh_docs::sync::PeerIdBytes"],["1.4.0 · source§impl<T, const N: usize> BorrowMut<[T]> for [T; N]
source§fn borrow_mut(&mut self) -> &mut [T]
Mutably borrows from an owned value. Read more","BorrowMut<[T]>","iroh_docs::sync::PeerIdBytes"],["","Chain","iroh_docs::sync::PeerIdBytes"],["","Clone","iroh_docs::sync::PeerIdBytes"],["","Debug","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize> Decode for [u8; N]
Decodes a byte array from byte[n] as described in RFC4251 § 5:
\n\nA byte represents an arbitrary 8-bit value (octet). Fixed length\ndata is sometimes represented as an array of bytes, written\nbyte[n], where n is the number of bytes in the array.
\n
\n","Decode","iroh_docs::sync::PeerIdBytes"],["§impl<'a, T, const N: usize> DecodeValue<'a> for [T; N]where\n T: Decode<'a>,
§fn decode_value<R>(reader: &mut R, header: Header) -> Result<[T; N], Error>where\n R: Reader<'a>,
Attempt to decode this message using the provided [Reader].","DecodeValue<'a>","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["source§impl<'de, T> Deserialize<'de> for [T; 32]where\n T: Deserialize<'de>,
source§fn deserialize<D>(\n deserializer: D\n) -> Result<[T; 32], <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more","Deserialize<'de>","iroh_docs::sync::PeerIdBytes"],["source§impl<'de, const N: usize> Deserialize<'de> for [u8; N]
source§fn deserialize<D>(\n deserializer: D\n) -> Result<[u8; N], <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
","Deserialize<'de>","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize> Encode for [u8; N]
Encodes [u8; N] into byte[n] as described in RFC4251 § 5:
\n\nA byte represents an arbitrary 8-bit value (octet). Fixed length\ndata is sometimes represented as an array of bytes, written\nbyte[n], where n is the number of bytes in the array.
\n
\n§fn encoded_len(&self) -> Result<usize, Error>
Get the length of this type encoded in bytes, prior to Base64 encoding.§fn encode(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value using the provided [Writer].§fn encoded_len_prefixed(&self) -> Result<usize, Error>
Return the length of this type after encoding when prepended with a\nuint32 length prefix.§fn encode_prefixed(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value, first prepending a uint32 length prefix\nset to [Encode::encoded_len].","Encode","iroh_docs::sync::PeerIdBytes"],["","EncodeLabelSet","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> EncodeValue for [T; N]where\n T: Encode,
","EncodeValue","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["§impl<'a> FindToken<&'a u8> for [u8; 32]
§fn find_token(&self, token: &u8) -> bool
Returns true if self contains the token","FindToken<&'a u8>","iroh_docs::sync::PeerIdBytes"],["§impl FindToken<u8> for [u8; 32]
§fn find_token(&self, token: u8) -> bool
Returns true if self contains the token","FindToken","iroh_docs::sync::PeerIdBytes"],["","FixedTag","iroh_docs::sync::PeerIdBytes"],["","From<&Signature>","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["§impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>>> for [T; 32]
","From, B0>, B0>, B0>, B0>, B0>>>","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["","From>","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["source§impl From<NamespaceId> for [u8; 32]
source§fn from(value: NamespaceId) -> Self
Converts to this type from the input type.","From","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["","From>","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> FromBytes for [T; N]where\n T: FromBytes,
§fn slice_from_prefix(bytes: &[u8], count: usize) -> Option<(&[Self], &[u8])>where\n Self: Sized,
Interprets the prefix of the given bytes as a &[Self] with length\nequal to count without copying. Read more§fn slice_from_suffix(bytes: &[u8], count: usize) -> Option<(&[u8], &[Self])>where\n Self: Sized,
Interprets the suffix of the given bytes as a &[Self] with length\nequal to count without copying. Read more§fn read_from_prefix(bytes: &[u8]) -> Option<Self>where\n Self: Sized,
","FromBytes","iroh_docs::sync::PeerIdBytes"],["","FromHex","iroh_docs::sync::PeerIdBytes"],["","FromZeroes","iroh_docs::sync::PeerIdBytes"],["","Hash","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Hash for [T; N]where\n T: Hash,
The hash of an array is the same as that of the corresponding slice,\nas required by the Borrow implementation.
\n\nuse std::hash::BuildHasher;\n\nlet b = std::hash::RandomState::new();\nlet a: [u8; 3] = [0xa8, 0x3c, 0x09];\nlet s: &[u8] = &[0xa8, 0x3c, 0x09];\nassert_eq!(b.hash_one(a), b.hash_one(s));
\n","Hash","iroh_docs::sync::PeerIdBytes"],["","Index","iroh_docs::sync::PeerIdBytes"],["","IndexMut","iroh_docs::sync::PeerIdBytes"],["","InputLength","iroh_docs::sync::PeerIdBytes"],["1.53.0 · source§impl<T, const N: usize> IntoIterator for [T; N]
source§fn into_iter(self) -> <[T; N] as IntoIterator>::IntoIter
Creates a consuming iterator, that is, one that moves each value out of\nthe array (from start to end). The array cannot be used after calling\nthis unless T implements Copy, so the whole array is copied.
\nArrays have special behavior when calling .into_iter() prior to the\n2021 edition – see the array Editions section for more information.
\n","IntoIterator","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize> IntoResponse for [u8; N]
§fn into_response(self) -> Response<Body>
Create a response.","IntoResponse","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, const N: usize> Join for [Fut; N]where\n Fut: IntoFuture,
§type Output = [<Fut as IntoFuture>::Output; N]
The resulting output type.§type Future = Join<<Fut as IntoFuture>::IntoFuture, N>
The Future implementation returned by this method.","Join","iroh_docs::sync::PeerIdBytes"],["","Key","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> MaxSize for [T; N]where\n T: MaxSize,
§const POSTCARD_MAX_SIZE: usize = _
The maximum possible size that the serialization of this\ntype can have, in bytes.","MaxSize","iroh_docs::sync::PeerIdBytes"],["","Merge","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Ord for [T; N]where\n T: Ord,
Implements comparison of arrays lexicographically.
\n1.21.0 · source§fn max(self, other: Self) -> Selfwhere\n Self: Sized,
Compares and returns the maximum of two values. Read more","Ord","iroh_docs::sync::PeerIdBytes"],["","PartialEq<&[U]>","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, U, const N: usize> PartialEq<&mut [U]> for [T; N]where\n T: PartialEq<U>,
","PartialEq<&mut [U]>","iroh_docs::sync::PeerIdBytes"],["","PartialEq<[U]>","iroh_docs::sync::PeerIdBytes"],["","PartialEq<[U; N]>","iroh_docs::sync::PeerIdBytes"],["","PartialEq","iroh_docs::sync::PeerIdBytes"],["§impl<A, B, const N: usize, const M: usize> PartialEq<Vec<A, N>> for [B; M]where\n A: PartialEq<B>,
","PartialEq>","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> PartialOrd for [T; N]where\n T: PartialOrd,
Implements comparison of arrays lexicographically.
\nsource§fn le(&self, other: &[T; N]) -> bool
This method tests less than or equal to (for self and other) and is used by the <=\noperator. Read more","PartialOrd","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, const N: usize> Race for [Fut; N]where\n Fut: IntoFuture,
§type Output = <Fut as IntoFuture>::Output
The resulting output type.§type Future = Race<<Fut as IntoFuture>::IntoFuture, N>
Which kind of future are we turning this into?","Race","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, T, E, const N: usize> RaceOk for [Fut; N]where\n Fut: IntoFuture<Output = Result<T, E>>,
§type Future = RaceOk<<Fut as IntoFuture>::IntoFuture, T, E, N>
Which kind of future are we turning this into?","RaceOk","iroh_docs::sync::PeerIdBytes"],["","Schema","iroh_docs::sync::PeerIdBytes"],["source§impl<T> Serialize for [T; 32]where\n T: 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","iroh_docs::sync::PeerIdBytes"],["source§impl<const N: usize> Serialize for [u8; N]
source§fn serialize<S>(\n &self,\n serializer: S\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where\n S: Serializer,
","Serialize","iroh_docs::sync::PeerIdBytes"],["1.51.0 · source§impl<T, const N: usize> SlicePattern for [T; N]
","SlicePattern","iroh_docs::sync::PeerIdBytes"],["1.34.0 · source§impl<T, const N: usize> TryFrom<&[T]> for [T; N]where\n T: Copy,
Tries to create an array [T; N] by copying from a slice &[T]. Succeeds if\nslice.len() == N.
\n\nlet bytes: [u8; 3] = [1, 0, 2];\n\nlet bytes_head: [u8; 2] = <[u8; 2]>::try_from(&bytes[0..2]).unwrap();\nassert_eq!(1, u16::from_le_bytes(bytes_head));\n\nlet bytes_tail: [u8; 2] = bytes[1..3].try_into().unwrap();\nassert_eq!(512, u16::from_le_bytes(bytes_tail));
\n§type Error = TryFromSliceError
The type returned in the event of a conversion error.","TryFrom<&[T]>","iroh_docs::sync::PeerIdBytes"],["1.59.0 · source§impl<T, const N: usize> TryFrom<&mut [T]> for [T; N]where\n T: Copy,
Tries to create an array [T; N] by copying from a mutable slice &mut [T].\nSucceeds if slice.len() == N.
\n\nlet mut bytes: [u8; 3] = [1, 0, 2];\n\nlet bytes_head: [u8; 2] = <[u8; 2]>::try_from(&mut bytes[0..2]).unwrap();\nassert_eq!(1, u16::from_le_bytes(bytes_head));\n\nlet bytes_tail: [u8; 2] = (&mut bytes[1..3]).try_into().unwrap();\nassert_eq!(512, u16::from_le_bytes(bytes_tail));
\n§type Error = TryFromSliceError
The type returned in the event of a conversion error.","TryFrom<&mut [T]>","iroh_docs::sync::PeerIdBytes"],["§impl<T, A, const N: usize> TryFrom<Vec<T, A>> for [T; N]where\n A: Allocator,
§fn try_from(vec: Vec<T, A>) -> Result<[T; N], Vec<T, A>>
Gets the entire contents of the Vec<T> as an array,\nif its size exactly matches that of the requested array.
\n§Examples
\nassert_eq!(vec![1, 2, 3].try_into(), Ok([1, 2, 3]));\nassert_eq!(<Vec<i32>>::new().try_into(), Ok([]));
\nIf the length doesn’t match, the input comes back in Err:
\n\nlet r: Result<[i32; 4], _> = (0..10).collect::<Vec<_>>().try_into();\nassert_eq!(r, Err(vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9]));
\nIf you’re fine with just getting a prefix of the Vec<T>,\nyou can call .truncate(N) first.
\n\nlet mut v = String::from(\"hello world\").into_bytes();\nv.sort();\nv.truncate(2);\nlet [a, b]: [_; 2] = v.try_into().unwrap();\nassert_eq!(a, b' ');\nassert_eq!(b, b'd');
\n","TryFrom>","iroh_docs::sync::PeerIdBytes"],["1.48.0 · source§impl<T, A, const N: usize> TryFrom<Vec<T, A>> for [T; N]where\n A: Allocator,
source§fn try_from(vec: Vec<T, A>) -> Result<[T; N], Vec<T, A>>
Gets the entire contents of the Vec<T> as an array,\nif its size exactly matches that of the requested array.
\n§Examples
\nassert_eq!(vec![1, 2, 3].try_into(), Ok([1, 2, 3]));\nassert_eq!(<Vec<i32>>::new().try_into(), Ok([]));
\nIf the length doesn’t match, the input comes back in Err:
\n\nlet r: Result<[i32; 4], _> = (0..10).collect::<Vec<_>>().try_into();\nassert_eq!(r, Err(vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9]));
\nIf you’re fine with just getting a prefix of the Vec<T>,\nyou can call .truncate(N) first.
\n\nlet mut v = String::from(\"hello world\").into_bytes();\nv.sort();\nv.truncate(2);\nlet [a, b]: [_; 2] = v.try_into().unwrap();\nassert_eq!(a, b' ');\nassert_eq!(b, b'd');
\n","TryFrom>","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, T, E, const N: usize> TryJoin for [Fut; N]where\n Fut: IntoFuture<Output = Result<T, E>>,
§type Future = TryJoin<<Fut as IntoFuture>::IntoFuture, T, E, N>
Which kind of future are we turning this into?","TryJoin","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> Value for [T; N]where\n T: Value,
§type SelfType<'a> = [<T as Value>::SelfType<'a>; N]\nwhere\n [T; N]: 'a
SelfType<’a> must be the same type as Self with all lifetimes replaced with ’a§type AsBytes<'a> = Vec<u8>\nwhere\n [T; N]: 'a
§fn fixed_width() -> Option<usize>
Width of a fixed type, or None for variable width§fn from_bytes<'a>(data: &'a [u8]) -> [<T as Value>::SelfType<'a>; N]where\n [T; N]: 'a,
Deserializes data\nImplementations may return a view over data, or an owned type","Value","iroh_docs::sync::PeerIdBytes"],["","ValueOrd","iroh_docs::sync::PeerIdBytes"],["§impl<Z, const N: usize> Zeroize for [Z; N]where\n Z: Zeroize,
Impl [Zeroize] on arrays of types that impl [Zeroize].
\n","Zeroize","iroh_docs::sync::PeerIdBytes"],["","Zip","iroh_docs::sync::PeerIdBytes"],["source§impl<T, const N: usize> ConstParamTy for [T; N]where\n T: ConstParamTy,
","ConstParamTy","iroh_docs::sync::PeerIdBytes"],["1.58.0 · source§impl<T, const N: usize> Copy for [T; N]where\n T: Copy,
","Copy","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Eq for [T; N]where\n T: Eq,
","Eq","iroh_docs::sync::PeerIdBytes"],["source§impl<T, const N: usize> StructuralPartialEq for [T; N]
","StructuralPartialEq","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> Unaligned for [T; N]where\n T: Unaligned,
","Unaligned","iroh_docs::sync::PeerIdBytes"],["§impl<Z, const N: usize> ZeroizeOnDrop for [Z; N]where\n Z: ZeroizeOnDrop,
Impl [ZeroizeOnDrop] on arrays of types that impl [ZeroizeOnDrop].
\n","ZeroizeOnDrop","iroh_docs::sync::PeerIdBytes"]]
};if (window.register_type_impls) {window.register_type_impls(type_impls);} else {window.pending_type_impls = type_impls;}})()
\ No newline at end of file
Expand description
Events informing about actions of the live sync progress.
InsertLocal
A local insertion.
InsertRemote
Received a remote insert.
-Fields
from: PublicKeyThe peer that sent us the entry.
+Fields
content_status: ContentStatusIf the content is available at the local node
ContentReady
The content of an entry was downloaded and is now available at the local node
-Fields
hash: HashThe content hash of the newly available entry content
+PendingContentReady
All pending content is now ready.
This event signals that all queued content downloads from the last sync run have either completed or failed.
It will only be emitted after a Self::SyncFinished event, never before.
Receiving this event does not guarantee that all content in the document is available. If blobs failed to download, this event will still be emitted after all operations completed.
-NeighborUp(PublicKey)
We have a new neighbor in the swarm.
-NeighborDown(PublicKey)
We lost a neighbor in the swarm.
+NeighborUp(PublicKey)
We have a new neighbor in the swarm.
+NeighborDown(PublicKey)
We lost a neighbor in the swarm.
SyncFinished(SyncEvent)
A set-reconciliation sync finished.
Trait Implementations§
source§impl<'de> Deserialize<'de> for LiveEvent
impl<'de> Deserialize<'de> for LiveEvent
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
source§impl PartialEq for LiveEvent
impl PartialEq for LiveEvent
source§fn eq(&self, other: &LiveEvent) -> bool
fn eq(&self, other: &LiveEvent) -> bool
self and other values to be equal, and is used
diff --git a/pr/2595/docs/iroh_docs/engine/fn.entry_to_content_status.html b/pr/2595/docs/iroh_docs/engine/fn.entry_to_content_status.html
index 459a6719d2..3b39df6428 100644
--- a/pr/2595/docs/iroh_docs/engine/fn.entry_to_content_status.html
+++ b/pr/2595/docs/iroh_docs/engine/fn.entry_to_content_status.html
@@ -1,2 +1,2 @@
-Function iroh_docs::engine::entry_to_content_status
source · pub fn entry_to_content_status(entry: Result<EntryStatus>) -> ContentStatusExpand description
Converts an [EntryStatus] into a [‘ContentStatus’].
Function iroh_docs::engine::entry_to_content_status
source · pub fn entry_to_content_status(entry: Result<EntryStatus>) -> ContentStatusExpand description
Converts an EntryStatus into a [‘ContentStatus’].
Expand description
Handlers and actors to for live syncing replicas.
crate::Replica is also called documents here.
Structs§
- Persistent default author for a docs engine.
- The sync engine coordinates actors that manage open documents, set-reconciliation syncs with -peers and a gossip swarm for each syncing document.
- Event emitted when a sync operation completes
Enums§
- Where to persist the default author.
- Events informing about actions of the live sync progress.
- Why we performed a sync exchange
- Why we started a sync request
Functions§
- Converts an [
EntryStatus] into a [‘ContentStatus’].
Enums§
- Where to persist the default author.
- Events informing about actions of the live sync progress.
- Why we performed a sync exchange
- Why we started a sync request
Functions§
- Converts an
EntryStatusinto a [‘ContentStatus’].
Fields§
§endpoint: EndpointEndpoint used by the engine.
sync: SyncHandleHandle to the actor thread.
The persistent default author for this engine.
-Implementations§
source§impl Engine
impl Engine
Implementations§
source§impl Engine
impl Engine
sourcepub async fn spawn<B: Store>(
endpoint: Endpoint,
- gossip: Gossip,
+ gossip: Gossip,
replica_store: Store,
bao_store: B,
- downloader: Downloader,
+ downloader: Downloader,
default_author_storage: DefaultAuthorStorage
) -> Result<Self>
pub async fn spawn<B: Store>( endpoint: Endpoint, - gossip: Gossip, + gossip: Gossip, replica_store: Store, bao_store: B, - downloader: Downloader, + downloader: Downloader, default_author_storage: DefaultAuthorStorage ) -> Result<Self>
Start the sync engine.
This will spawn two tokio tasks for the live sync coordination and gossip actors, and a
@@ -21,7 +21,7 @@ thread for the Start to sync a document. If Event emitted when a sync operation completes Peer we synced with Peer we synced with Origin of the sync exchange Timestamp when the sync started Timestamp when the sync finished Multi-dimensional key-value documents with an efficient synchronization protocol The crate operates on Replicas. A replica contains an unlimited number of
Entries. Each entry is identified by a key, its author, and the replica’s
-namespace. Its value is the 32-byte BLAKE3 hash
+namespace. Its value is the 32-byte BLAKE3 hash
of the entry’s content data, the size of this content data, and a timestamp.
The content data itself is not stored or transferred through a replica. All entries in a replica are signed with two keypairs: Errors that may occur on handling incoming sync connections. Failed to establish connection Failed to open replica We aborted the sync request. Failed to run sync Failed to close Connect to a peer and sync a replica Handle an iroh-docs connection and sync all shared documents in the replica store. Details of a finished sync operation. The namespace that was synced. The peer we syned with. The peer we syned with. The outcome of the sync operation The time this operation tookpub async fn start_sync(
&self,
namespace: NamespaceId,
- peers: Vec<NodeAddr>
+ peers: Vec<NodeAddr>
) -> Result<()>
peers is non-empty, it will both do an initial set-reconciliation sync with each peer,
and join an iroh-gossip swarm with these peers to receive and broadcast document updates.pub struct SyncEvent {
- pub peer: PublicKey,
+ pub peer: PublicKey,
pub origin: Origin,
pub finished: SystemTime,
pub started: SystemTime,
pub result: Result<SyncDetails, String>,
}Expand description
Fields§
§peer: PublicKeyFields§
§peer: PublicKeyorigin: Originfinished: SystemTimestarted: SystemTimeExpand description
Expand description
Variants§
Connect
Open
Abort
Sync
Close
Implementations§
impl AcceptError
Implementations§
Trait Implementations§
impl Debug for AcceptError
impl Display for AcceptError
impl Error for AcceptError
fn source(&self) -> Option<&(dyn Error + 'static)>
fn description(&self) -> &str
Auto Trait Implementations§
impl Freeze for AcceptError
impl RefUnwindSafe for AcceptError
impl Send for AcceptError
impl Sync for AcceptError
impl Unpin for AcceptError
impl UnwindSafe for AcceptError
Blanket Implementations§
impl<'a, T, E> AsTaggedExplicit<'a, E> for T
Expand description
Expand description
Struct iroh_docs::
source · pub struct SyncFinished {
pub namespace: NamespaceId,
- pub peer: PublicKey,
+ pub peer: PublicKey,
pub outcome: SyncOutcome,
pub timings: Timings,
}Expand description
Fields§
§namespace: NamespaceIdpeer: PublicKeypeer: PublicKeyoutcome: SyncOutcometimings: TimingsTrait Implementations§
impl Clone for SyncFinished
fn clone(&self) -> SyncFinished
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for SyncFinished
impl RefUnwindSafe for SyncFinished
impl Send for SyncFinished
impl Sync for SyncFinished
impl Unpin for SyncFinished
impl UnwindSafe for SyncFinished
Blanket Implementations§
impl<T> Any for T
Implementations§
Trait Implementations§
impl Debug for ContentHashesIterator
Trait Implementations§
impl Debug for ContentHashesIterator
impl Iterator for ContentHashesIterator
fn next(&mut self) -> Option<Self::Item>
fn next_chunk<const N: usize>(
&mut self
) -> Result<[Self::Item; N], IntoIter<Self::Item, N>>
iter_next_chunk)N values. Read morefn size_hint(&self) -> (usize, Option<usize>)
fn count(self) -> usize
F9B4CA)fn with_current_subscriber(self) -> WithDispatch<Self>
impl<T> DeserializeOwned for T
impl<T> PeerIdentity for T
impl<T> PeerIdentity for T
impl<T> RuleType for T
fn with_current_subscriber(self) -> WithDispatch<Self>
impl<T> DeserializeOwned for T
impl<T> PeerIdentity for T
impl<T> PeerIdentity for T
impl<T> RuleType for T
pub struct DocTicket {
pub capability: Capability,
- pub nodes: Vec<NodeAddr>,
+ pub nodes: Vec<NodeAddr>,
}Expand description
Contains both a key (either secret or public) to a document, and a list of peers to join.
Fields§
§capability: Capabilityeither a public or private key
-nodes: Vec<NodeAddr>A list of nodes to contact.
-Implementations§
source§impl DocTicket
impl DocTicket
sourcepub fn new(capability: Capability, peers: Vec<NodeAddr>) -> Self
pub fn new(capability: Capability, peers: Vec<NodeAddr>) -> Self
Create a new doc ticket
+nodes: Vec<NodeAddr>A list of nodes to contact.
+Implementations§
Trait Implementations§
source§impl<'de> Deserialize<'de> for DocTicket
impl<'de> Deserialize<'de> for DocTicket
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
- __D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
- __D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for DocTicket
impl RefUnwindSafe for DocTicket
impl Send for DocTicket
impl Sync for DocTicket
impl Unpin for DocTicket
impl UnwindSafe for DocTicket
Blanket Implementations§
source§impl<T> Any for Twhere
+ __D: Deserializer<'de>,
impl<T> Any for Twhere
+ __D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for DocTicket
impl RefUnwindSafe for DocTicket
impl Send for DocTicket
impl Sync for DocTicket
impl Unpin for DocTicket
impl UnwindSafe for DocTicket
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
diff --git a/pr/2595/docs/iroh_docs/struct.NamespaceId.html b/pr/2595/docs/iroh_docs/struct.NamespaceId.html
index 433d51afc6..f9acda8e94 100644
--- a/pr/2595/docs/iroh_docs/struct.NamespaceId.html
+++ b/pr/2595/docs/iroh_docs/struct.NamespaceId.html
@@ -156,6 +156,6 @@ letters are used (e.g. F9B4CA)
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
diff --git a/pr/2595/docs/iroh_docs/struct.NamespaceId.html b/pr/2595/docs/iroh_docs/struct.NamespaceId.html
index 433d51afc6..f9acda8e94 100644
--- a/pr/2595/docs/iroh_docs/struct.NamespaceId.html
+++ b/pr/2595/docs/iroh_docs/struct.NamespaceId.html
@@ -156,6 +156,6 @@ letters are used (e.g. F9B4CA)
F9B4CA)source§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
impl<T> DeserializeOwned for Twhere
- T: for<'de> Deserialize<'de>,
impl<T> PeerIdentity for Twhere
+ T: for<'de> Deserialize<'de>,
impl<T> PeerIdentity for T
impl<T> RuleType for T
source§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
impl<T> DeserializeOwned for Twhere
- T: for<'de> Deserialize<'de>,
impl<T> PeerIdentity for Twhere
+ T: for<'de> Deserialize<'de>,
impl<T> PeerIdentity for T
impl<T> RuleType for T
pub struct Entry { /* private fields */ }Expand description
A single entry in a Replica
An entry is identified by a key, its Author, and the Replica’s
-NamespaceSecret. Its value is the 32-byte BLAKE3 hash
+NamespaceSecret. Its value is the 32-byte BLAKE3 hash
of the entry’s content data, the size of this content data, and a timestamp.
Implementations§
source§impl Entry
impl Entry
sourcepub fn new(id: RecordIdentifier, record: Record) -> Self
pub fn new(id: RecordIdentifier, record: Record) -> Self
Create a new entry
sourcepub fn new_empty(id: RecordIdentifier) -> Self
pub fn new_empty(id: RecordIdentifier) -> Self
Create a new empty entry with the current timestamp.
@@ -15,7 +15,7 @@ of the entry’s content data, the size of this content data, and a timestamp.sourcepub fn sign(self, namespace: &NamespaceSecret, author: &Author) -> SignedEntry
pub fn sign(self, namespace: &NamespaceSecret, author: &Author) -> SignedEntry
Sign this entry with a NamespaceSecret and Author.
Methods from Deref<Target = Record>§
sourcepub fn content_len(&self) -> u64
pub fn content_len(&self) -> u64
Get the length of the data addressed by this record’s content hash.
-sourcepub fn content_hash(&self) -> Hash
pub fn content_hash(&self) -> Hash
Get the [struct@Hash] of the content data of this record.
sourcepub fn content_hash(&self) -> Hash
pub fn content_hash(&self) -> Hash
Get the Hash of the content data of this record.
Trait Implementations§
source§impl<'de> Deserialize<'de> for Entry
impl<'de> Deserialize<'de> for Entry
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
source§impl From<SignedEntry> for Entry
impl From<SignedEntry> for Entry
source§fn from(value: SignedEntry) -> Self
fn from(value: SignedEntry) -> Self
source§impl Ord for Entry
impl Ord for Entry
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
diff --git a/pr/2595/docs/iroh_docs/sync/struct.Record.html b/pr/2595/docs/iroh_docs/sync/struct.Record.html
index 94479a973e..f06cccab52 100644
--- a/pr/2595/docs/iroh_docs/sync/struct.Record.html
+++ b/pr/2595/docs/iroh_docs/sync/struct.Record.html
@@ -1,11 +1,11 @@
Record in iroh_docs::sync - Rust pub struct Record { /* private fields */ }
Expand description
The data part of an entry in a Replica.
-Implementations§
source§impl Record
Implementations§
source§impl Record
sourcepub fn empty_current() -> Self
Create a tombstone record with the timestamp set to now.
sourcepub fn new_current(hash: Hash, len: u64) -> Self
Create a new Record with the timestamp set to now.
+sourcepub fn new_current(hash: Hash, len: u64) -> Self
Create a new Record with the timestamp set to now.
sourcepub fn content_len(&self) -> u64
Get the length of the data addressed by this record’s content hash.
-sourcepub fn content_hash(&self) -> Hash
Get the [struct@Hash] of the content data of this record.
+sourcepub fn content_hash(&self) -> Hash
Get the Hash of the content data of this record.
Trait Implementations§
source§impl<'de> Deserialize<'de> for Record
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl Ord for Record
Ordering for entry values.
diff --git a/pr/2595/docs/iroh_docs/sync/struct.Replica.html b/pr/2595/docs/iroh_docs/sync/struct.Replica.html
index 23a9798651..c4e161f3c3 100644
--- a/pr/2595/docs/iroh_docs/sync/struct.Replica.html
+++ b/pr/2595/docs/iroh_docs/sync/struct.Replica.html
@@ -5,7 +5,7 @@
&mut self,
key: impl AsRef<[u8]>,
author: &Author,
- hash: Hash,
+ hash: Hash,
len: u64
) -> Result<usize, InsertError>Insert a new record at the given key.
The entry will by signed by the provided author.
@@ -35,7 +35,7 @@ or an error if the entry failed to validate or if a store operation failed.
key: impl AsRef<[u8]>,
author: &Author,
data: impl AsRef<[u8]>
-) -> Result<Hash, InsertError>Hashes the given data and inserts it.
+) -> Result<Hash, InsertError>Hashes the given data and inserts it.
This does not store the content, just the record of it.
Returns the calculated hash.
sourcepub fn record_id(
diff --git a/pr/2595/docs/iroh_docs/sync/struct.SignedEntry.html b/pr/2595/docs/iroh_docs/sync/struct.SignedEntry.html
index 21644eacb1..9ef5e98134 100644
--- a/pr/2595/docs/iroh_docs/sync/struct.SignedEntry.html
+++ b/pr/2595/docs/iroh_docs/sync/struct.SignedEntry.html
@@ -14,7 +14,7 @@
sourcepub fn signature(&self) -> &EntrySignature
Get the signature.
sourcepub fn validate_empty(&self) -> Result<(), ValidationFailure>
Validate that the entry has the empty hash if the length is 0, or a non-zero length.
sourcepub fn content_hash(&self) -> Hash
Get the content [struct@Hash] of the entry.
+sourcepub fn content_hash(&self) -> Hash
Get the content Hash of the entry.
sourcepub fn content_len(&self) -> u64
Get the content length of the entry.
Get the author bytes of this entry.
Methods from Deref<Target = Record>§
sourcepub fn content_len(&self) -> u64
Get the length of the data addressed by this record’s content hash.
-sourcepub fn content_hash(&self) -> Hash
Get the [struct@Hash] of the content data of this record.
+sourcepub fn content_hash(&self) -> Hash
Get the Hash of the content data of this record.
Trait Implementations§
source§impl Clone for SignedEntry
source§fn clone(&self) -> SignedEntry
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moresource§impl Debug for SignedEntry
source§impl Deref for SignedEntry
source§impl<'de> Deserialize<'de> for SignedEntry
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl From<SignedEntry> for Entry
source§fn from(value: SignedEntry) -> Self
Converts to this type from the input type.source§impl Ord for SignedEntry
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
diff --git a/pr/2595/docs/iroh_docs/sync/type.ContentStatusCallback.html b/pr/2595/docs/iroh_docs/sync/type.ContentStatusCallback.html
index 46d5a5a49c..84ffdbe8ee 100644
--- a/pr/2595/docs/iroh_docs/sync/type.ContentStatusCallback.html
+++ b/pr/2595/docs/iroh_docs/sync/type.ContentStatusCallback.html
@@ -1,2 +1,2 @@
-ContentStatusCallback in iroh_docs::sync - Rust Type Alias iroh_docs::sync::ContentStatusCallback
source · pub type ContentStatusCallback = Arc<dyn Fn(Hash) -> ContentStatus + Send + Sync + 'static>;
Expand description
Callback that may be set on a replica to determine the availability status for a content hash.
+ContentStatusCallback in iroh_docs::sync - Rust Type Alias iroh_docs::sync::ContentStatusCallback
source · pub type ContentStatusCallback = Arc<dyn Fn(Hash) -> ContentStatus + Send + Sync + 'static>;
Expand description
Callback that may be set on a replica to determine the availability status for a content hash.
Aliased Type§
struct ContentStatusCallback { /* private fields */ }
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_net/discovery/dns/index.html b/pr/2595/docs/iroh_net/discovery/dns/index.html
index 5a80538422..a752b49d78 100644
--- a/pr/2595/docs/iroh_net/discovery/dns/index.html
+++ b/pr/2595/docs/iroh_net/discovery/dns/index.html
@@ -1,2 +1,2 @@
-iroh_net::discovery::dns - Rust Expand description
DNS node discovery for iroh-net
+iroh_net::discovery::dns - Rust Expand description
DNS node discovery for iroh-net
Structs§
- DNS node discovery
Constants§
- The n0 testing DNS node origin, for production.
- The n0 testing DNS node origin, for testing.
- Testing DNS node origin, must run server from
crate::test_utils::DnsPkarrServer.
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_net/discovery/dns/struct.DnsDiscovery.html b/pr/2595/docs/iroh_net/discovery/dns/struct.DnsDiscovery.html
index 3e7d5d71cc..7628fb45a9 100644
--- a/pr/2595/docs/iroh_net/discovery/dns/struct.DnsDiscovery.html
+++ b/pr/2595/docs/iroh_net/discovery/dns/struct.DnsDiscovery.html
@@ -28,7 +28,7 @@ custom discovery mechanism.
For testing it is also possible to use the N0_DNS_NODE_ORIGIN_STAGING domain
with DnsDiscovery::new. This would then use a hosted discovery service again,
but for testing purposes.
-Trait Implementations§
Trait Implementations§
source§impl Debug for DnsDiscovery
source§impl Discovery for DnsDiscovery
source§fn resolve(
&self,
ep: Endpoint,
node_id: NodeId
diff --git a/pr/2595/docs/iroh_net/discovery/trait.Discovery.html b/pr/2595/docs/iroh_net/discovery/trait.Discovery.html
index a53a618708..d3832a56b5 100644
--- a/pr/2595/docs/iroh_net/discovery/trait.Discovery.html
+++ b/pr/2595/docs/iroh_net/discovery/trait.Discovery.html
@@ -29,4 +29,4 @@ These tasks will be run on the runtime of the Option<BoxStream<Result<DiscoveryItem>>>
Implementors§
source§impl Discovery for DnsDiscovery
source§impl Discovery for LocalSwarmDiscovery
source§impl Discovery for PkarrPublisher
source§impl Discovery for PkarrResolver
source§impl Discovery for ConcurrentDiscovery
\ No newline at end of file
+
Implementors§
source§impl Discovery for DnsDiscovery
source§impl Discovery for LocalSwarmDiscovery
source§impl Discovery for PkarrPublisher
source§impl Discovery for PkarrResolver
source§impl Discovery for ConcurrentDiscovery
\ No newline at end of file
diff --git a/pr/2595/docs/src/iroh_net/discovery/dns.rs.html b/pr/2595/docs/src/iroh_net/discovery/dns.rs.html
index dd1a279fb3..1d32545ed3 100644
--- a/pr/2595/docs/src/iroh_net/discovery/dns.rs.html
+++ b/pr/2595/docs/src/iroh_net/discovery/dns.rs.html
@@ -97,6 +97,10 @@
97
98
99
+100
+101
+102
+103
//! DNS node discovery for iroh-net
use anyhow::Result;
@@ -182,6 +186,10 @@
fn resolve(&self, ep: Endpoint, node_id: NodeId) -> Option<BoxStream<Result<DiscoveryItem>>> {
let resolver = ep.dns_resolver().clone();
let origin_domain = self.origin_domain.clone();
+ #[cfg(any(test, feature = "test-utils"))]
+ if origin_domain.contains(&TEST_DNS_NODE_ORIGIN.to_string()) {
+ panic!("wait. THIS IS ILLEGAL!");
+ }
let fut = async move {
let node_addr = resolver
.lookup_by_id_staggered(&node_id, &origin_domain, DNS_STAGGERING_MS)
diff --git a/pr/2595/docs/trait.impl/iroh_base/ticket/trait.Ticket.js b/pr/2595/docs/trait.impl/iroh_base/ticket/trait.Ticket.js
index 12fa1e3ee5..5d209fabd2 100644
--- a/pr/2595/docs/trait.impl/iroh_base/ticket/trait.Ticket.js
+++ b/pr/2595/docs/trait.impl/iroh_base/ticket/trait.Ticket.js
@@ -1,5 +1,5 @@
(function() {var implementors = {
"iroh":[],
"iroh_base":[],
-"iroh_docs":[["impl Ticket for DocTicket"]]
+"iroh_docs":[["impl Ticket for DocTicket"]]
};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
diff --git a/pr/2595/docs/type.impl/std/primitive.array.js b/pr/2595/docs/type.impl/std/primitive.array.js
index 588a8b53a3..3006964922 100644
--- a/pr/2595/docs/type.impl/std/primitive.array.js
+++ b/pr/2595/docs/type.impl/std/primitive.array.js
@@ -1,4 +1,4 @@
(function() {var type_impls = {
"iroh":[["source§impl<T, const N: usize> [T; N]
1.55.0 · sourcepub fn map<F, U>(self, f: F) -> [U; N]where\n F: FnMut(T) -> U,
Returns an array of the same size as self, with function f applied to each element\nin order.
\nIf you don’t necessarily need a new fixed-size array, consider using\nIterator::map instead.
\n§Note on performance and stack usage
\nUnfortunately, usages of this method are currently not always optimized\nas well as they could be. This mainly concerns large arrays, as mapping\nover small arrays seem to be optimized just fine. Also note that in\ndebug mode (i.e. without any optimizations), this method can use a lot\nof stack space (a few times the size of the array or more).
\nTherefore, in performance-critical code, try to avoid using this method\non large arrays or check the emitted code. Also try to avoid chained\nmaps (e.g. arr.map(...).map(...)).
\nIn many cases, you can instead use Iterator::map by calling .iter()\nor .into_iter() on your array. [T; N]::map is only necessary if you\nreally need a new array of the same size as the result. Rust’s lazy\niterators tend to get optimized very well.
\n§Examples
\nlet x = [1, 2, 3];\nlet y = x.map(|v| v + 1);\nassert_eq!(y, [2, 3, 4]);\n\nlet x = [1, 2, 3];\nlet mut temp = 0;\nlet y = x.map(|v| { temp += 1; v * temp });\nassert_eq!(y, [1, 4, 9]);\n\nlet x = [\"Ferris\", \"Bueller's\", \"Day\", \"Off\"];\nlet y = x.map(|v| v.len());\nassert_eq!(y, [6, 9, 3, 3]);
\nsourcepub fn try_map<F, R>(\n self,\n f: F\n) -> <<R as Try>::Residual as Residual<[<R as Try>::Output; N]>>::TryType
🔬This is a nightly-only experimental API. (array_try_map)
A fallible function f applied to each element on array self in order to\nreturn an array the same size as self or the first error encountered.
\nThe return type of this function depends on the return type of the closure.\nIf you return Result<T, E> from the closure, you’ll get a Result<[T; N], E>.\nIf you return Option<T> from the closure, you’ll get an Option<[T; N]>.
\n§Examples
\n#![feature(array_try_map)]\n\nlet a = [\"1\", \"2\", \"3\"];\nlet b = a.try_map(|v| v.parse::<u32>()).unwrap().map(|v| v + 1);\nassert_eq!(b, [2, 3, 4]);\n\nlet a = [\"1\", \"2a\", \"3\"];\nlet b = a.try_map(|v| v.parse::<u32>());\nassert!(b.is_err());\n\nuse std::num::NonZero;\n\nlet z = [1, 2, 0, 3, 4];\nassert_eq!(z.try_map(NonZero::new), None);\n\nlet a = [1, 2, 3];\nlet b = a.try_map(NonZero::new);\nlet c = b.map(|x| x.map(NonZero::get));\nassert_eq!(c, Some(a));
\n1.57.0 (const: 1.57.0) · sourcepub const fn as_slice(&self) -> &[T]
Returns a slice containing the entire array. Equivalent to &s[..].
\n1.57.0 · sourcepub fn as_mut_slice(&mut self) -> &mut [T]
Returns a mutable slice containing the entire array. Equivalent to\n&mut s[..].
\n1.77.0 · sourcepub fn each_ref(&self) -> [&T; N]
Borrows each element and returns an array of references with the same\nsize as self.
\n§Example
\nlet floats = [3.1, 2.7, -1.0];\nlet float_refs: [&f64; 3] = floats.each_ref();\nassert_eq!(float_refs, [&3.1, &2.7, &-1.0]);
\nThis method is particularly useful if combined with other methods, like\nmap. This way, you can avoid moving the original\narray if its elements are not Copy.
\n\nlet strings = [\"Ferris\".to_string(), \"♥\".to_string(), \"Rust\".to_string()];\nlet is_ascii = strings.each_ref().map(|s| s.is_ascii());\nassert_eq!(is_ascii, [true, false, true]);\n\n// We can still access the original array: it has not been moved.\nassert_eq!(strings.len(), 3);
\n1.77.0 · sourcepub fn each_mut(&mut self) -> [&mut T; N]
Borrows each element mutably and returns an array of mutable references\nwith the same size as self.
\n§Example
\n\nlet mut floats = [3.1, 2.7, -1.0];\nlet float_refs: [&mut f64; 3] = floats.each_mut();\n*float_refs[0] = 0.0;\nassert_eq!(float_refs, [&mut 0.0, &mut 2.7, &mut -1.0]);\nassert_eq!(floats, [0.0, 2.7, -1.0]);
\nsourcepub fn split_array_ref<const M: usize>(&self) -> (&[T; M], &[T])
🔬This is a nightly-only experimental API. (split_array)
Divides one array reference into two at an index.
\nThe first will contain all indices from [0, M) (excluding\nthe index M itself) and the second will contain all\nindices from [M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet v = [1, 2, 3, 4, 5, 6];\n\n{\n let (left, right) = v.split_array_ref::<0>();\n assert_eq!(left, &[]);\n assert_eq!(right, &[1, 2, 3, 4, 5, 6]);\n}\n\n{\n let (left, right) = v.split_array_ref::<2>();\n assert_eq!(left, &[1, 2]);\n assert_eq!(right, &[3, 4, 5, 6]);\n}\n\n{\n let (left, right) = v.split_array_ref::<6>();\n assert_eq!(left, &[1, 2, 3, 4, 5, 6]);\n assert_eq!(right, &[]);\n}
\nsourcepub fn split_array_mut<const M: usize>(&mut self) -> (&mut [T; M], &mut [T])
🔬This is a nightly-only experimental API. (split_array)
Divides one mutable array reference into two at an index.
\nThe first will contain all indices from [0, M) (excluding\nthe index M itself) and the second will contain all\nindices from [M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet mut v = [1, 0, 3, 0, 5, 6];\nlet (left, right) = v.split_array_mut::<2>();\nassert_eq!(left, &mut [1, 0][..]);\nassert_eq!(right, &mut [3, 0, 5, 6]);\nleft[1] = 2;\nright[1] = 4;\nassert_eq!(v, [1, 2, 3, 4, 5, 6]);
\nsourcepub fn rsplit_array_ref<const M: usize>(&self) -> (&[T], &[T; M])
🔬This is a nightly-only experimental API. (split_array)
Divides one array reference into two at an index from the end.
\nThe first will contain all indices from [0, N - M) (excluding\nthe index N - M itself) and the second will contain all\nindices from [N - M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet v = [1, 2, 3, 4, 5, 6];\n\n{\n let (left, right) = v.rsplit_array_ref::<0>();\n assert_eq!(left, &[1, 2, 3, 4, 5, 6]);\n assert_eq!(right, &[]);\n}\n\n{\n let (left, right) = v.rsplit_array_ref::<2>();\n assert_eq!(left, &[1, 2, 3, 4]);\n assert_eq!(right, &[5, 6]);\n}\n\n{\n let (left, right) = v.rsplit_array_ref::<6>();\n assert_eq!(left, &[]);\n assert_eq!(right, &[1, 2, 3, 4, 5, 6]);\n}
\nsourcepub fn rsplit_array_mut<const M: usize>(&mut self) -> (&mut [T], &mut [T; M])
🔬This is a nightly-only experimental API. (split_array)
Divides one mutable array reference into two at an index from the end.
\nThe first will contain all indices from [0, N - M) (excluding\nthe index N - M itself) and the second will contain all\nindices from [N - M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet mut v = [1, 0, 3, 0, 5, 6];\nlet (left, right) = v.rsplit_array_mut::<4>();\nassert_eq!(left, &mut [1, 0]);\nassert_eq!(right, &mut [3, 0, 5, 6][..]);\nleft[1] = 2;\nright[1] = 4;\nassert_eq!(v, [1, 2, 3, 4, 5, 6]);
\n",0,"iroh::docs::PeerIdBytes"],["source§impl<const N: usize> [u8; N]
sourcepub const fn as_ascii(&self) -> Option<&[AsciiChar; N]>
🔬This is a nightly-only experimental API. (ascii_char)
Converts this array of bytes into a array of ASCII characters,\nor returns None if any of the characters is non-ASCII.
\n§Examples
\n#![feature(ascii_char)]\n#![feature(const_option)]\n\nconst HEX_DIGITS: [std::ascii::Char; 16] =\n *b\"0123456789abcdef\".as_ascii().unwrap();\n\nassert_eq!(HEX_DIGITS[1].as_str(), \"1\");\nassert_eq!(HEX_DIGITS[10].as_str(), \"a\");
\nsourcepub const unsafe fn as_ascii_unchecked(&self) -> &[AsciiChar; N]
🔬This is a nightly-only experimental API. (ascii_char)
Converts this array of bytes into a array of ASCII characters,\nwithout checking whether they’re valid.
\n§Safety
\nEvery byte in the array must be in 0..=127, or else this is UB.
\n",0,"iroh::docs::PeerIdBytes"],["§impl<T> Array for [T; 32]where\n T: Default,
§fn as_slice_mut(&mut self) -> &mut [T]
Gives a unique slice over the whole thing. Read more","Array","iroh::docs::PeerIdBytes"],["","Array","iroh::docs::PeerIdBytes"],["§impl<const N: usize, T> AsBytes for [T; N]where\n T: AsBytes,
§fn write_to_prefix(&self, bytes: &mut [u8]) -> Option<()>
","AsBytes","iroh::docs::PeerIdBytes"],["","AsBytes","iroh::docs::PeerIdBytes"],["","AsMut<[T]>","iroh::docs::PeerIdBytes"],["","AsRef<[T]>","iroh::docs::PeerIdBytes"],["§impl<T, const N: usize> BitView for [T; N]where\n T: BitStore,
Note that overly-large arrays may cause the conversions to fail.
\n§fn view_bits<O>(&self) -> &BitSlice<T, O>where\n O: BitOrder,
Views a memory region as an immutable bit-slice.§fn try_view_bits<O>(&self) -> Result<&BitSlice<T, O>, BitSpanError<T>>where\n O: BitOrder,
Attempts to view a memory region as an immutable bit-slice. Read more§fn view_bits_mut<O>(&mut self) -> &mut BitSlice<T, O>where\n O: BitOrder,
Views a memory region as a mutable bit-slice.§fn try_view_bits_mut<O>(\n &mut self\n) -> Result<&mut BitSlice<T, O>, BitSpanError<T>>where\n O: BitOrder,
Attempts to view a memory region as a mutable bit-slice. Read more","BitView","iroh::docs::PeerIdBytes"],["§impl<T, const N: usize> BitViewSized for [T; N]where\n T: BitStore,
§fn as_raw_slice(&self) -> &[<[T; N] as BitView>::Store]
Views the type as a slice of its elements.§fn as_raw_mut_slice(&mut self) -> &mut [<[T; N] as BitView>::Store]
Views the type as a mutable slice of its elements.§fn into_bitarray<O>(self) -> BitArray<Self, O>where\n O: BitOrder,
Wraps self in a BitArray.","BitViewSized","iroh::docs::PeerIdBytes"],["","Borrow<[T]>","iroh::docs::PeerIdBytes"],["1.4.0 · source§impl<T, const N: usize> BorrowMut<[T]> for [T; N]
source§fn borrow_mut(&mut self) -> &mut [T]
Mutably borrows from an owned value. Read more","BorrowMut<[T]>","iroh::docs::PeerIdBytes"],["","Chain","iroh::docs::PeerIdBytes"],["","Clone","iroh::docs::PeerIdBytes"],["","Debug","iroh::docs::PeerIdBytes"],["§impl<const N: usize> Decode for [u8; N]
Decodes a byte array from byte[n] as described in RFC4251 § 5:
\n\nA byte represents an arbitrary 8-bit value (octet). Fixed length\ndata is sometimes represented as an array of bytes, written\nbyte[n], where n is the number of bytes in the array.
\n
\n","Decode","iroh::docs::PeerIdBytes"],["§impl<'a, T, const N: usize> DecodeValue<'a> for [T; N]where\n T: Decode<'a>,
§fn decode_value<R>(reader: &mut R, header: Header) -> Result<[T; N], Error>where\n R: Reader<'a>,
Attempt to decode this message using the provided [Reader].","DecodeValue<'a>","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["source§impl<'de, T> Deserialize<'de> for [T; 32]where\n T: Deserialize<'de>,
source§fn deserialize<D>(\n deserializer: D\n) -> Result<[T; 32], <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more","Deserialize<'de>","iroh::docs::PeerIdBytes"],["source§impl<'de, const N: usize> Deserialize<'de> for [u8; N]
source§fn deserialize<D>(\n deserializer: D\n) -> Result<[u8; N], <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
","Deserialize<'de>","iroh::docs::PeerIdBytes"],["§impl<const N: usize> Encode for [u8; N]
Encodes [u8; N] into byte[n] as described in RFC4251 § 5:
\n\nA byte represents an arbitrary 8-bit value (octet). Fixed length\ndata is sometimes represented as an array of bytes, written\nbyte[n], where n is the number of bytes in the array.
\n
\n§fn encoded_len(&self) -> Result<usize, Error>
Get the length of this type encoded in bytes, prior to Base64 encoding.§fn encode(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value using the provided [Writer].§fn encoded_len_prefixed(&self) -> Result<usize, Error>
Return the length of this type after encoding when prepended with a\nuint32 length prefix.§fn encode_prefixed(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value, first prepending a uint32 length prefix\nset to [Encode::encoded_len].","Encode","iroh::docs::PeerIdBytes"],["","EncodeLabelSet","iroh::docs::PeerIdBytes"],["§impl<T, const N: usize> EncodeValue for [T; N]where\n T: Encode,
","EncodeValue","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["§impl<'a> FindToken<&'a u8> for [u8; 32]
§fn find_token(&self, token: &u8) -> bool
Returns true if self contains the token","FindToken<&'a u8>","iroh::docs::PeerIdBytes"],["§impl FindToken<u8> for [u8; 32]
§fn find_token(&self, token: u8) -> bool
Returns true if self contains the token","FindToken","iroh::docs::PeerIdBytes"],["","FixedTag","iroh::docs::PeerIdBytes"],["","From<&Signature>","iroh::docs::PeerIdBytes"],["","From","iroh::docs::PeerIdBytes"],["§impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>>> for [T; 32]
","From, B0>, B0>, B0>, B0>, B0>>>","iroh::docs::PeerIdBytes"],["","From","iroh::docs::PeerIdBytes"],["","From","iroh::docs::PeerIdBytes"],["","From>","iroh::docs::PeerIdBytes"],["","From","iroh::docs::PeerIdBytes"],["","From","iroh::docs::PeerIdBytes"],["","From","iroh::docs::PeerIdBytes"],["","From>","iroh::docs::PeerIdBytes"],["§impl<const N: usize, T> FromBytes for [T; N]where\n T: FromBytes,
§fn slice_from_prefix(bytes: &[u8], count: usize) -> Option<(&[Self], &[u8])>where\n Self: Sized,
Interprets the prefix of the given bytes as a &[Self] with length\nequal to count without copying. Read more§fn slice_from_suffix(bytes: &[u8], count: usize) -> Option<(&[u8], &[Self])>where\n Self: Sized,
Interprets the suffix of the given bytes as a &[Self] with length\nequal to count without copying. Read more§fn read_from_prefix(bytes: &[u8]) -> Option<Self>where\n Self: Sized,
","FromBytes","iroh::docs::PeerIdBytes"],["","FromHex","iroh::docs::PeerIdBytes"],["","FromZeroes","iroh::docs::PeerIdBytes"],["","Hash","iroh::docs::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Hash for [T; N]where\n T: Hash,
The hash of an array is the same as that of the corresponding slice,\nas required by the Borrow implementation.
\n\nuse std::hash::BuildHasher;\n\nlet b = std::hash::RandomState::new();\nlet a: [u8; 3] = [0xa8, 0x3c, 0x09];\nlet s: &[u8] = &[0xa8, 0x3c, 0x09];\nassert_eq!(b.hash_one(a), b.hash_one(s));
\n","Hash","iroh::docs::PeerIdBytes"],["","Index","iroh::docs::PeerIdBytes"],["","IndexMut","iroh::docs::PeerIdBytes"],["","InputLength","iroh::docs::PeerIdBytes"],["1.53.0 · source§impl<T, const N: usize> IntoIterator for [T; N]
source§fn into_iter(self) -> <[T; N] as IntoIterator>::IntoIter
Creates a consuming iterator, that is, one that moves each value out of\nthe array (from start to end). The array cannot be used after calling\nthis unless T implements Copy, so the whole array is copied.
\nArrays have special behavior when calling .into_iter() prior to the\n2021 edition – see the array Editions section for more information.
\n","IntoIterator","iroh::docs::PeerIdBytes"],["§impl<const N: usize> IntoResponse for [u8; N]
§fn into_response(self) -> Response<Body>
Create a response.","IntoResponse","iroh::docs::PeerIdBytes"],["§impl<Fut, const N: usize> Join for [Fut; N]where\n Fut: IntoFuture,
§type Output = [<Fut as IntoFuture>::Output; N]
The resulting output type.§type Future = Join<<Fut as IntoFuture>::IntoFuture, N>
The Future implementation returned by this method.","Join","iroh::docs::PeerIdBytes"],["","Key","iroh::docs::PeerIdBytes"],["§impl<T, const N: usize> MaxSize for [T; N]where\n T: MaxSize,
§const POSTCARD_MAX_SIZE: usize = _
The maximum possible size that the serialization of this\ntype can have, in bytes.","MaxSize","iroh::docs::PeerIdBytes"],["","Merge","iroh::docs::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Ord for [T; N]where\n T: Ord,
Implements comparison of arrays lexicographically.
\n1.21.0 · source§fn max(self, other: Self) -> Selfwhere\n Self: Sized,
Compares and returns the maximum of two values. Read more","Ord","iroh::docs::PeerIdBytes"],["","PartialEq<&[U]>","iroh::docs::PeerIdBytes"],["1.0.0 · source§impl<T, U, const N: usize> PartialEq<&mut [U]> for [T; N]where\n T: PartialEq<U>,
","PartialEq<&mut [U]>","iroh::docs::PeerIdBytes"],["","PartialEq<[U]>","iroh::docs::PeerIdBytes"],["","PartialEq<[U; N]>","iroh::docs::PeerIdBytes"],["","PartialEq","iroh::docs::PeerIdBytes"],["§impl<A, B, const N: usize, const M: usize> PartialEq<Vec<A, N>> for [B; M]where\n A: PartialEq<B>,
","PartialEq>","iroh::docs::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> PartialOrd for [T; N]where\n T: PartialOrd,
Implements comparison of arrays lexicographically.
\nsource§fn le(&self, other: &[T; N]) -> bool
This method tests less than or equal to (for self and other) and is used by the <=\noperator. Read more","PartialOrd","iroh::docs::PeerIdBytes"],["§impl<Fut, const N: usize> Race for [Fut; N]where\n Fut: IntoFuture,
§type Output = <Fut as IntoFuture>::Output
The resulting output type.§type Future = Race<<Fut as IntoFuture>::IntoFuture, N>
Which kind of future are we turning this into?","Race","iroh::docs::PeerIdBytes"],["§impl<Fut, T, E, const N: usize> RaceOk for [Fut; N]where\n Fut: IntoFuture<Output = Result<T, E>>,
§type Future = RaceOk<<Fut as IntoFuture>::IntoFuture, T, E, N>
Which kind of future are we turning this into?","RaceOk","iroh::docs::PeerIdBytes"],["","Schema","iroh::docs::PeerIdBytes"],["source§impl<T> Serialize for [T; 32]where\n T: 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","iroh::docs::PeerIdBytes"],["source§impl<const N: usize> Serialize for [u8; N]
source§fn serialize<S>(\n &self,\n serializer: S\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where\n S: Serializer,
","Serialize","iroh::docs::PeerIdBytes"],["1.51.0 · source§impl<T, const N: usize> SlicePattern for [T; N]
","SlicePattern","iroh::docs::PeerIdBytes"],["1.34.0 · source§impl<T, const N: usize> TryFrom<&[T]> for [T; N]where\n T: Copy,
Tries to create an array [T; N] by copying from a slice &[T]. Succeeds if\nslice.len() == N.
\n\nlet bytes: [u8; 3] = [1, 0, 2];\n\nlet bytes_head: [u8; 2] = <[u8; 2]>::try_from(&bytes[0..2]).unwrap();\nassert_eq!(1, u16::from_le_bytes(bytes_head));\n\nlet bytes_tail: [u8; 2] = bytes[1..3].try_into().unwrap();\nassert_eq!(512, u16::from_le_bytes(bytes_tail));
\n§type Error = TryFromSliceError
The type returned in the event of a conversion error.","TryFrom<&[T]>","iroh::docs::PeerIdBytes"],["1.59.0 · source§impl<T, const N: usize> TryFrom<&mut [T]> for [T; N]where\n T: Copy,
Tries to create an array [T; N] by copying from a mutable slice &mut [T].\nSucceeds if slice.len() == N.
\n\nlet mut bytes: [u8; 3] = [1, 0, 2];\n\nlet bytes_head: [u8; 2] = <[u8; 2]>::try_from(&mut bytes[0..2]).unwrap();\nassert_eq!(1, u16::from_le_bytes(bytes_head));\n\nlet bytes_tail: [u8; 2] = (&mut bytes[1..3]).try_into().unwrap();\nassert_eq!(512, u16::from_le_bytes(bytes_tail));
\n§type Error = TryFromSliceError
The type returned in the event of a conversion error.","TryFrom<&mut [T]>","iroh::docs::PeerIdBytes"],["§impl<T, A, const N: usize> TryFrom<Vec<T, A>> for [T; N]where\n A: Allocator,
§fn try_from(vec: Vec<T, A>) -> Result<[T; N], Vec<T, A>>
Gets the entire contents of the Vec<T> as an array,\nif its size exactly matches that of the requested array.
\n§Examples
\nassert_eq!(vec![1, 2, 3].try_into(), Ok([1, 2, 3]));\nassert_eq!(<Vec<i32>>::new().try_into(), Ok([]));
\nIf the length doesn’t match, the input comes back in Err:
\n\nlet r: Result<[i32; 4], _> = (0..10).collect::<Vec<_>>().try_into();\nassert_eq!(r, Err(vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9]));
\nIf you’re fine with just getting a prefix of the Vec<T>,\nyou can call .truncate(N) first.
\n\nlet mut v = String::from(\"hello world\").into_bytes();\nv.sort();\nv.truncate(2);\nlet [a, b]: [_; 2] = v.try_into().unwrap();\nassert_eq!(a, b' ');\nassert_eq!(b, b'd');
\n","TryFrom>","iroh::docs::PeerIdBytes"],["1.48.0 · source§impl<T, A, const N: usize> TryFrom<Vec<T, A>> for [T; N]where\n A: Allocator,
source§fn try_from(vec: Vec<T, A>) -> Result<[T; N], Vec<T, A>>
Gets the entire contents of the Vec<T> as an array,\nif its size exactly matches that of the requested array.
\n§Examples
\nassert_eq!(vec![1, 2, 3].try_into(), Ok([1, 2, 3]));\nassert_eq!(<Vec<i32>>::new().try_into(), Ok([]));
\nIf the length doesn’t match, the input comes back in Err:
\n\nlet r: Result<[i32; 4], _> = (0..10).collect::<Vec<_>>().try_into();\nassert_eq!(r, Err(vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9]));
\nIf you’re fine with just getting a prefix of the Vec<T>,\nyou can call .truncate(N) first.
\n\nlet mut v = String::from(\"hello world\").into_bytes();\nv.sort();\nv.truncate(2);\nlet [a, b]: [_; 2] = v.try_into().unwrap();\nassert_eq!(a, b' ');\nassert_eq!(b, b'd');
\n","TryFrom>","iroh::docs::PeerIdBytes"],["§impl<Fut, T, E, const N: usize> TryJoin for [Fut; N]where\n Fut: IntoFuture<Output = Result<T, E>>,
§type Future = TryJoin<<Fut as IntoFuture>::IntoFuture, T, E, N>
Which kind of future are we turning this into?","TryJoin","iroh::docs::PeerIdBytes"],["§impl<const N: usize, T> Value for [T; N]where\n T: Value,
§type SelfType<'a> = [<T as Value>::SelfType<'a>; N]\nwhere\n [T; N]: 'a
SelfType<’a> must be the same type as Self with all lifetimes replaced with ’a§type AsBytes<'a> = Vec<u8>\nwhere\n [T; N]: 'a
§fn fixed_width() -> Option<usize>
Width of a fixed type, or None for variable width§fn from_bytes<'a>(data: &'a [u8]) -> [<T as Value>::SelfType<'a>; N]where\n [T; N]: 'a,
Deserializes data\nImplementations may return a view over data, or an owned type","Value","iroh::docs::PeerIdBytes"],["","ValueOrd","iroh::docs::PeerIdBytes"],["§impl<Z, const N: usize> Zeroize for [Z; N]where\n Z: Zeroize,
Impl [Zeroize] on arrays of types that impl [Zeroize].
\n","Zeroize","iroh::docs::PeerIdBytes"],["","Zip","iroh::docs::PeerIdBytes"],["source§impl<T, const N: usize> ConstParamTy for [T; N]where\n T: ConstParamTy,
","ConstParamTy","iroh::docs::PeerIdBytes"],["1.58.0 · source§impl<T, const N: usize> Copy for [T; N]where\n T: Copy,
","Copy","iroh::docs::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Eq for [T; N]where\n T: Eq,
","Eq","iroh::docs::PeerIdBytes"],["source§impl<T, const N: usize> StructuralPartialEq for [T; N]
","StructuralPartialEq","iroh::docs::PeerIdBytes"],["§impl<const N: usize, T> Unaligned for [T; N]where\n T: Unaligned,
","Unaligned","iroh::docs::PeerIdBytes"],["§impl<Z, const N: usize> ZeroizeOnDrop for [Z; N]where\n Z: ZeroizeOnDrop,
Impl [ZeroizeOnDrop] on arrays of types that impl [ZeroizeOnDrop].
\n","ZeroizeOnDrop","iroh::docs::PeerIdBytes"]],
-"iroh_docs":[["source§impl<T, const N: usize> [T; N]
1.55.0 · sourcepub fn map<F, U>(self, f: F) -> [U; N]where\n F: FnMut(T) -> U,
Returns an array of the same size as self, with function f applied to each element\nin order.
\nIf you don’t necessarily need a new fixed-size array, consider using\nIterator::map instead.
\n§Note on performance and stack usage
\nUnfortunately, usages of this method are currently not always optimized\nas well as they could be. This mainly concerns large arrays, as mapping\nover small arrays seem to be optimized just fine. Also note that in\ndebug mode (i.e. without any optimizations), this method can use a lot\nof stack space (a few times the size of the array or more).
\nTherefore, in performance-critical code, try to avoid using this method\non large arrays or check the emitted code. Also try to avoid chained\nmaps (e.g. arr.map(...).map(...)).
\nIn many cases, you can instead use Iterator::map by calling .iter()\nor .into_iter() on your array. [T; N]::map is only necessary if you\nreally need a new array of the same size as the result. Rust’s lazy\niterators tend to get optimized very well.
\n§Examples
\nlet x = [1, 2, 3];\nlet y = x.map(|v| v + 1);\nassert_eq!(y, [2, 3, 4]);\n\nlet x = [1, 2, 3];\nlet mut temp = 0;\nlet y = x.map(|v| { temp += 1; v * temp });\nassert_eq!(y, [1, 4, 9]);\n\nlet x = [\"Ferris\", \"Bueller's\", \"Day\", \"Off\"];\nlet y = x.map(|v| v.len());\nassert_eq!(y, [6, 9, 3, 3]);
\nsourcepub fn try_map<F, R>(\n self,\n f: F\n) -> <<R as Try>::Residual as Residual<[<R as Try>::Output; N]>>::TryType
🔬This is a nightly-only experimental API. (array_try_map)
A fallible function f applied to each element on array self in order to\nreturn an array the same size as self or the first error encountered.
\nThe return type of this function depends on the return type of the closure.\nIf you return Result<T, E> from the closure, you’ll get a Result<[T; N], E>.\nIf you return Option<T> from the closure, you’ll get an Option<[T; N]>.
\n§Examples
\n#![feature(array_try_map)]\n\nlet a = [\"1\", \"2\", \"3\"];\nlet b = a.try_map(|v| v.parse::<u32>()).unwrap().map(|v| v + 1);\nassert_eq!(b, [2, 3, 4]);\n\nlet a = [\"1\", \"2a\", \"3\"];\nlet b = a.try_map(|v| v.parse::<u32>());\nassert!(b.is_err());\n\nuse std::num::NonZero;\n\nlet z = [1, 2, 0, 3, 4];\nassert_eq!(z.try_map(NonZero::new), None);\n\nlet a = [1, 2, 3];\nlet b = a.try_map(NonZero::new);\nlet c = b.map(|x| x.map(NonZero::get));\nassert_eq!(c, Some(a));
\n1.57.0 (const: 1.57.0) · sourcepub const fn as_slice(&self) -> &[T]
Returns a slice containing the entire array. Equivalent to &s[..].
\n1.57.0 · sourcepub fn as_mut_slice(&mut self) -> &mut [T]
Returns a mutable slice containing the entire array. Equivalent to\n&mut s[..].
\n1.77.0 · sourcepub fn each_ref(&self) -> [&T; N]
Borrows each element and returns an array of references with the same\nsize as self.
\n§Example
\nlet floats = [3.1, 2.7, -1.0];\nlet float_refs: [&f64; 3] = floats.each_ref();\nassert_eq!(float_refs, [&3.1, &2.7, &-1.0]);
\nThis method is particularly useful if combined with other methods, like\nmap. This way, you can avoid moving the original\narray if its elements are not Copy.
\n\nlet strings = [\"Ferris\".to_string(), \"♥\".to_string(), \"Rust\".to_string()];\nlet is_ascii = strings.each_ref().map(|s| s.is_ascii());\nassert_eq!(is_ascii, [true, false, true]);\n\n// We can still access the original array: it has not been moved.\nassert_eq!(strings.len(), 3);
\n1.77.0 · sourcepub fn each_mut(&mut self) -> [&mut T; N]
Borrows each element mutably and returns an array of mutable references\nwith the same size as self.
\n§Example
\n\nlet mut floats = [3.1, 2.7, -1.0];\nlet float_refs: [&mut f64; 3] = floats.each_mut();\n*float_refs[0] = 0.0;\nassert_eq!(float_refs, [&mut 0.0, &mut 2.7, &mut -1.0]);\nassert_eq!(floats, [0.0, 2.7, -1.0]);
\nsourcepub fn split_array_ref<const M: usize>(&self) -> (&[T; M], &[T])
🔬This is a nightly-only experimental API. (split_array)
Divides one array reference into two at an index.
\nThe first will contain all indices from [0, M) (excluding\nthe index M itself) and the second will contain all\nindices from [M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet v = [1, 2, 3, 4, 5, 6];\n\n{\n let (left, right) = v.split_array_ref::<0>();\n assert_eq!(left, &[]);\n assert_eq!(right, &[1, 2, 3, 4, 5, 6]);\n}\n\n{\n let (left, right) = v.split_array_ref::<2>();\n assert_eq!(left, &[1, 2]);\n assert_eq!(right, &[3, 4, 5, 6]);\n}\n\n{\n let (left, right) = v.split_array_ref::<6>();\n assert_eq!(left, &[1, 2, 3, 4, 5, 6]);\n assert_eq!(right, &[]);\n}
\nsourcepub fn split_array_mut<const M: usize>(&mut self) -> (&mut [T; M], &mut [T])
🔬This is a nightly-only experimental API. (split_array)
Divides one mutable array reference into two at an index.
\nThe first will contain all indices from [0, M) (excluding\nthe index M itself) and the second will contain all\nindices from [M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet mut v = [1, 0, 3, 0, 5, 6];\nlet (left, right) = v.split_array_mut::<2>();\nassert_eq!(left, &mut [1, 0][..]);\nassert_eq!(right, &mut [3, 0, 5, 6]);\nleft[1] = 2;\nright[1] = 4;\nassert_eq!(v, [1, 2, 3, 4, 5, 6]);
\nsourcepub fn rsplit_array_ref<const M: usize>(&self) -> (&[T], &[T; M])
🔬This is a nightly-only experimental API. (split_array)
Divides one array reference into two at an index from the end.
\nThe first will contain all indices from [0, N - M) (excluding\nthe index N - M itself) and the second will contain all\nindices from [N - M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet v = [1, 2, 3, 4, 5, 6];\n\n{\n let (left, right) = v.rsplit_array_ref::<0>();\n assert_eq!(left, &[1, 2, 3, 4, 5, 6]);\n assert_eq!(right, &[]);\n}\n\n{\n let (left, right) = v.rsplit_array_ref::<2>();\n assert_eq!(left, &[1, 2, 3, 4]);\n assert_eq!(right, &[5, 6]);\n}\n\n{\n let (left, right) = v.rsplit_array_ref::<6>();\n assert_eq!(left, &[]);\n assert_eq!(right, &[1, 2, 3, 4, 5, 6]);\n}
\nsourcepub fn rsplit_array_mut<const M: usize>(&mut self) -> (&mut [T], &mut [T; M])
🔬This is a nightly-only experimental API. (split_array)
Divides one mutable array reference into two at an index from the end.
\nThe first will contain all indices from [0, N - M) (excluding\nthe index N - M itself) and the second will contain all\nindices from [N - M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet mut v = [1, 0, 3, 0, 5, 6];\nlet (left, right) = v.rsplit_array_mut::<4>();\nassert_eq!(left, &mut [1, 0]);\nassert_eq!(right, &mut [3, 0, 5, 6][..]);\nleft[1] = 2;\nright[1] = 4;\nassert_eq!(v, [1, 2, 3, 4, 5, 6]);
\n",0,"iroh_docs::sync::PeerIdBytes"],["source§impl<const N: usize> [u8; N]
sourcepub const fn as_ascii(&self) -> Option<&[AsciiChar; N]>
🔬This is a nightly-only experimental API. (ascii_char)
Converts this array of bytes into a array of ASCII characters,\nor returns None if any of the characters is non-ASCII.
\n§Examples
\n#![feature(ascii_char)]\n#![feature(const_option)]\n\nconst HEX_DIGITS: [std::ascii::Char; 16] =\n *b\"0123456789abcdef\".as_ascii().unwrap();\n\nassert_eq!(HEX_DIGITS[1].as_str(), \"1\");\nassert_eq!(HEX_DIGITS[10].as_str(), \"a\");
\nsourcepub const unsafe fn as_ascii_unchecked(&self) -> &[AsciiChar; N]
🔬This is a nightly-only experimental API. (ascii_char)
Converts this array of bytes into a array of ASCII characters,\nwithout checking whether they’re valid.
\n§Safety
\nEvery byte in the array must be in 0..=127, or else this is UB.
\n",0,"iroh_docs::sync::PeerIdBytes"],["§impl<T> Array for [T; 32]where\n T: Default,
§fn as_slice_mut(&mut self) -> &mut [T]
Gives a unique slice over the whole thing. Read more","Array","iroh_docs::sync::PeerIdBytes"],["","Array","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> AsBytes for [T; N]where\n T: AsBytes,
§fn write_to_prefix(&self, bytes: &mut [u8]) -> Option<()>
","AsBytes","iroh_docs::sync::PeerIdBytes"],["","AsBytes","iroh_docs::sync::PeerIdBytes"],["","AsMut<[T]>","iroh_docs::sync::PeerIdBytes"],["","AsRef<[T]>","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> BitView for [T; N]where\n T: BitStore,
Note that overly-large arrays may cause the conversions to fail.
\n§fn view_bits<O>(&self) -> &BitSlice<T, O>where\n O: BitOrder,
Views a memory region as an immutable bit-slice.§fn try_view_bits<O>(&self) -> Result<&BitSlice<T, O>, BitSpanError<T>>where\n O: BitOrder,
Attempts to view a memory region as an immutable bit-slice. Read more§fn view_bits_mut<O>(&mut self) -> &mut BitSlice<T, O>where\n O: BitOrder,
Views a memory region as a mutable bit-slice.§fn try_view_bits_mut<O>(\n &mut self\n) -> Result<&mut BitSlice<T, O>, BitSpanError<T>>where\n O: BitOrder,
Attempts to view a memory region as a mutable bit-slice. Read more","BitView","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> BitViewSized for [T; N]where\n T: BitStore,
§fn as_raw_slice(&self) -> &[<[T; N] as BitView>::Store]
Views the type as a slice of its elements.§fn as_raw_mut_slice(&mut self) -> &mut [<[T; N] as BitView>::Store]
Views the type as a mutable slice of its elements.§fn into_bitarray<O>(self) -> BitArray<Self, O>where\n O: BitOrder,
Wraps self in a BitArray.","BitViewSized","iroh_docs::sync::PeerIdBytes"],["","Borrow<[T]>","iroh_docs::sync::PeerIdBytes"],["1.4.0 · source§impl<T, const N: usize> BorrowMut<[T]> for [T; N]
source§fn borrow_mut(&mut self) -> &mut [T]
Mutably borrows from an owned value. Read more","BorrowMut<[T]>","iroh_docs::sync::PeerIdBytes"],["","Chain","iroh_docs::sync::PeerIdBytes"],["","Clone","iroh_docs::sync::PeerIdBytes"],["","Debug","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize> Decode for [u8; N]
Decodes a byte array from byte[n] as described in RFC4251 § 5:
\n\nA byte represents an arbitrary 8-bit value (octet). Fixed length\ndata is sometimes represented as an array of bytes, written\nbyte[n], where n is the number of bytes in the array.
\n
\n","Decode","iroh_docs::sync::PeerIdBytes"],["§impl<'a, T, const N: usize> DecodeValue<'a> for [T; N]where\n T: Decode<'a>,
§fn decode_value<R>(reader: &mut R, header: Header) -> Result<[T; N], Error>where\n R: Reader<'a>,
Attempt to decode this message using the provided [Reader].","DecodeValue<'a>","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["source§impl<'de, T> Deserialize<'de> for [T; 32]where\n T: Deserialize<'de>,
source§fn deserialize<D>(\n deserializer: D\n) -> Result<[T; 32], <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more","Deserialize<'de>","iroh_docs::sync::PeerIdBytes"],["source§impl<'de, const N: usize> Deserialize<'de> for [u8; N]
source§fn deserialize<D>(\n deserializer: D\n) -> Result<[u8; N], <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
","Deserialize<'de>","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize> Encode for [u8; N]
Encodes [u8; N] into byte[n] as described in RFC4251 § 5:
\n\nA byte represents an arbitrary 8-bit value (octet). Fixed length\ndata is sometimes represented as an array of bytes, written\nbyte[n], where n is the number of bytes in the array.
\n
\n§fn encoded_len(&self) -> Result<usize, Error>
Get the length of this type encoded in bytes, prior to Base64 encoding.§fn encode(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value using the provided [Writer].§fn encoded_len_prefixed(&self) -> Result<usize, Error>
Return the length of this type after encoding when prepended with a\nuint32 length prefix.§fn encode_prefixed(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value, first prepending a uint32 length prefix\nset to [Encode::encoded_len].","Encode","iroh_docs::sync::PeerIdBytes"],["","EncodeLabelSet","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> EncodeValue for [T; N]where\n T: Encode,
","EncodeValue","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["§impl<'a> FindToken<&'a u8> for [u8; 32]
§fn find_token(&self, token: &u8) -> bool
Returns true if self contains the token","FindToken<&'a u8>","iroh_docs::sync::PeerIdBytes"],["§impl FindToken<u8> for [u8; 32]
§fn find_token(&self, token: u8) -> bool
Returns true if self contains the token","FindToken","iroh_docs::sync::PeerIdBytes"],["","FixedTag","iroh_docs::sync::PeerIdBytes"],["","From<&Signature>","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["§impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>>> for [T; 32]
","From, B0>, B0>, B0>, B0>, B0>>>","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["","From>","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["source§impl From<NamespaceId> for [u8; 32]
source§fn from(value: NamespaceId) -> Self
Converts to this type from the input type.","From","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["","From>","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> FromBytes for [T; N]where\n T: FromBytes,
§fn slice_from_prefix(bytes: &[u8], count: usize) -> Option<(&[Self], &[u8])>where\n Self: Sized,
Interprets the prefix of the given bytes as a &[Self] with length\nequal to count without copying. Read more§fn slice_from_suffix(bytes: &[u8], count: usize) -> Option<(&[u8], &[Self])>where\n Self: Sized,
Interprets the suffix of the given bytes as a &[Self] with length\nequal to count without copying. Read more§fn read_from_prefix(bytes: &[u8]) -> Option<Self>where\n Self: Sized,
","FromBytes","iroh_docs::sync::PeerIdBytes"],["","FromHex","iroh_docs::sync::PeerIdBytes"],["","FromZeroes","iroh_docs::sync::PeerIdBytes"],["","Hash","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Hash for [T; N]where\n T: Hash,
The hash of an array is the same as that of the corresponding slice,\nas required by the Borrow implementation.
\n\nuse std::hash::BuildHasher;\n\nlet b = std::hash::RandomState::new();\nlet a: [u8; 3] = [0xa8, 0x3c, 0x09];\nlet s: &[u8] = &[0xa8, 0x3c, 0x09];\nassert_eq!(b.hash_one(a), b.hash_one(s));
\n","Hash","iroh_docs::sync::PeerIdBytes"],["","Index","iroh_docs::sync::PeerIdBytes"],["","IndexMut","iroh_docs::sync::PeerIdBytes"],["","InputLength","iroh_docs::sync::PeerIdBytes"],["1.53.0 · source§impl<T, const N: usize> IntoIterator for [T; N]
source§fn into_iter(self) -> <[T; N] as IntoIterator>::IntoIter
Creates a consuming iterator, that is, one that moves each value out of\nthe array (from start to end). The array cannot be used after calling\nthis unless T implements Copy, so the whole array is copied.
\nArrays have special behavior when calling .into_iter() prior to the\n2021 edition – see the array Editions section for more information.
\n","IntoIterator","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize> IntoResponse for [u8; N]
§fn into_response(self) -> Response<Body>
Create a response.","IntoResponse","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, const N: usize> Join for [Fut; N]where\n Fut: IntoFuture,
§type Output = [<Fut as IntoFuture>::Output; N]
The resulting output type.§type Future = Join<<Fut as IntoFuture>::IntoFuture, N>
The Future implementation returned by this method.","Join","iroh_docs::sync::PeerIdBytes"],["","Key","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> MaxSize for [T; N]where\n T: MaxSize,
§const POSTCARD_MAX_SIZE: usize = _
The maximum possible size that the serialization of this\ntype can have, in bytes.","MaxSize","iroh_docs::sync::PeerIdBytes"],["","Merge","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Ord for [T; N]where\n T: Ord,
Implements comparison of arrays lexicographically.
\n1.21.0 · source§fn max(self, other: Self) -> Selfwhere\n Self: Sized,
Compares and returns the maximum of two values. Read more","Ord","iroh_docs::sync::PeerIdBytes"],["","PartialEq<&[U]>","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, U, const N: usize> PartialEq<&mut [U]> for [T; N]where\n T: PartialEq<U>,
","PartialEq<&mut [U]>","iroh_docs::sync::PeerIdBytes"],["","PartialEq<[U]>","iroh_docs::sync::PeerIdBytes"],["","PartialEq<[U; N]>","iroh_docs::sync::PeerIdBytes"],["","PartialEq","iroh_docs::sync::PeerIdBytes"],["§impl<A, B, const N: usize, const M: usize> PartialEq<Vec<A, N>> for [B; M]where\n A: PartialEq<B>,
","PartialEq>","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> PartialOrd for [T; N]where\n T: PartialOrd,
Implements comparison of arrays lexicographically.
\nsource§fn le(&self, other: &[T; N]) -> bool
This method tests less than or equal to (for self and other) and is used by the <=\noperator. Read more","PartialOrd","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, const N: usize> Race for [Fut; N]where\n Fut: IntoFuture,
§type Output = <Fut as IntoFuture>::Output
The resulting output type.§type Future = Race<<Fut as IntoFuture>::IntoFuture, N>
Which kind of future are we turning this into?","Race","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, T, E, const N: usize> RaceOk for [Fut; N]where\n Fut: IntoFuture<Output = Result<T, E>>,
§type Future = RaceOk<<Fut as IntoFuture>::IntoFuture, T, E, N>
Which kind of future are we turning this into?","RaceOk","iroh_docs::sync::PeerIdBytes"],["","Schema","iroh_docs::sync::PeerIdBytes"],["source§impl<T> Serialize for [T; 32]where\n T: 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","iroh_docs::sync::PeerIdBytes"],["source§impl<const N: usize> Serialize for [u8; N]
source§fn serialize<S>(\n &self,\n serializer: S\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where\n S: Serializer,
","Serialize","iroh_docs::sync::PeerIdBytes"],["1.51.0 · source§impl<T, const N: usize> SlicePattern for [T; N]
","SlicePattern","iroh_docs::sync::PeerIdBytes"],["1.34.0 · source§impl<T, const N: usize> TryFrom<&[T]> for [T; N]where\n T: Copy,
Tries to create an array [T; N] by copying from a slice &[T]. Succeeds if\nslice.len() == N.
\n\nlet bytes: [u8; 3] = [1, 0, 2];\n\nlet bytes_head: [u8; 2] = <[u8; 2]>::try_from(&bytes[0..2]).unwrap();\nassert_eq!(1, u16::from_le_bytes(bytes_head));\n\nlet bytes_tail: [u8; 2] = bytes[1..3].try_into().unwrap();\nassert_eq!(512, u16::from_le_bytes(bytes_tail));
\n§type Error = TryFromSliceError
The type returned in the event of a conversion error.","TryFrom<&[T]>","iroh_docs::sync::PeerIdBytes"],["1.59.0 · source§impl<T, const N: usize> TryFrom<&mut [T]> for [T; N]where\n T: Copy,
Tries to create an array [T; N] by copying from a mutable slice &mut [T].\nSucceeds if slice.len() == N.
\n\nlet mut bytes: [u8; 3] = [1, 0, 2];\n\nlet bytes_head: [u8; 2] = <[u8; 2]>::try_from(&mut bytes[0..2]).unwrap();\nassert_eq!(1, u16::from_le_bytes(bytes_head));\n\nlet bytes_tail: [u8; 2] = (&mut bytes[1..3]).try_into().unwrap();\nassert_eq!(512, u16::from_le_bytes(bytes_tail));
\n§type Error = TryFromSliceError
The type returned in the event of a conversion error.","TryFrom<&mut [T]>","iroh_docs::sync::PeerIdBytes"],["§impl<T, A, const N: usize> TryFrom<Vec<T, A>> for [T; N]where\n A: Allocator,
§fn try_from(vec: Vec<T, A>) -> Result<[T; N], Vec<T, A>>
Gets the entire contents of the Vec<T> as an array,\nif its size exactly matches that of the requested array.
\n§Examples
\nassert_eq!(vec![1, 2, 3].try_into(), Ok([1, 2, 3]));\nassert_eq!(<Vec<i32>>::new().try_into(), Ok([]));
\nIf the length doesn’t match, the input comes back in Err:
\n\nlet r: Result<[i32; 4], _> = (0..10).collect::<Vec<_>>().try_into();\nassert_eq!(r, Err(vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9]));
\nIf you’re fine with just getting a prefix of the Vec<T>,\nyou can call .truncate(N) first.
\n\nlet mut v = String::from(\"hello world\").into_bytes();\nv.sort();\nv.truncate(2);\nlet [a, b]: [_; 2] = v.try_into().unwrap();\nassert_eq!(a, b' ');\nassert_eq!(b, b'd');
\n","TryFrom>","iroh_docs::sync::PeerIdBytes"],["1.48.0 · source§impl<T, A, const N: usize> TryFrom<Vec<T, A>> for [T; N]where\n A: Allocator,
source§fn try_from(vec: Vec<T, A>) -> Result<[T; N], Vec<T, A>>
Gets the entire contents of the Vec<T> as an array,\nif its size exactly matches that of the requested array.
\n§Examples
\nassert_eq!(vec![1, 2, 3].try_into(), Ok([1, 2, 3]));\nassert_eq!(<Vec<i32>>::new().try_into(), Ok([]));
\nIf the length doesn’t match, the input comes back in Err:
\n\nlet r: Result<[i32; 4], _> = (0..10).collect::<Vec<_>>().try_into();\nassert_eq!(r, Err(vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9]));
\nIf you’re fine with just getting a prefix of the Vec<T>,\nyou can call .truncate(N) first.
\n\nlet mut v = String::from(\"hello world\").into_bytes();\nv.sort();\nv.truncate(2);\nlet [a, b]: [_; 2] = v.try_into().unwrap();\nassert_eq!(a, b' ');\nassert_eq!(b, b'd');
\n","TryFrom>","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, T, E, const N: usize> TryJoin for [Fut; N]where\n Fut: IntoFuture<Output = Result<T, E>>,
§type Future = TryJoin<<Fut as IntoFuture>::IntoFuture, T, E, N>
Which kind of future are we turning this into?","TryJoin","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> Value for [T; N]where\n T: Value,
§type SelfType<'a> = [<T as Value>::SelfType<'a>; N]\nwhere\n [T; N]: 'a
SelfType<’a> must be the same type as Self with all lifetimes replaced with ’a§type AsBytes<'a> = Vec<u8>\nwhere\n [T; N]: 'a
§fn fixed_width() -> Option<usize>
Width of a fixed type, or None for variable width§fn from_bytes<'a>(data: &'a [u8]) -> [<T as Value>::SelfType<'a>; N]where\n [T; N]: 'a,
Deserializes data\nImplementations may return a view over data, or an owned type","Value","iroh_docs::sync::PeerIdBytes"],["","ValueOrd","iroh_docs::sync::PeerIdBytes"],["§impl<Z, const N: usize> Zeroize for [Z; N]where\n Z: Zeroize,
Impl [Zeroize] on arrays of types that impl [Zeroize].
\n","Zeroize","iroh_docs::sync::PeerIdBytes"],["","Zip","iroh_docs::sync::PeerIdBytes"],["source§impl<T, const N: usize> ConstParamTy for [T; N]where\n T: ConstParamTy,
","ConstParamTy","iroh_docs::sync::PeerIdBytes"],["1.58.0 · source§impl<T, const N: usize> Copy for [T; N]where\n T: Copy,
","Copy","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Eq for [T; N]where\n T: Eq,
","Eq","iroh_docs::sync::PeerIdBytes"],["source§impl<T, const N: usize> StructuralPartialEq for [T; N]
","StructuralPartialEq","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> Unaligned for [T; N]where\n T: Unaligned,
","Unaligned","iroh_docs::sync::PeerIdBytes"],["§impl<Z, const N: usize> ZeroizeOnDrop for [Z; N]where\n Z: ZeroizeOnDrop,
Impl [ZeroizeOnDrop] on arrays of types that impl [ZeroizeOnDrop].
\n","ZeroizeOnDrop","iroh_docs::sync::PeerIdBytes"]]
+"iroh_docs":[["source§impl<T, const N: usize> [T; N]
1.55.0 · sourcepub fn map<F, U>(self, f: F) -> [U; N]where\n F: FnMut(T) -> U,
Returns an array of the same size as self, with function f applied to each element\nin order.
\nIf you don’t necessarily need a new fixed-size array, consider using\nIterator::map instead.
\n§Note on performance and stack usage
\nUnfortunately, usages of this method are currently not always optimized\nas well as they could be. This mainly concerns large arrays, as mapping\nover small arrays seem to be optimized just fine. Also note that in\ndebug mode (i.e. without any optimizations), this method can use a lot\nof stack space (a few times the size of the array or more).
\nTherefore, in performance-critical code, try to avoid using this method\non large arrays or check the emitted code. Also try to avoid chained\nmaps (e.g. arr.map(...).map(...)).
\nIn many cases, you can instead use Iterator::map by calling .iter()\nor .into_iter() on your array. [T; N]::map is only necessary if you\nreally need a new array of the same size as the result. Rust’s lazy\niterators tend to get optimized very well.
\n§Examples
\nlet x = [1, 2, 3];\nlet y = x.map(|v| v + 1);\nassert_eq!(y, [2, 3, 4]);\n\nlet x = [1, 2, 3];\nlet mut temp = 0;\nlet y = x.map(|v| { temp += 1; v * temp });\nassert_eq!(y, [1, 4, 9]);\n\nlet x = [\"Ferris\", \"Bueller's\", \"Day\", \"Off\"];\nlet y = x.map(|v| v.len());\nassert_eq!(y, [6, 9, 3, 3]);
\nsourcepub fn try_map<F, R>(\n self,\n f: F\n) -> <<R as Try>::Residual as Residual<[<R as Try>::Output; N]>>::TryType
🔬This is a nightly-only experimental API. (array_try_map)
A fallible function f applied to each element on array self in order to\nreturn an array the same size as self or the first error encountered.
\nThe return type of this function depends on the return type of the closure.\nIf you return Result<T, E> from the closure, you’ll get a Result<[T; N], E>.\nIf you return Option<T> from the closure, you’ll get an Option<[T; N]>.
\n§Examples
\n#![feature(array_try_map)]\n\nlet a = [\"1\", \"2\", \"3\"];\nlet b = a.try_map(|v| v.parse::<u32>()).unwrap().map(|v| v + 1);\nassert_eq!(b, [2, 3, 4]);\n\nlet a = [\"1\", \"2a\", \"3\"];\nlet b = a.try_map(|v| v.parse::<u32>());\nassert!(b.is_err());\n\nuse std::num::NonZero;\n\nlet z = [1, 2, 0, 3, 4];\nassert_eq!(z.try_map(NonZero::new), None);\n\nlet a = [1, 2, 3];\nlet b = a.try_map(NonZero::new);\nlet c = b.map(|x| x.map(NonZero::get));\nassert_eq!(c, Some(a));
\n1.57.0 (const: 1.57.0) · sourcepub const fn as_slice(&self) -> &[T]
Returns a slice containing the entire array. Equivalent to &s[..].
\n1.57.0 · sourcepub fn as_mut_slice(&mut self) -> &mut [T]
Returns a mutable slice containing the entire array. Equivalent to\n&mut s[..].
\n1.77.0 · sourcepub fn each_ref(&self) -> [&T; N]
Borrows each element and returns an array of references with the same\nsize as self.
\n§Example
\nlet floats = [3.1, 2.7, -1.0];\nlet float_refs: [&f64; 3] = floats.each_ref();\nassert_eq!(float_refs, [&3.1, &2.7, &-1.0]);
\nThis method is particularly useful if combined with other methods, like\nmap. This way, you can avoid moving the original\narray if its elements are not Copy.
\n\nlet strings = [\"Ferris\".to_string(), \"♥\".to_string(), \"Rust\".to_string()];\nlet is_ascii = strings.each_ref().map(|s| s.is_ascii());\nassert_eq!(is_ascii, [true, false, true]);\n\n// We can still access the original array: it has not been moved.\nassert_eq!(strings.len(), 3);
\n1.77.0 · sourcepub fn each_mut(&mut self) -> [&mut T; N]
Borrows each element mutably and returns an array of mutable references\nwith the same size as self.
\n§Example
\n\nlet mut floats = [3.1, 2.7, -1.0];\nlet float_refs: [&mut f64; 3] = floats.each_mut();\n*float_refs[0] = 0.0;\nassert_eq!(float_refs, [&mut 0.0, &mut 2.7, &mut -1.0]);\nassert_eq!(floats, [0.0, 2.7, -1.0]);
\nsourcepub fn split_array_ref<const M: usize>(&self) -> (&[T; M], &[T])
🔬This is a nightly-only experimental API. (split_array)
Divides one array reference into two at an index.
\nThe first will contain all indices from [0, M) (excluding\nthe index M itself) and the second will contain all\nindices from [M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet v = [1, 2, 3, 4, 5, 6];\n\n{\n let (left, right) = v.split_array_ref::<0>();\n assert_eq!(left, &[]);\n assert_eq!(right, &[1, 2, 3, 4, 5, 6]);\n}\n\n{\n let (left, right) = v.split_array_ref::<2>();\n assert_eq!(left, &[1, 2]);\n assert_eq!(right, &[3, 4, 5, 6]);\n}\n\n{\n let (left, right) = v.split_array_ref::<6>();\n assert_eq!(left, &[1, 2, 3, 4, 5, 6]);\n assert_eq!(right, &[]);\n}
\nsourcepub fn split_array_mut<const M: usize>(&mut self) -> (&mut [T; M], &mut [T])
🔬This is a nightly-only experimental API. (split_array)
Divides one mutable array reference into two at an index.
\nThe first will contain all indices from [0, M) (excluding\nthe index M itself) and the second will contain all\nindices from [M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet mut v = [1, 0, 3, 0, 5, 6];\nlet (left, right) = v.split_array_mut::<2>();\nassert_eq!(left, &mut [1, 0][..]);\nassert_eq!(right, &mut [3, 0, 5, 6]);\nleft[1] = 2;\nright[1] = 4;\nassert_eq!(v, [1, 2, 3, 4, 5, 6]);
\nsourcepub fn rsplit_array_ref<const M: usize>(&self) -> (&[T], &[T; M])
🔬This is a nightly-only experimental API. (split_array)
Divides one array reference into two at an index from the end.
\nThe first will contain all indices from [0, N - M) (excluding\nthe index N - M itself) and the second will contain all\nindices from [N - M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet v = [1, 2, 3, 4, 5, 6];\n\n{\n let (left, right) = v.rsplit_array_ref::<0>();\n assert_eq!(left, &[1, 2, 3, 4, 5, 6]);\n assert_eq!(right, &[]);\n}\n\n{\n let (left, right) = v.rsplit_array_ref::<2>();\n assert_eq!(left, &[1, 2, 3, 4]);\n assert_eq!(right, &[5, 6]);\n}\n\n{\n let (left, right) = v.rsplit_array_ref::<6>();\n assert_eq!(left, &[]);\n assert_eq!(right, &[1, 2, 3, 4, 5, 6]);\n}
\nsourcepub fn rsplit_array_mut<const M: usize>(&mut self) -> (&mut [T], &mut [T; M])
🔬This is a nightly-only experimental API. (split_array)
Divides one mutable array reference into two at an index from the end.
\nThe first will contain all indices from [0, N - M) (excluding\nthe index N - M itself) and the second will contain all\nindices from [N - M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet mut v = [1, 0, 3, 0, 5, 6];\nlet (left, right) = v.rsplit_array_mut::<4>();\nassert_eq!(left, &mut [1, 0]);\nassert_eq!(right, &mut [3, 0, 5, 6][..]);\nleft[1] = 2;\nright[1] = 4;\nassert_eq!(v, [1, 2, 3, 4, 5, 6]);
\n",0,"iroh_docs::sync::PeerIdBytes"],["source§impl<const N: usize> [u8; N]
sourcepub const fn as_ascii(&self) -> Option<&[AsciiChar; N]>
🔬This is a nightly-only experimental API. (ascii_char)
Converts this array of bytes into a array of ASCII characters,\nor returns None if any of the characters is non-ASCII.
\n§Examples
\n#![feature(ascii_char)]\n#![feature(const_option)]\n\nconst HEX_DIGITS: [std::ascii::Char; 16] =\n *b\"0123456789abcdef\".as_ascii().unwrap();\n\nassert_eq!(HEX_DIGITS[1].as_str(), \"1\");\nassert_eq!(HEX_DIGITS[10].as_str(), \"a\");
\nsourcepub const unsafe fn as_ascii_unchecked(&self) -> &[AsciiChar; N]
🔬This is a nightly-only experimental API. (ascii_char)
Converts this array of bytes into a array of ASCII characters,\nwithout checking whether they’re valid.
\n§Safety
\nEvery byte in the array must be in 0..=127, or else this is UB.
\n",0,"iroh_docs::sync::PeerIdBytes"],["§impl<T> Array for [T; 32]where\n T: Default,
§fn as_slice_mut(&mut self) -> &mut [T]
Gives a unique slice over the whole thing. Read more","Array","iroh_docs::sync::PeerIdBytes"],["","Array","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> AsBytes for [T; N]where\n T: AsBytes,
§fn write_to_prefix(&self, bytes: &mut [u8]) -> Option<()>
","AsBytes","iroh_docs::sync::PeerIdBytes"],["","AsBytes","iroh_docs::sync::PeerIdBytes"],["","AsMut<[T]>","iroh_docs::sync::PeerIdBytes"],["","AsRef<[T]>","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> BitView for [T; N]where\n T: BitStore,
Note that overly-large arrays may cause the conversions to fail.
\n§fn view_bits<O>(&self) -> &BitSlice<T, O>where\n O: BitOrder,
Views a memory region as an immutable bit-slice.§fn try_view_bits<O>(&self) -> Result<&BitSlice<T, O>, BitSpanError<T>>where\n O: BitOrder,
Attempts to view a memory region as an immutable bit-slice. Read more§fn view_bits_mut<O>(&mut self) -> &mut BitSlice<T, O>where\n O: BitOrder,
Views a memory region as a mutable bit-slice.§fn try_view_bits_mut<O>(\n &mut self\n) -> Result<&mut BitSlice<T, O>, BitSpanError<T>>where\n O: BitOrder,
Attempts to view a memory region as a mutable bit-slice. Read more","BitView","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> BitViewSized for [T; N]where\n T: BitStore,
§fn as_raw_slice(&self) -> &[<[T; N] as BitView>::Store]
Views the type as a slice of its elements.§fn as_raw_mut_slice(&mut self) -> &mut [<[T; N] as BitView>::Store]
Views the type as a mutable slice of its elements.§fn into_bitarray<O>(self) -> BitArray<Self, O>where\n O: BitOrder,
Wraps self in a BitArray.","BitViewSized","iroh_docs::sync::PeerIdBytes"],["","Borrow<[T]>","iroh_docs::sync::PeerIdBytes"],["1.4.0 · source§impl<T, const N: usize> BorrowMut<[T]> for [T; N]
source§fn borrow_mut(&mut self) -> &mut [T]
Mutably borrows from an owned value. Read more","BorrowMut<[T]>","iroh_docs::sync::PeerIdBytes"],["","Chain","iroh_docs::sync::PeerIdBytes"],["","Clone","iroh_docs::sync::PeerIdBytes"],["","Debug","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize> Decode for [u8; N]
Decodes a byte array from byte[n] as described in RFC4251 § 5:
\n\nA byte represents an arbitrary 8-bit value (octet). Fixed length\ndata is sometimes represented as an array of bytes, written\nbyte[n], where n is the number of bytes in the array.
\n
\n","Decode","iroh_docs::sync::PeerIdBytes"],["§impl<'a, T, const N: usize> DecodeValue<'a> for [T; N]where\n T: Decode<'a>,
§fn decode_value<R>(reader: &mut R, header: Header) -> Result<[T; N], Error>where\n R: Reader<'a>,
Attempt to decode this message using the provided [Reader].","DecodeValue<'a>","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["source§impl<'de, T> Deserialize<'de> for [T; 32]where\n T: Deserialize<'de>,
source§fn deserialize<D>(\n deserializer: D\n) -> Result<[T; 32], <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more","Deserialize<'de>","iroh_docs::sync::PeerIdBytes"],["source§impl<'de, const N: usize> Deserialize<'de> for [u8; N]
source§fn deserialize<D>(\n deserializer: D\n) -> Result<[u8; N], <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
","Deserialize<'de>","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize> Encode for [u8; N]
Encodes [u8; N] into byte[n] as described in RFC4251 § 5:
\n\nA byte represents an arbitrary 8-bit value (octet). Fixed length\ndata is sometimes represented as an array of bytes, written\nbyte[n], where n is the number of bytes in the array.
\n
\n§fn encoded_len(&self) -> Result<usize, Error>
Get the length of this type encoded in bytes, prior to Base64 encoding.§fn encode(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value using the provided [Writer].§fn encoded_len_prefixed(&self) -> Result<usize, Error>
Return the length of this type after encoding when prepended with a\nuint32 length prefix.§fn encode_prefixed(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value, first prepending a uint32 length prefix\nset to [Encode::encoded_len].","Encode","iroh_docs::sync::PeerIdBytes"],["","EncodeLabelSet","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> EncodeValue for [T; N]where\n T: Encode,
","EncodeValue","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["§impl<'a> FindToken<&'a u8> for [u8; 32]
§fn find_token(&self, token: &u8) -> bool
Returns true if self contains the token","FindToken<&'a u8>","iroh_docs::sync::PeerIdBytes"],["§impl FindToken<u8> for [u8; 32]
§fn find_token(&self, token: u8) -> bool
Returns true if self contains the token","FindToken","iroh_docs::sync::PeerIdBytes"],["","FixedTag","iroh_docs::sync::PeerIdBytes"],["","From<&Signature>","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["§impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>>> for [T; 32]
","From, B0>, B0>, B0>, B0>, B0>>>","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["","From>","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["source§impl From<NamespaceId> for [u8; 32]
source§fn from(value: NamespaceId) -> Self
Converts to this type from the input type.","From","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["","From>","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> FromBytes for [T; N]where\n T: FromBytes,
§fn slice_from_prefix(bytes: &[u8], count: usize) -> Option<(&[Self], &[u8])>where\n Self: Sized,
Interprets the prefix of the given bytes as a &[Self] with length\nequal to count without copying. Read more§fn slice_from_suffix(bytes: &[u8], count: usize) -> Option<(&[u8], &[Self])>where\n Self: Sized,
Interprets the suffix of the given bytes as a &[Self] with length\nequal to count without copying. Read more§fn read_from_prefix(bytes: &[u8]) -> Option<Self>where\n Self: Sized,
","FromBytes","iroh_docs::sync::PeerIdBytes"],["","FromHex","iroh_docs::sync::PeerIdBytes"],["","FromZeroes","iroh_docs::sync::PeerIdBytes"],["","Hash","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Hash for [T; N]where\n T: Hash,
The hash of an array is the same as that of the corresponding slice,\nas required by the Borrow implementation.
\n\nuse std::hash::BuildHasher;\n\nlet b = std::hash::RandomState::new();\nlet a: [u8; 3] = [0xa8, 0x3c, 0x09];\nlet s: &[u8] = &[0xa8, 0x3c, 0x09];\nassert_eq!(b.hash_one(a), b.hash_one(s));
\n","Hash","iroh_docs::sync::PeerIdBytes"],["","Index","iroh_docs::sync::PeerIdBytes"],["","IndexMut","iroh_docs::sync::PeerIdBytes"],["","InputLength","iroh_docs::sync::PeerIdBytes"],["1.53.0 · source§impl<T, const N: usize> IntoIterator for [T; N]
source§fn into_iter(self) -> <[T; N] as IntoIterator>::IntoIter
Creates a consuming iterator, that is, one that moves each value out of\nthe array (from start to end). The array cannot be used after calling\nthis unless T implements Copy, so the whole array is copied.
\nArrays have special behavior when calling .into_iter() prior to the\n2021 edition – see the array Editions section for more information.
\n","IntoIterator","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize> IntoResponse for [u8; N]
§fn into_response(self) -> Response<Body>
Create a response.","IntoResponse","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, const N: usize> Join for [Fut; N]where\n Fut: IntoFuture,
§type Output = [<Fut as IntoFuture>::Output; N]
The resulting output type.§type Future = Join<<Fut as IntoFuture>::IntoFuture, N>
The Future implementation returned by this method.","Join","iroh_docs::sync::PeerIdBytes"],["","Key","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> MaxSize for [T; N]where\n T: MaxSize,
§const POSTCARD_MAX_SIZE: usize = _
The maximum possible size that the serialization of this\ntype can have, in bytes.","MaxSize","iroh_docs::sync::PeerIdBytes"],["","Merge","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Ord for [T; N]where\n T: Ord,
Implements comparison of arrays lexicographically.
\n1.21.0 · source§fn max(self, other: Self) -> Selfwhere\n Self: Sized,
Compares and returns the maximum of two values. Read more","Ord","iroh_docs::sync::PeerIdBytes"],["","PartialEq<&[U]>","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, U, const N: usize> PartialEq<&mut [U]> for [T; N]where\n T: PartialEq<U>,
","PartialEq<&mut [U]>","iroh_docs::sync::PeerIdBytes"],["","PartialEq<[U]>","iroh_docs::sync::PeerIdBytes"],["","PartialEq<[U; N]>","iroh_docs::sync::PeerIdBytes"],["","PartialEq","iroh_docs::sync::PeerIdBytes"],["§impl<A, B, const N: usize, const M: usize> PartialEq<Vec<A, N>> for [B; M]where\n A: PartialEq<B>,
","PartialEq>","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> PartialOrd for [T; N]where\n T: PartialOrd,
Implements comparison of arrays lexicographically.
\nsource§fn le(&self, other: &[T; N]) -> bool
This method tests less than or equal to (for self and other) and is used by the <=\noperator. Read more","PartialOrd","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, const N: usize> Race for [Fut; N]where\n Fut: IntoFuture,
§type Output = <Fut as IntoFuture>::Output
The resulting output type.§type Future = Race<<Fut as IntoFuture>::IntoFuture, N>
Which kind of future are we turning this into?","Race","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, T, E, const N: usize> RaceOk for [Fut; N]where\n Fut: IntoFuture<Output = Result<T, E>>,
§type Future = RaceOk<<Fut as IntoFuture>::IntoFuture, T, E, N>
Which kind of future are we turning this into?","RaceOk","iroh_docs::sync::PeerIdBytes"],["","Schema","iroh_docs::sync::PeerIdBytes"],["source§impl<T> Serialize for [T; 32]where\n T: 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","iroh_docs::sync::PeerIdBytes"],["source§impl<const N: usize> Serialize for [u8; N]
source§fn serialize<S>(\n &self,\n serializer: S\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where\n S: Serializer,
","Serialize","iroh_docs::sync::PeerIdBytes"],["1.51.0 · source§impl<T, const N: usize> SlicePattern for [T; N]
","SlicePattern","iroh_docs::sync::PeerIdBytes"],["1.34.0 · source§impl<T, const N: usize> TryFrom<&[T]> for [T; N]where\n T: Copy,
Tries to create an array [T; N] by copying from a slice &[T]. Succeeds if\nslice.len() == N.
\n\nlet bytes: [u8; 3] = [1, 0, 2];\n\nlet bytes_head: [u8; 2] = <[u8; 2]>::try_from(&bytes[0..2]).unwrap();\nassert_eq!(1, u16::from_le_bytes(bytes_head));\n\nlet bytes_tail: [u8; 2] = bytes[1..3].try_into().unwrap();\nassert_eq!(512, u16::from_le_bytes(bytes_tail));
\n§type Error = TryFromSliceError
The type returned in the event of a conversion error.","TryFrom<&[T]>","iroh_docs::sync::PeerIdBytes"],["1.59.0 · source§impl<T, const N: usize> TryFrom<&mut [T]> for [T; N]where\n T: Copy,
Tries to create an array [T; N] by copying from a mutable slice &mut [T].\nSucceeds if slice.len() == N.
\n\nlet mut bytes: [u8; 3] = [1, 0, 2];\n\nlet bytes_head: [u8; 2] = <[u8; 2]>::try_from(&mut bytes[0..2]).unwrap();\nassert_eq!(1, u16::from_le_bytes(bytes_head));\n\nlet bytes_tail: [u8; 2] = (&mut bytes[1..3]).try_into().unwrap();\nassert_eq!(512, u16::from_le_bytes(bytes_tail));
\n§type Error = TryFromSliceError
The type returned in the event of a conversion error.","TryFrom<&mut [T]>","iroh_docs::sync::PeerIdBytes"],["§impl<T, A, const N: usize> TryFrom<Vec<T, A>> for [T; N]where\n A: Allocator,
§fn try_from(vec: Vec<T, A>) -> Result<[T; N], Vec<T, A>>
Gets the entire contents of the Vec<T> as an array,\nif its size exactly matches that of the requested array.
\n§Examples
\nassert_eq!(vec![1, 2, 3].try_into(), Ok([1, 2, 3]));\nassert_eq!(<Vec<i32>>::new().try_into(), Ok([]));
\nIf the length doesn’t match, the input comes back in Err:
\n\nlet r: Result<[i32; 4], _> = (0..10).collect::<Vec<_>>().try_into();\nassert_eq!(r, Err(vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9]));
\nIf you’re fine with just getting a prefix of the Vec<T>,\nyou can call .truncate(N) first.
\n\nlet mut v = String::from(\"hello world\").into_bytes();\nv.sort();\nv.truncate(2);\nlet [a, b]: [_; 2] = v.try_into().unwrap();\nassert_eq!(a, b' ');\nassert_eq!(b, b'd');
\n","TryFrom>","iroh_docs::sync::PeerIdBytes"],["1.48.0 · source§impl<T, A, const N: usize> TryFrom<Vec<T, A>> for [T; N]where\n A: Allocator,
source§fn try_from(vec: Vec<T, A>) -> Result<[T; N], Vec<T, A>>
Gets the entire contents of the Vec<T> as an array,\nif its size exactly matches that of the requested array.
\n§Examples
\nassert_eq!(vec![1, 2, 3].try_into(), Ok([1, 2, 3]));\nassert_eq!(<Vec<i32>>::new().try_into(), Ok([]));
\nIf the length doesn’t match, the input comes back in Err:
\n\nlet r: Result<[i32; 4], _> = (0..10).collect::<Vec<_>>().try_into();\nassert_eq!(r, Err(vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9]));
\nIf you’re fine with just getting a prefix of the Vec<T>,\nyou can call .truncate(N) first.
\n\nlet mut v = String::from(\"hello world\").into_bytes();\nv.sort();\nv.truncate(2);\nlet [a, b]: [_; 2] = v.try_into().unwrap();\nassert_eq!(a, b' ');\nassert_eq!(b, b'd');
\n","TryFrom>","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, T, E, const N: usize> TryJoin for [Fut; N]where\n Fut: IntoFuture<Output = Result<T, E>>,
§type Future = TryJoin<<Fut as IntoFuture>::IntoFuture, T, E, N>
Which kind of future are we turning this into?","TryJoin","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> Value for [T; N]where\n T: Value,
§type SelfType<'a> = [<T as Value>::SelfType<'a>; N]\nwhere\n [T; N]: 'a
SelfType<’a> must be the same type as Self with all lifetimes replaced with ’a§type AsBytes<'a> = Vec<u8>\nwhere\n [T; N]: 'a
§fn fixed_width() -> Option<usize>
Width of a fixed type, or None for variable width§fn from_bytes<'a>(data: &'a [u8]) -> [<T as Value>::SelfType<'a>; N]where\n [T; N]: 'a,
Deserializes data\nImplementations may return a view over data, or an owned type","Value","iroh_docs::sync::PeerIdBytes"],["","ValueOrd","iroh_docs::sync::PeerIdBytes"],["§impl<Z, const N: usize> Zeroize for [Z; N]where\n Z: Zeroize,
Impl [Zeroize] on arrays of types that impl [Zeroize].
\n","Zeroize","iroh_docs::sync::PeerIdBytes"],["","Zip","iroh_docs::sync::PeerIdBytes"],["source§impl<T, const N: usize> ConstParamTy for [T; N]where\n T: ConstParamTy,
","ConstParamTy","iroh_docs::sync::PeerIdBytes"],["1.58.0 · source§impl<T, const N: usize> Copy for [T; N]where\n T: Copy,
","Copy","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Eq for [T; N]where\n T: Eq,
","Eq","iroh_docs::sync::PeerIdBytes"],["source§impl<T, const N: usize> StructuralPartialEq for [T; N]
","StructuralPartialEq","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> Unaligned for [T; N]where\n T: Unaligned,
","Unaligned","iroh_docs::sync::PeerIdBytes"],["§impl<Z, const N: usize> ZeroizeOnDrop for [Z; N]where\n Z: ZeroizeOnDrop,
Impl [ZeroizeOnDrop] on arrays of types that impl [ZeroizeOnDrop].
\n","ZeroizeOnDrop","iroh_docs::sync::PeerIdBytes"]]
};if (window.register_type_impls) {window.register_type_impls(type_impls);} else {window.pending_type_impls = type_impls;}})()
\ No newline at end of file
fn max(self, other: Self) -> Selfwhere
diff --git a/pr/2595/docs/iroh_docs/sync/struct.Record.html b/pr/2595/docs/iroh_docs/sync/struct.Record.html
index 94479a973e..f06cccab52 100644
--- a/pr/2595/docs/iroh_docs/sync/struct.Record.html
+++ b/pr/2595/docs/iroh_docs/sync/struct.Record.html
@@ -1,11 +1,11 @@
Record in iroh_docs::sync - Rust pub struct Record { /* private fields */ }
Expand description
The data part of an entry in a Replica.
-Implementations§
source§impl Record
Implementations§
source§impl Record
sourcepub fn empty_current() -> Self
Create a tombstone record with the timestamp set to now.
sourcepub fn new_current(hash: Hash, len: u64) -> Self
Create a new Record with the timestamp set to now.
+sourcepub fn new_current(hash: Hash, len: u64) -> Self
Create a new Record with the timestamp set to now.
sourcepub fn content_len(&self) -> u64
Get the length of the data addressed by this record’s content hash.
-sourcepub fn content_hash(&self) -> Hash
Get the [struct@Hash] of the content data of this record.
+sourcepub fn content_hash(&self) -> Hash
Get the Hash of the content data of this record.
Trait Implementations§
source§impl<'de> Deserialize<'de> for Record
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl Ord for Record
Ordering for entry values.
diff --git a/pr/2595/docs/iroh_docs/sync/struct.Replica.html b/pr/2595/docs/iroh_docs/sync/struct.Replica.html
index 23a9798651..c4e161f3c3 100644
--- a/pr/2595/docs/iroh_docs/sync/struct.Replica.html
+++ b/pr/2595/docs/iroh_docs/sync/struct.Replica.html
@@ -5,7 +5,7 @@
&mut self,
key: impl AsRef<[u8]>,
author: &Author,
- hash: Hash,
+ hash: Hash,
len: u64
) -> Result<usize, InsertError>Insert a new record at the given key.
The entry will by signed by the provided author.
@@ -35,7 +35,7 @@ or an error if the entry failed to validate or if a store operation failed.
key: impl AsRef<[u8]>,
author: &Author,
data: impl AsRef<[u8]>
-) -> Result<Hash, InsertError>Hashes the given data and inserts it.
+) -> Result<Hash, InsertError>Hashes the given data and inserts it.
This does not store the content, just the record of it.
Returns the calculated hash.
sourcepub fn record_id(
diff --git a/pr/2595/docs/iroh_docs/sync/struct.SignedEntry.html b/pr/2595/docs/iroh_docs/sync/struct.SignedEntry.html
index 21644eacb1..9ef5e98134 100644
--- a/pr/2595/docs/iroh_docs/sync/struct.SignedEntry.html
+++ b/pr/2595/docs/iroh_docs/sync/struct.SignedEntry.html
@@ -14,7 +14,7 @@
sourcepub fn signature(&self) -> &EntrySignature
Get the signature.
sourcepub fn validate_empty(&self) -> Result<(), ValidationFailure>
Validate that the entry has the empty hash if the length is 0, or a non-zero length.
sourcepub fn content_hash(&self) -> Hash
Get the content [struct@Hash] of the entry.
+sourcepub fn content_hash(&self) -> Hash
Get the content Hash of the entry.
sourcepub fn content_len(&self) -> u64
Get the content length of the entry.
Get the author bytes of this entry.
Methods from Deref<Target = Record>§
sourcepub fn content_len(&self) -> u64
Get the length of the data addressed by this record’s content hash.
-sourcepub fn content_hash(&self) -> Hash
Get the [struct@Hash] of the content data of this record.
+sourcepub fn content_hash(&self) -> Hash
Get the Hash of the content data of this record.
Trait Implementations§
source§impl Clone for SignedEntry
source§fn clone(&self) -> SignedEntry
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moresource§impl Debug for SignedEntry
source§impl Deref for SignedEntry
source§impl<'de> Deserialize<'de> for SignedEntry
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl From<SignedEntry> for Entry
source§fn from(value: SignedEntry) -> Self
Converts to this type from the input type.source§impl Ord for SignedEntry
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
diff --git a/pr/2595/docs/iroh_docs/sync/type.ContentStatusCallback.html b/pr/2595/docs/iroh_docs/sync/type.ContentStatusCallback.html
index 46d5a5a49c..84ffdbe8ee 100644
--- a/pr/2595/docs/iroh_docs/sync/type.ContentStatusCallback.html
+++ b/pr/2595/docs/iroh_docs/sync/type.ContentStatusCallback.html
@@ -1,2 +1,2 @@
-ContentStatusCallback in iroh_docs::sync - Rust Type Alias iroh_docs::sync::ContentStatusCallback
source · pub type ContentStatusCallback = Arc<dyn Fn(Hash) -> ContentStatus + Send + Sync + 'static>;
Expand description
Callback that may be set on a replica to determine the availability status for a content hash.
+ContentStatusCallback in iroh_docs::sync - Rust Type Alias iroh_docs::sync::ContentStatusCallback
source · pub type ContentStatusCallback = Arc<dyn Fn(Hash) -> ContentStatus + Send + Sync + 'static>;
Expand description
Callback that may be set on a replica to determine the availability status for a content hash.
Aliased Type§
struct ContentStatusCallback { /* private fields */ }
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_net/discovery/dns/index.html b/pr/2595/docs/iroh_net/discovery/dns/index.html
index 5a80538422..a752b49d78 100644
--- a/pr/2595/docs/iroh_net/discovery/dns/index.html
+++ b/pr/2595/docs/iroh_net/discovery/dns/index.html
@@ -1,2 +1,2 @@
-iroh_net::discovery::dns - Rust Expand description
DNS node discovery for iroh-net
+iroh_net::discovery::dns - Rust Expand description
DNS node discovery for iroh-net
Structs§
- DNS node discovery
Constants§
- The n0 testing DNS node origin, for production.
- The n0 testing DNS node origin, for testing.
- Testing DNS node origin, must run server from
crate::test_utils::DnsPkarrServer.
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_net/discovery/dns/struct.DnsDiscovery.html b/pr/2595/docs/iroh_net/discovery/dns/struct.DnsDiscovery.html
index 3e7d5d71cc..7628fb45a9 100644
--- a/pr/2595/docs/iroh_net/discovery/dns/struct.DnsDiscovery.html
+++ b/pr/2595/docs/iroh_net/discovery/dns/struct.DnsDiscovery.html
@@ -28,7 +28,7 @@ custom discovery mechanism.
For testing it is also possible to use the N0_DNS_NODE_ORIGIN_STAGING domain
with DnsDiscovery::new. This would then use a hosted discovery service again,
but for testing purposes.
-Trait Implementations§
Trait Implementations§
source§impl Debug for DnsDiscovery
source§impl Discovery for DnsDiscovery
source§fn resolve(
&self,
ep: Endpoint,
node_id: NodeId
diff --git a/pr/2595/docs/iroh_net/discovery/trait.Discovery.html b/pr/2595/docs/iroh_net/discovery/trait.Discovery.html
index a53a618708..d3832a56b5 100644
--- a/pr/2595/docs/iroh_net/discovery/trait.Discovery.html
+++ b/pr/2595/docs/iroh_net/discovery/trait.Discovery.html
@@ -29,4 +29,4 @@ These tasks will be run on the runtime of the Option<BoxStream<Result<DiscoveryItem>>>
Implementors§
source§impl Discovery for DnsDiscovery
source§impl Discovery for LocalSwarmDiscovery
source§impl Discovery for PkarrPublisher
source§impl Discovery for PkarrResolver
source§impl Discovery for ConcurrentDiscovery
\ No newline at end of file
+
Implementors§
source§impl Discovery for DnsDiscovery
source§impl Discovery for LocalSwarmDiscovery
source§impl Discovery for PkarrPublisher
source§impl Discovery for PkarrResolver
source§impl Discovery for ConcurrentDiscovery
\ No newline at end of file
diff --git a/pr/2595/docs/src/iroh_net/discovery/dns.rs.html b/pr/2595/docs/src/iroh_net/discovery/dns.rs.html
index dd1a279fb3..1d32545ed3 100644
--- a/pr/2595/docs/src/iroh_net/discovery/dns.rs.html
+++ b/pr/2595/docs/src/iroh_net/discovery/dns.rs.html
@@ -97,6 +97,10 @@
97
98
99
+100
+101
+102
+103
//! DNS node discovery for iroh-net
use anyhow::Result;
@@ -182,6 +186,10 @@
fn resolve(&self, ep: Endpoint, node_id: NodeId) -> Option<BoxStream<Result<DiscoveryItem>>> {
let resolver = ep.dns_resolver().clone();
let origin_domain = self.origin_domain.clone();
+ #[cfg(any(test, feature = "test-utils"))]
+ if origin_domain.contains(&TEST_DNS_NODE_ORIGIN.to_string()) {
+ panic!("wait. THIS IS ILLEGAL!");
+ }
let fut = async move {
let node_addr = resolver
.lookup_by_id_staggered(&node_id, &origin_domain, DNS_STAGGERING_MS)
diff --git a/pr/2595/docs/trait.impl/iroh_base/ticket/trait.Ticket.js b/pr/2595/docs/trait.impl/iroh_base/ticket/trait.Ticket.js
index 12fa1e3ee5..5d209fabd2 100644
--- a/pr/2595/docs/trait.impl/iroh_base/ticket/trait.Ticket.js
+++ b/pr/2595/docs/trait.impl/iroh_base/ticket/trait.Ticket.js
@@ -1,5 +1,5 @@
(function() {var implementors = {
"iroh":[],
"iroh_base":[],
-"iroh_docs":[["impl Ticket for DocTicket"]]
+"iroh_docs":[["impl Ticket for DocTicket"]]
};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
diff --git a/pr/2595/docs/type.impl/std/primitive.array.js b/pr/2595/docs/type.impl/std/primitive.array.js
index 588a8b53a3..3006964922 100644
--- a/pr/2595/docs/type.impl/std/primitive.array.js
+++ b/pr/2595/docs/type.impl/std/primitive.array.js
@@ -1,4 +1,4 @@
(function() {var type_impls = {
"iroh":[["source§impl<T, const N: usize> [T; N]
1.55.0 · sourcepub fn map<F, U>(self, f: F) -> [U; N]where\n F: FnMut(T) -> U,
Returns an array of the same size as self, with function f applied to each element\nin order.
\nIf you don’t necessarily need a new fixed-size array, consider using\nIterator::map instead.
\n§Note on performance and stack usage
\nUnfortunately, usages of this method are currently not always optimized\nas well as they could be. This mainly concerns large arrays, as mapping\nover small arrays seem to be optimized just fine. Also note that in\ndebug mode (i.e. without any optimizations), this method can use a lot\nof stack space (a few times the size of the array or more).
\nTherefore, in performance-critical code, try to avoid using this method\non large arrays or check the emitted code. Also try to avoid chained\nmaps (e.g. arr.map(...).map(...)).
\nIn many cases, you can instead use Iterator::map by calling .iter()\nor .into_iter() on your array. [T; N]::map is only necessary if you\nreally need a new array of the same size as the result. Rust’s lazy\niterators tend to get optimized very well.
\n§Examples
\nlet x = [1, 2, 3];\nlet y = x.map(|v| v + 1);\nassert_eq!(y, [2, 3, 4]);\n\nlet x = [1, 2, 3];\nlet mut temp = 0;\nlet y = x.map(|v| { temp += 1; v * temp });\nassert_eq!(y, [1, 4, 9]);\n\nlet x = [\"Ferris\", \"Bueller's\", \"Day\", \"Off\"];\nlet y = x.map(|v| v.len());\nassert_eq!(y, [6, 9, 3, 3]);
\nsourcepub fn try_map<F, R>(\n self,\n f: F\n) -> <<R as Try>::Residual as Residual<[<R as Try>::Output; N]>>::TryType
🔬This is a nightly-only experimental API. (array_try_map)
A fallible function f applied to each element on array self in order to\nreturn an array the same size as self or the first error encountered.
\nThe return type of this function depends on the return type of the closure.\nIf you return Result<T, E> from the closure, you’ll get a Result<[T; N], E>.\nIf you return Option<T> from the closure, you’ll get an Option<[T; N]>.
\n§Examples
\n#![feature(array_try_map)]\n\nlet a = [\"1\", \"2\", \"3\"];\nlet b = a.try_map(|v| v.parse::<u32>()).unwrap().map(|v| v + 1);\nassert_eq!(b, [2, 3, 4]);\n\nlet a = [\"1\", \"2a\", \"3\"];\nlet b = a.try_map(|v| v.parse::<u32>());\nassert!(b.is_err());\n\nuse std::num::NonZero;\n\nlet z = [1, 2, 0, 3, 4];\nassert_eq!(z.try_map(NonZero::new), None);\n\nlet a = [1, 2, 3];\nlet b = a.try_map(NonZero::new);\nlet c = b.map(|x| x.map(NonZero::get));\nassert_eq!(c, Some(a));
\n1.57.0 (const: 1.57.0) · sourcepub const fn as_slice(&self) -> &[T]
Returns a slice containing the entire array. Equivalent to &s[..].
\n1.57.0 · sourcepub fn as_mut_slice(&mut self) -> &mut [T]
Returns a mutable slice containing the entire array. Equivalent to\n&mut s[..].
\n1.77.0 · sourcepub fn each_ref(&self) -> [&T; N]
Borrows each element and returns an array of references with the same\nsize as self.
\n§Example
\nlet floats = [3.1, 2.7, -1.0];\nlet float_refs: [&f64; 3] = floats.each_ref();\nassert_eq!(float_refs, [&3.1, &2.7, &-1.0]);
\nThis method is particularly useful if combined with other methods, like\nmap. This way, you can avoid moving the original\narray if its elements are not Copy.
\n\nlet strings = [\"Ferris\".to_string(), \"♥\".to_string(), \"Rust\".to_string()];\nlet is_ascii = strings.each_ref().map(|s| s.is_ascii());\nassert_eq!(is_ascii, [true, false, true]);\n\n// We can still access the original array: it has not been moved.\nassert_eq!(strings.len(), 3);
\n1.77.0 · sourcepub fn each_mut(&mut self) -> [&mut T; N]
Borrows each element mutably and returns an array of mutable references\nwith the same size as self.
\n§Example
\n\nlet mut floats = [3.1, 2.7, -1.0];\nlet float_refs: [&mut f64; 3] = floats.each_mut();\n*float_refs[0] = 0.0;\nassert_eq!(float_refs, [&mut 0.0, &mut 2.7, &mut -1.0]);\nassert_eq!(floats, [0.0, 2.7, -1.0]);
\nsourcepub fn split_array_ref<const M: usize>(&self) -> (&[T; M], &[T])
🔬This is a nightly-only experimental API. (split_array)
Divides one array reference into two at an index.
\nThe first will contain all indices from [0, M) (excluding\nthe index M itself) and the second will contain all\nindices from [M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet v = [1, 2, 3, 4, 5, 6];\n\n{\n let (left, right) = v.split_array_ref::<0>();\n assert_eq!(left, &[]);\n assert_eq!(right, &[1, 2, 3, 4, 5, 6]);\n}\n\n{\n let (left, right) = v.split_array_ref::<2>();\n assert_eq!(left, &[1, 2]);\n assert_eq!(right, &[3, 4, 5, 6]);\n}\n\n{\n let (left, right) = v.split_array_ref::<6>();\n assert_eq!(left, &[1, 2, 3, 4, 5, 6]);\n assert_eq!(right, &[]);\n}
\nsourcepub fn split_array_mut<const M: usize>(&mut self) -> (&mut [T; M], &mut [T])
🔬This is a nightly-only experimental API. (split_array)
Divides one mutable array reference into two at an index.
\nThe first will contain all indices from [0, M) (excluding\nthe index M itself) and the second will contain all\nindices from [M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet mut v = [1, 0, 3, 0, 5, 6];\nlet (left, right) = v.split_array_mut::<2>();\nassert_eq!(left, &mut [1, 0][..]);\nassert_eq!(right, &mut [3, 0, 5, 6]);\nleft[1] = 2;\nright[1] = 4;\nassert_eq!(v, [1, 2, 3, 4, 5, 6]);
\nsourcepub fn rsplit_array_ref<const M: usize>(&self) -> (&[T], &[T; M])
🔬This is a nightly-only experimental API. (split_array)
Divides one array reference into two at an index from the end.
\nThe first will contain all indices from [0, N - M) (excluding\nthe index N - M itself) and the second will contain all\nindices from [N - M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet v = [1, 2, 3, 4, 5, 6];\n\n{\n let (left, right) = v.rsplit_array_ref::<0>();\n assert_eq!(left, &[1, 2, 3, 4, 5, 6]);\n assert_eq!(right, &[]);\n}\n\n{\n let (left, right) = v.rsplit_array_ref::<2>();\n assert_eq!(left, &[1, 2, 3, 4]);\n assert_eq!(right, &[5, 6]);\n}\n\n{\n let (left, right) = v.rsplit_array_ref::<6>();\n assert_eq!(left, &[]);\n assert_eq!(right, &[1, 2, 3, 4, 5, 6]);\n}
\nsourcepub fn rsplit_array_mut<const M: usize>(&mut self) -> (&mut [T], &mut [T; M])
🔬This is a nightly-only experimental API. (split_array)
Divides one mutable array reference into two at an index from the end.
\nThe first will contain all indices from [0, N - M) (excluding\nthe index N - M itself) and the second will contain all\nindices from [N - M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet mut v = [1, 0, 3, 0, 5, 6];\nlet (left, right) = v.rsplit_array_mut::<4>();\nassert_eq!(left, &mut [1, 0]);\nassert_eq!(right, &mut [3, 0, 5, 6][..]);\nleft[1] = 2;\nright[1] = 4;\nassert_eq!(v, [1, 2, 3, 4, 5, 6]);
\n",0,"iroh::docs::PeerIdBytes"],["source§impl<const N: usize> [u8; N]
sourcepub const fn as_ascii(&self) -> Option<&[AsciiChar; N]>
🔬This is a nightly-only experimental API. (ascii_char)
Converts this array of bytes into a array of ASCII characters,\nor returns None if any of the characters is non-ASCII.
\n§Examples
\n#![feature(ascii_char)]\n#![feature(const_option)]\n\nconst HEX_DIGITS: [std::ascii::Char; 16] =\n *b\"0123456789abcdef\".as_ascii().unwrap();\n\nassert_eq!(HEX_DIGITS[1].as_str(), \"1\");\nassert_eq!(HEX_DIGITS[10].as_str(), \"a\");
\nsourcepub const unsafe fn as_ascii_unchecked(&self) -> &[AsciiChar; N]
🔬This is a nightly-only experimental API. (ascii_char)
Converts this array of bytes into a array of ASCII characters,\nwithout checking whether they’re valid.
\n§Safety
\nEvery byte in the array must be in 0..=127, or else this is UB.
\n",0,"iroh::docs::PeerIdBytes"],["§impl<T> Array for [T; 32]where\n T: Default,
§fn as_slice_mut(&mut self) -> &mut [T]
Gives a unique slice over the whole thing. Read more","Array","iroh::docs::PeerIdBytes"],["","Array","iroh::docs::PeerIdBytes"],["§impl<const N: usize, T> AsBytes for [T; N]where\n T: AsBytes,
§fn write_to_prefix(&self, bytes: &mut [u8]) -> Option<()>
","AsBytes","iroh::docs::PeerIdBytes"],["","AsBytes","iroh::docs::PeerIdBytes"],["","AsMut<[T]>","iroh::docs::PeerIdBytes"],["","AsRef<[T]>","iroh::docs::PeerIdBytes"],["§impl<T, const N: usize> BitView for [T; N]where\n T: BitStore,
Note that overly-large arrays may cause the conversions to fail.
\n§fn view_bits<O>(&self) -> &BitSlice<T, O>where\n O: BitOrder,
Views a memory region as an immutable bit-slice.§fn try_view_bits<O>(&self) -> Result<&BitSlice<T, O>, BitSpanError<T>>where\n O: BitOrder,
Attempts to view a memory region as an immutable bit-slice. Read more§fn view_bits_mut<O>(&mut self) -> &mut BitSlice<T, O>where\n O: BitOrder,
Views a memory region as a mutable bit-slice.§fn try_view_bits_mut<O>(\n &mut self\n) -> Result<&mut BitSlice<T, O>, BitSpanError<T>>where\n O: BitOrder,
Attempts to view a memory region as a mutable bit-slice. Read more","BitView","iroh::docs::PeerIdBytes"],["§impl<T, const N: usize> BitViewSized for [T; N]where\n T: BitStore,
§fn as_raw_slice(&self) -> &[<[T; N] as BitView>::Store]
Views the type as a slice of its elements.§fn as_raw_mut_slice(&mut self) -> &mut [<[T; N] as BitView>::Store]
Views the type as a mutable slice of its elements.§fn into_bitarray<O>(self) -> BitArray<Self, O>where\n O: BitOrder,
Wraps self in a BitArray.","BitViewSized","iroh::docs::PeerIdBytes"],["","Borrow<[T]>","iroh::docs::PeerIdBytes"],["1.4.0 · source§impl<T, const N: usize> BorrowMut<[T]> for [T; N]
source§fn borrow_mut(&mut self) -> &mut [T]
Mutably borrows from an owned value. Read more","BorrowMut<[T]>","iroh::docs::PeerIdBytes"],["","Chain","iroh::docs::PeerIdBytes"],["","Clone","iroh::docs::PeerIdBytes"],["","Debug","iroh::docs::PeerIdBytes"],["§impl<const N: usize> Decode for [u8; N]
Decodes a byte array from byte[n] as described in RFC4251 § 5:
\n\nA byte represents an arbitrary 8-bit value (octet). Fixed length\ndata is sometimes represented as an array of bytes, written\nbyte[n], where n is the number of bytes in the array.
\n
\n","Decode","iroh::docs::PeerIdBytes"],["§impl<'a, T, const N: usize> DecodeValue<'a> for [T; N]where\n T: Decode<'a>,
§fn decode_value<R>(reader: &mut R, header: Header) -> Result<[T; N], Error>where\n R: Reader<'a>,
Attempt to decode this message using the provided [Reader].","DecodeValue<'a>","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["source§impl<'de, T> Deserialize<'de> for [T; 32]where\n T: Deserialize<'de>,
source§fn deserialize<D>(\n deserializer: D\n) -> Result<[T; 32], <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more","Deserialize<'de>","iroh::docs::PeerIdBytes"],["source§impl<'de, const N: usize> Deserialize<'de> for [u8; N]
source§fn deserialize<D>(\n deserializer: D\n) -> Result<[u8; N], <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
","Deserialize<'de>","iroh::docs::PeerIdBytes"],["§impl<const N: usize> Encode for [u8; N]
Encodes [u8; N] into byte[n] as described in RFC4251 § 5:
\n\nA byte represents an arbitrary 8-bit value (octet). Fixed length\ndata is sometimes represented as an array of bytes, written\nbyte[n], where n is the number of bytes in the array.
\n
\n§fn encoded_len(&self) -> Result<usize, Error>
Get the length of this type encoded in bytes, prior to Base64 encoding.§fn encode(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value using the provided [Writer].§fn encoded_len_prefixed(&self) -> Result<usize, Error>
Return the length of this type after encoding when prepended with a\nuint32 length prefix.§fn encode_prefixed(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value, first prepending a uint32 length prefix\nset to [Encode::encoded_len].","Encode","iroh::docs::PeerIdBytes"],["","EncodeLabelSet","iroh::docs::PeerIdBytes"],["§impl<T, const N: usize> EncodeValue for [T; N]where\n T: Encode,
","EncodeValue","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["§impl<'a> FindToken<&'a u8> for [u8; 32]
§fn find_token(&self, token: &u8) -> bool
Returns true if self contains the token","FindToken<&'a u8>","iroh::docs::PeerIdBytes"],["§impl FindToken<u8> for [u8; 32]
§fn find_token(&self, token: u8) -> bool
Returns true if self contains the token","FindToken","iroh::docs::PeerIdBytes"],["","FixedTag","iroh::docs::PeerIdBytes"],["","From<&Signature>","iroh::docs::PeerIdBytes"],["","From","iroh::docs::PeerIdBytes"],["§impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>>> for [T; 32]
","From, B0>, B0>, B0>, B0>, B0>>>","iroh::docs::PeerIdBytes"],["","From","iroh::docs::PeerIdBytes"],["","From","iroh::docs::PeerIdBytes"],["","From>","iroh::docs::PeerIdBytes"],["","From","iroh::docs::PeerIdBytes"],["","From","iroh::docs::PeerIdBytes"],["","From","iroh::docs::PeerIdBytes"],["","From>","iroh::docs::PeerIdBytes"],["§impl<const N: usize, T> FromBytes for [T; N]where\n T: FromBytes,
§fn slice_from_prefix(bytes: &[u8], count: usize) -> Option<(&[Self], &[u8])>where\n Self: Sized,
Interprets the prefix of the given bytes as a &[Self] with length\nequal to count without copying. Read more§fn slice_from_suffix(bytes: &[u8], count: usize) -> Option<(&[u8], &[Self])>where\n Self: Sized,
Interprets the suffix of the given bytes as a &[Self] with length\nequal to count without copying. Read more§fn read_from_prefix(bytes: &[u8]) -> Option<Self>where\n Self: Sized,
","FromBytes","iroh::docs::PeerIdBytes"],["","FromHex","iroh::docs::PeerIdBytes"],["","FromZeroes","iroh::docs::PeerIdBytes"],["","Hash","iroh::docs::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Hash for [T; N]where\n T: Hash,
The hash of an array is the same as that of the corresponding slice,\nas required by the Borrow implementation.
\n\nuse std::hash::BuildHasher;\n\nlet b = std::hash::RandomState::new();\nlet a: [u8; 3] = [0xa8, 0x3c, 0x09];\nlet s: &[u8] = &[0xa8, 0x3c, 0x09];\nassert_eq!(b.hash_one(a), b.hash_one(s));
\n","Hash","iroh::docs::PeerIdBytes"],["","Index","iroh::docs::PeerIdBytes"],["","IndexMut","iroh::docs::PeerIdBytes"],["","InputLength","iroh::docs::PeerIdBytes"],["1.53.0 · source§impl<T, const N: usize> IntoIterator for [T; N]
source§fn into_iter(self) -> <[T; N] as IntoIterator>::IntoIter
Creates a consuming iterator, that is, one that moves each value out of\nthe array (from start to end). The array cannot be used after calling\nthis unless T implements Copy, so the whole array is copied.
\nArrays have special behavior when calling .into_iter() prior to the\n2021 edition – see the array Editions section for more information.
\n","IntoIterator","iroh::docs::PeerIdBytes"],["§impl<const N: usize> IntoResponse for [u8; N]
§fn into_response(self) -> Response<Body>
Create a response.","IntoResponse","iroh::docs::PeerIdBytes"],["§impl<Fut, const N: usize> Join for [Fut; N]where\n Fut: IntoFuture,
§type Output = [<Fut as IntoFuture>::Output; N]
The resulting output type.§type Future = Join<<Fut as IntoFuture>::IntoFuture, N>
The Future implementation returned by this method.","Join","iroh::docs::PeerIdBytes"],["","Key","iroh::docs::PeerIdBytes"],["§impl<T, const N: usize> MaxSize for [T; N]where\n T: MaxSize,
§const POSTCARD_MAX_SIZE: usize = _
The maximum possible size that the serialization of this\ntype can have, in bytes.","MaxSize","iroh::docs::PeerIdBytes"],["","Merge","iroh::docs::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Ord for [T; N]where\n T: Ord,
Implements comparison of arrays lexicographically.
\n1.21.0 · source§fn max(self, other: Self) -> Selfwhere\n Self: Sized,
Compares and returns the maximum of two values. Read more","Ord","iroh::docs::PeerIdBytes"],["","PartialEq<&[U]>","iroh::docs::PeerIdBytes"],["1.0.0 · source§impl<T, U, const N: usize> PartialEq<&mut [U]> for [T; N]where\n T: PartialEq<U>,
","PartialEq<&mut [U]>","iroh::docs::PeerIdBytes"],["","PartialEq<[U]>","iroh::docs::PeerIdBytes"],["","PartialEq<[U; N]>","iroh::docs::PeerIdBytes"],["","PartialEq","iroh::docs::PeerIdBytes"],["§impl<A, B, const N: usize, const M: usize> PartialEq<Vec<A, N>> for [B; M]where\n A: PartialEq<B>,
","PartialEq>","iroh::docs::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> PartialOrd for [T; N]where\n T: PartialOrd,
Implements comparison of arrays lexicographically.
\nsource§fn le(&self, other: &[T; N]) -> bool
This method tests less than or equal to (for self and other) and is used by the <=\noperator. Read more","PartialOrd","iroh::docs::PeerIdBytes"],["§impl<Fut, const N: usize> Race for [Fut; N]where\n Fut: IntoFuture,
§type Output = <Fut as IntoFuture>::Output
The resulting output type.§type Future = Race<<Fut as IntoFuture>::IntoFuture, N>
Which kind of future are we turning this into?","Race","iroh::docs::PeerIdBytes"],["§impl<Fut, T, E, const N: usize> RaceOk for [Fut; N]where\n Fut: IntoFuture<Output = Result<T, E>>,
§type Future = RaceOk<<Fut as IntoFuture>::IntoFuture, T, E, N>
Which kind of future are we turning this into?","RaceOk","iroh::docs::PeerIdBytes"],["","Schema","iroh::docs::PeerIdBytes"],["source§impl<T> Serialize for [T; 32]where\n T: 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","iroh::docs::PeerIdBytes"],["source§impl<const N: usize> Serialize for [u8; N]
source§fn serialize<S>(\n &self,\n serializer: S\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where\n S: Serializer,
","Serialize","iroh::docs::PeerIdBytes"],["1.51.0 · source§impl<T, const N: usize> SlicePattern for [T; N]
","SlicePattern","iroh::docs::PeerIdBytes"],["1.34.0 · source§impl<T, const N: usize> TryFrom<&[T]> for [T; N]where\n T: Copy,
Tries to create an array [T; N] by copying from a slice &[T]. Succeeds if\nslice.len() == N.
\n\nlet bytes: [u8; 3] = [1, 0, 2];\n\nlet bytes_head: [u8; 2] = <[u8; 2]>::try_from(&bytes[0..2]).unwrap();\nassert_eq!(1, u16::from_le_bytes(bytes_head));\n\nlet bytes_tail: [u8; 2] = bytes[1..3].try_into().unwrap();\nassert_eq!(512, u16::from_le_bytes(bytes_tail));
\n§type Error = TryFromSliceError
The type returned in the event of a conversion error.","TryFrom<&[T]>","iroh::docs::PeerIdBytes"],["1.59.0 · source§impl<T, const N: usize> TryFrom<&mut [T]> for [T; N]where\n T: Copy,
Tries to create an array [T; N] by copying from a mutable slice &mut [T].\nSucceeds if slice.len() == N.
\n\nlet mut bytes: [u8; 3] = [1, 0, 2];\n\nlet bytes_head: [u8; 2] = <[u8; 2]>::try_from(&mut bytes[0..2]).unwrap();\nassert_eq!(1, u16::from_le_bytes(bytes_head));\n\nlet bytes_tail: [u8; 2] = (&mut bytes[1..3]).try_into().unwrap();\nassert_eq!(512, u16::from_le_bytes(bytes_tail));
\n§type Error = TryFromSliceError
The type returned in the event of a conversion error.","TryFrom<&mut [T]>","iroh::docs::PeerIdBytes"],["§impl<T, A, const N: usize> TryFrom<Vec<T, A>> for [T; N]where\n A: Allocator,
§fn try_from(vec: Vec<T, A>) -> Result<[T; N], Vec<T, A>>
Gets the entire contents of the Vec<T> as an array,\nif its size exactly matches that of the requested array.
\n§Examples
\nassert_eq!(vec![1, 2, 3].try_into(), Ok([1, 2, 3]));\nassert_eq!(<Vec<i32>>::new().try_into(), Ok([]));
\nIf the length doesn’t match, the input comes back in Err:
\n\nlet r: Result<[i32; 4], _> = (0..10).collect::<Vec<_>>().try_into();\nassert_eq!(r, Err(vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9]));
\nIf you’re fine with just getting a prefix of the Vec<T>,\nyou can call .truncate(N) first.
\n\nlet mut v = String::from(\"hello world\").into_bytes();\nv.sort();\nv.truncate(2);\nlet [a, b]: [_; 2] = v.try_into().unwrap();\nassert_eq!(a, b' ');\nassert_eq!(b, b'd');
\n","TryFrom>","iroh::docs::PeerIdBytes"],["1.48.0 · source§impl<T, A, const N: usize> TryFrom<Vec<T, A>> for [T; N]where\n A: Allocator,
source§fn try_from(vec: Vec<T, A>) -> Result<[T; N], Vec<T, A>>
Gets the entire contents of the Vec<T> as an array,\nif its size exactly matches that of the requested array.
\n§Examples
\nassert_eq!(vec![1, 2, 3].try_into(), Ok([1, 2, 3]));\nassert_eq!(<Vec<i32>>::new().try_into(), Ok([]));
\nIf the length doesn’t match, the input comes back in Err:
\n\nlet r: Result<[i32; 4], _> = (0..10).collect::<Vec<_>>().try_into();\nassert_eq!(r, Err(vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9]));
\nIf you’re fine with just getting a prefix of the Vec<T>,\nyou can call .truncate(N) first.
\n\nlet mut v = String::from(\"hello world\").into_bytes();\nv.sort();\nv.truncate(2);\nlet [a, b]: [_; 2] = v.try_into().unwrap();\nassert_eq!(a, b' ');\nassert_eq!(b, b'd');
\n","TryFrom>","iroh::docs::PeerIdBytes"],["§impl<Fut, T, E, const N: usize> TryJoin for [Fut; N]where\n Fut: IntoFuture<Output = Result<T, E>>,
§type Future = TryJoin<<Fut as IntoFuture>::IntoFuture, T, E, N>
Which kind of future are we turning this into?","TryJoin","iroh::docs::PeerIdBytes"],["§impl<const N: usize, T> Value for [T; N]where\n T: Value,
§type SelfType<'a> = [<T as Value>::SelfType<'a>; N]\nwhere\n [T; N]: 'a
SelfType<’a> must be the same type as Self with all lifetimes replaced with ’a§type AsBytes<'a> = Vec<u8>\nwhere\n [T; N]: 'a
§fn fixed_width() -> Option<usize>
Width of a fixed type, or None for variable width§fn from_bytes<'a>(data: &'a [u8]) -> [<T as Value>::SelfType<'a>; N]where\n [T; N]: 'a,
Deserializes data\nImplementations may return a view over data, or an owned type","Value","iroh::docs::PeerIdBytes"],["","ValueOrd","iroh::docs::PeerIdBytes"],["§impl<Z, const N: usize> Zeroize for [Z; N]where\n Z: Zeroize,
Impl [Zeroize] on arrays of types that impl [Zeroize].
\n","Zeroize","iroh::docs::PeerIdBytes"],["","Zip","iroh::docs::PeerIdBytes"],["source§impl<T, const N: usize> ConstParamTy for [T; N]where\n T: ConstParamTy,
","ConstParamTy","iroh::docs::PeerIdBytes"],["1.58.0 · source§impl<T, const N: usize> Copy for [T; N]where\n T: Copy,
","Copy","iroh::docs::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Eq for [T; N]where\n T: Eq,
","Eq","iroh::docs::PeerIdBytes"],["source§impl<T, const N: usize> StructuralPartialEq for [T; N]
","StructuralPartialEq","iroh::docs::PeerIdBytes"],["§impl<const N: usize, T> Unaligned for [T; N]where\n T: Unaligned,
","Unaligned","iroh::docs::PeerIdBytes"],["§impl<Z, const N: usize> ZeroizeOnDrop for [Z; N]where\n Z: ZeroizeOnDrop,
Impl [ZeroizeOnDrop] on arrays of types that impl [ZeroizeOnDrop].
\n","ZeroizeOnDrop","iroh::docs::PeerIdBytes"]],
-"iroh_docs":[["source§impl<T, const N: usize> [T; N]
1.55.0 · sourcepub fn map<F, U>(self, f: F) -> [U; N]where\n F: FnMut(T) -> U,
Returns an array of the same size as self, with function f applied to each element\nin order.
\nIf you don’t necessarily need a new fixed-size array, consider using\nIterator::map instead.
\n§Note on performance and stack usage
\nUnfortunately, usages of this method are currently not always optimized\nas well as they could be. This mainly concerns large arrays, as mapping\nover small arrays seem to be optimized just fine. Also note that in\ndebug mode (i.e. without any optimizations), this method can use a lot\nof stack space (a few times the size of the array or more).
\nTherefore, in performance-critical code, try to avoid using this method\non large arrays or check the emitted code. Also try to avoid chained\nmaps (e.g. arr.map(...).map(...)).
\nIn many cases, you can instead use Iterator::map by calling .iter()\nor .into_iter() on your array. [T; N]::map is only necessary if you\nreally need a new array of the same size as the result. Rust’s lazy\niterators tend to get optimized very well.
\n§Examples
\nlet x = [1, 2, 3];\nlet y = x.map(|v| v + 1);\nassert_eq!(y, [2, 3, 4]);\n\nlet x = [1, 2, 3];\nlet mut temp = 0;\nlet y = x.map(|v| { temp += 1; v * temp });\nassert_eq!(y, [1, 4, 9]);\n\nlet x = [\"Ferris\", \"Bueller's\", \"Day\", \"Off\"];\nlet y = x.map(|v| v.len());\nassert_eq!(y, [6, 9, 3, 3]);
\nsourcepub fn try_map<F, R>(\n self,\n f: F\n) -> <<R as Try>::Residual as Residual<[<R as Try>::Output; N]>>::TryType
🔬This is a nightly-only experimental API. (array_try_map)
A fallible function f applied to each element on array self in order to\nreturn an array the same size as self or the first error encountered.
\nThe return type of this function depends on the return type of the closure.\nIf you return Result<T, E> from the closure, you’ll get a Result<[T; N], E>.\nIf you return Option<T> from the closure, you’ll get an Option<[T; N]>.
\n§Examples
\n#![feature(array_try_map)]\n\nlet a = [\"1\", \"2\", \"3\"];\nlet b = a.try_map(|v| v.parse::<u32>()).unwrap().map(|v| v + 1);\nassert_eq!(b, [2, 3, 4]);\n\nlet a = [\"1\", \"2a\", \"3\"];\nlet b = a.try_map(|v| v.parse::<u32>());\nassert!(b.is_err());\n\nuse std::num::NonZero;\n\nlet z = [1, 2, 0, 3, 4];\nassert_eq!(z.try_map(NonZero::new), None);\n\nlet a = [1, 2, 3];\nlet b = a.try_map(NonZero::new);\nlet c = b.map(|x| x.map(NonZero::get));\nassert_eq!(c, Some(a));
\n1.57.0 (const: 1.57.0) · sourcepub const fn as_slice(&self) -> &[T]
Returns a slice containing the entire array. Equivalent to &s[..].
\n1.57.0 · sourcepub fn as_mut_slice(&mut self) -> &mut [T]
Returns a mutable slice containing the entire array. Equivalent to\n&mut s[..].
\n1.77.0 · sourcepub fn each_ref(&self) -> [&T; N]
Borrows each element and returns an array of references with the same\nsize as self.
\n§Example
\nlet floats = [3.1, 2.7, -1.0];\nlet float_refs: [&f64; 3] = floats.each_ref();\nassert_eq!(float_refs, [&3.1, &2.7, &-1.0]);
\nThis method is particularly useful if combined with other methods, like\nmap. This way, you can avoid moving the original\narray if its elements are not Copy.
\n\nlet strings = [\"Ferris\".to_string(), \"♥\".to_string(), \"Rust\".to_string()];\nlet is_ascii = strings.each_ref().map(|s| s.is_ascii());\nassert_eq!(is_ascii, [true, false, true]);\n\n// We can still access the original array: it has not been moved.\nassert_eq!(strings.len(), 3);
\n1.77.0 · sourcepub fn each_mut(&mut self) -> [&mut T; N]
Borrows each element mutably and returns an array of mutable references\nwith the same size as self.
\n§Example
\n\nlet mut floats = [3.1, 2.7, -1.0];\nlet float_refs: [&mut f64; 3] = floats.each_mut();\n*float_refs[0] = 0.0;\nassert_eq!(float_refs, [&mut 0.0, &mut 2.7, &mut -1.0]);\nassert_eq!(floats, [0.0, 2.7, -1.0]);
\nsourcepub fn split_array_ref<const M: usize>(&self) -> (&[T; M], &[T])
🔬This is a nightly-only experimental API. (split_array)
Divides one array reference into two at an index.
\nThe first will contain all indices from [0, M) (excluding\nthe index M itself) and the second will contain all\nindices from [M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet v = [1, 2, 3, 4, 5, 6];\n\n{\n let (left, right) = v.split_array_ref::<0>();\n assert_eq!(left, &[]);\n assert_eq!(right, &[1, 2, 3, 4, 5, 6]);\n}\n\n{\n let (left, right) = v.split_array_ref::<2>();\n assert_eq!(left, &[1, 2]);\n assert_eq!(right, &[3, 4, 5, 6]);\n}\n\n{\n let (left, right) = v.split_array_ref::<6>();\n assert_eq!(left, &[1, 2, 3, 4, 5, 6]);\n assert_eq!(right, &[]);\n}
\nsourcepub fn split_array_mut<const M: usize>(&mut self) -> (&mut [T; M], &mut [T])
🔬This is a nightly-only experimental API. (split_array)
Divides one mutable array reference into two at an index.
\nThe first will contain all indices from [0, M) (excluding\nthe index M itself) and the second will contain all\nindices from [M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet mut v = [1, 0, 3, 0, 5, 6];\nlet (left, right) = v.split_array_mut::<2>();\nassert_eq!(left, &mut [1, 0][..]);\nassert_eq!(right, &mut [3, 0, 5, 6]);\nleft[1] = 2;\nright[1] = 4;\nassert_eq!(v, [1, 2, 3, 4, 5, 6]);
\nsourcepub fn rsplit_array_ref<const M: usize>(&self) -> (&[T], &[T; M])
🔬This is a nightly-only experimental API. (split_array)
Divides one array reference into two at an index from the end.
\nThe first will contain all indices from [0, N - M) (excluding\nthe index N - M itself) and the second will contain all\nindices from [N - M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet v = [1, 2, 3, 4, 5, 6];\n\n{\n let (left, right) = v.rsplit_array_ref::<0>();\n assert_eq!(left, &[1, 2, 3, 4, 5, 6]);\n assert_eq!(right, &[]);\n}\n\n{\n let (left, right) = v.rsplit_array_ref::<2>();\n assert_eq!(left, &[1, 2, 3, 4]);\n assert_eq!(right, &[5, 6]);\n}\n\n{\n let (left, right) = v.rsplit_array_ref::<6>();\n assert_eq!(left, &[]);\n assert_eq!(right, &[1, 2, 3, 4, 5, 6]);\n}
\nsourcepub fn rsplit_array_mut<const M: usize>(&mut self) -> (&mut [T], &mut [T; M])
🔬This is a nightly-only experimental API. (split_array)
Divides one mutable array reference into two at an index from the end.
\nThe first will contain all indices from [0, N - M) (excluding\nthe index N - M itself) and the second will contain all\nindices from [N - M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet mut v = [1, 0, 3, 0, 5, 6];\nlet (left, right) = v.rsplit_array_mut::<4>();\nassert_eq!(left, &mut [1, 0]);\nassert_eq!(right, &mut [3, 0, 5, 6][..]);\nleft[1] = 2;\nright[1] = 4;\nassert_eq!(v, [1, 2, 3, 4, 5, 6]);
\n",0,"iroh_docs::sync::PeerIdBytes"],["source§impl<const N: usize> [u8; N]
sourcepub const fn as_ascii(&self) -> Option<&[AsciiChar; N]>
🔬This is a nightly-only experimental API. (ascii_char)
Converts this array of bytes into a array of ASCII characters,\nor returns None if any of the characters is non-ASCII.
\n§Examples
\n#![feature(ascii_char)]\n#![feature(const_option)]\n\nconst HEX_DIGITS: [std::ascii::Char; 16] =\n *b\"0123456789abcdef\".as_ascii().unwrap();\n\nassert_eq!(HEX_DIGITS[1].as_str(), \"1\");\nassert_eq!(HEX_DIGITS[10].as_str(), \"a\");
\nsourcepub const unsafe fn as_ascii_unchecked(&self) -> &[AsciiChar; N]
🔬This is a nightly-only experimental API. (ascii_char)
Converts this array of bytes into a array of ASCII characters,\nwithout checking whether they’re valid.
\n§Safety
\nEvery byte in the array must be in 0..=127, or else this is UB.
\n",0,"iroh_docs::sync::PeerIdBytes"],["§impl<T> Array for [T; 32]where\n T: Default,
§fn as_slice_mut(&mut self) -> &mut [T]
Gives a unique slice over the whole thing. Read more","Array","iroh_docs::sync::PeerIdBytes"],["","Array","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> AsBytes for [T; N]where\n T: AsBytes,
§fn write_to_prefix(&self, bytes: &mut [u8]) -> Option<()>
","AsBytes","iroh_docs::sync::PeerIdBytes"],["","AsBytes","iroh_docs::sync::PeerIdBytes"],["","AsMut<[T]>","iroh_docs::sync::PeerIdBytes"],["","AsRef<[T]>","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> BitView for [T; N]where\n T: BitStore,
Note that overly-large arrays may cause the conversions to fail.
\n§fn view_bits<O>(&self) -> &BitSlice<T, O>where\n O: BitOrder,
Views a memory region as an immutable bit-slice.§fn try_view_bits<O>(&self) -> Result<&BitSlice<T, O>, BitSpanError<T>>where\n O: BitOrder,
Attempts to view a memory region as an immutable bit-slice. Read more§fn view_bits_mut<O>(&mut self) -> &mut BitSlice<T, O>where\n O: BitOrder,
Views a memory region as a mutable bit-slice.§fn try_view_bits_mut<O>(\n &mut self\n) -> Result<&mut BitSlice<T, O>, BitSpanError<T>>where\n O: BitOrder,
Attempts to view a memory region as a mutable bit-slice. Read more","BitView","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> BitViewSized for [T; N]where\n T: BitStore,
§fn as_raw_slice(&self) -> &[<[T; N] as BitView>::Store]
Views the type as a slice of its elements.§fn as_raw_mut_slice(&mut self) -> &mut [<[T; N] as BitView>::Store]
Views the type as a mutable slice of its elements.§fn into_bitarray<O>(self) -> BitArray<Self, O>where\n O: BitOrder,
Wraps self in a BitArray.","BitViewSized","iroh_docs::sync::PeerIdBytes"],["","Borrow<[T]>","iroh_docs::sync::PeerIdBytes"],["1.4.0 · source§impl<T, const N: usize> BorrowMut<[T]> for [T; N]
source§fn borrow_mut(&mut self) -> &mut [T]
Mutably borrows from an owned value. Read more","BorrowMut<[T]>","iroh_docs::sync::PeerIdBytes"],["","Chain","iroh_docs::sync::PeerIdBytes"],["","Clone","iroh_docs::sync::PeerIdBytes"],["","Debug","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize> Decode for [u8; N]
Decodes a byte array from byte[n] as described in RFC4251 § 5:
\n\nA byte represents an arbitrary 8-bit value (octet). Fixed length\ndata is sometimes represented as an array of bytes, written\nbyte[n], where n is the number of bytes in the array.
\n
\n","Decode","iroh_docs::sync::PeerIdBytes"],["§impl<'a, T, const N: usize> DecodeValue<'a> for [T; N]where\n T: Decode<'a>,
§fn decode_value<R>(reader: &mut R, header: Header) -> Result<[T; N], Error>where\n R: Reader<'a>,
Attempt to decode this message using the provided [Reader].","DecodeValue<'a>","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["source§impl<'de, T> Deserialize<'de> for [T; 32]where\n T: Deserialize<'de>,
source§fn deserialize<D>(\n deserializer: D\n) -> Result<[T; 32], <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more","Deserialize<'de>","iroh_docs::sync::PeerIdBytes"],["source§impl<'de, const N: usize> Deserialize<'de> for [u8; N]
source§fn deserialize<D>(\n deserializer: D\n) -> Result<[u8; N], <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
","Deserialize<'de>","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize> Encode for [u8; N]
Encodes [u8; N] into byte[n] as described in RFC4251 § 5:
\n\nA byte represents an arbitrary 8-bit value (octet). Fixed length\ndata is sometimes represented as an array of bytes, written\nbyte[n], where n is the number of bytes in the array.
\n
\n§fn encoded_len(&self) -> Result<usize, Error>
Get the length of this type encoded in bytes, prior to Base64 encoding.§fn encode(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value using the provided [Writer].§fn encoded_len_prefixed(&self) -> Result<usize, Error>
Return the length of this type after encoding when prepended with a\nuint32 length prefix.§fn encode_prefixed(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value, first prepending a uint32 length prefix\nset to [Encode::encoded_len].","Encode","iroh_docs::sync::PeerIdBytes"],["","EncodeLabelSet","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> EncodeValue for [T; N]where\n T: Encode,
","EncodeValue","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["§impl<'a> FindToken<&'a u8> for [u8; 32]
§fn find_token(&self, token: &u8) -> bool
Returns true if self contains the token","FindToken<&'a u8>","iroh_docs::sync::PeerIdBytes"],["§impl FindToken<u8> for [u8; 32]
§fn find_token(&self, token: u8) -> bool
Returns true if self contains the token","FindToken","iroh_docs::sync::PeerIdBytes"],["","FixedTag","iroh_docs::sync::PeerIdBytes"],["","From<&Signature>","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["§impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>>> for [T; 32]
","From, B0>, B0>, B0>, B0>, B0>>>","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["","From>","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["source§impl From<NamespaceId> for [u8; 32]
source§fn from(value: NamespaceId) -> Self
Converts to this type from the input type.","From","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["","From>","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> FromBytes for [T; N]where\n T: FromBytes,
§fn slice_from_prefix(bytes: &[u8], count: usize) -> Option<(&[Self], &[u8])>where\n Self: Sized,
Interprets the prefix of the given bytes as a &[Self] with length\nequal to count without copying. Read more§fn slice_from_suffix(bytes: &[u8], count: usize) -> Option<(&[u8], &[Self])>where\n Self: Sized,
Interprets the suffix of the given bytes as a &[Self] with length\nequal to count without copying. Read more§fn read_from_prefix(bytes: &[u8]) -> Option<Self>where\n Self: Sized,
","FromBytes","iroh_docs::sync::PeerIdBytes"],["","FromHex","iroh_docs::sync::PeerIdBytes"],["","FromZeroes","iroh_docs::sync::PeerIdBytes"],["","Hash","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Hash for [T; N]where\n T: Hash,
The hash of an array is the same as that of the corresponding slice,\nas required by the Borrow implementation.
\n\nuse std::hash::BuildHasher;\n\nlet b = std::hash::RandomState::new();\nlet a: [u8; 3] = [0xa8, 0x3c, 0x09];\nlet s: &[u8] = &[0xa8, 0x3c, 0x09];\nassert_eq!(b.hash_one(a), b.hash_one(s));
\n","Hash","iroh_docs::sync::PeerIdBytes"],["","Index","iroh_docs::sync::PeerIdBytes"],["","IndexMut","iroh_docs::sync::PeerIdBytes"],["","InputLength","iroh_docs::sync::PeerIdBytes"],["1.53.0 · source§impl<T, const N: usize> IntoIterator for [T; N]
source§fn into_iter(self) -> <[T; N] as IntoIterator>::IntoIter
Creates a consuming iterator, that is, one that moves each value out of\nthe array (from start to end). The array cannot be used after calling\nthis unless T implements Copy, so the whole array is copied.
\nArrays have special behavior when calling .into_iter() prior to the\n2021 edition – see the array Editions section for more information.
\n","IntoIterator","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize> IntoResponse for [u8; N]
§fn into_response(self) -> Response<Body>
Create a response.","IntoResponse","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, const N: usize> Join for [Fut; N]where\n Fut: IntoFuture,
§type Output = [<Fut as IntoFuture>::Output; N]
The resulting output type.§type Future = Join<<Fut as IntoFuture>::IntoFuture, N>
The Future implementation returned by this method.","Join","iroh_docs::sync::PeerIdBytes"],["","Key","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> MaxSize for [T; N]where\n T: MaxSize,
§const POSTCARD_MAX_SIZE: usize = _
The maximum possible size that the serialization of this\ntype can have, in bytes.","MaxSize","iroh_docs::sync::PeerIdBytes"],["","Merge","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Ord for [T; N]where\n T: Ord,
Implements comparison of arrays lexicographically.
\n1.21.0 · source§fn max(self, other: Self) -> Selfwhere\n Self: Sized,
Compares and returns the maximum of two values. Read more","Ord","iroh_docs::sync::PeerIdBytes"],["","PartialEq<&[U]>","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, U, const N: usize> PartialEq<&mut [U]> for [T; N]where\n T: PartialEq<U>,
","PartialEq<&mut [U]>","iroh_docs::sync::PeerIdBytes"],["","PartialEq<[U]>","iroh_docs::sync::PeerIdBytes"],["","PartialEq<[U; N]>","iroh_docs::sync::PeerIdBytes"],["","PartialEq","iroh_docs::sync::PeerIdBytes"],["§impl<A, B, const N: usize, const M: usize> PartialEq<Vec<A, N>> for [B; M]where\n A: PartialEq<B>,
","PartialEq>","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> PartialOrd for [T; N]where\n T: PartialOrd,
Implements comparison of arrays lexicographically.
\nsource§fn le(&self, other: &[T; N]) -> bool
This method tests less than or equal to (for self and other) and is used by the <=\noperator. Read more","PartialOrd","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, const N: usize> Race for [Fut; N]where\n Fut: IntoFuture,
§type Output = <Fut as IntoFuture>::Output
The resulting output type.§type Future = Race<<Fut as IntoFuture>::IntoFuture, N>
Which kind of future are we turning this into?","Race","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, T, E, const N: usize> RaceOk for [Fut; N]where\n Fut: IntoFuture<Output = Result<T, E>>,
§type Future = RaceOk<<Fut as IntoFuture>::IntoFuture, T, E, N>
Which kind of future are we turning this into?","RaceOk","iroh_docs::sync::PeerIdBytes"],["","Schema","iroh_docs::sync::PeerIdBytes"],["source§impl<T> Serialize for [T; 32]where\n T: 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","iroh_docs::sync::PeerIdBytes"],["source§impl<const N: usize> Serialize for [u8; N]
source§fn serialize<S>(\n &self,\n serializer: S\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where\n S: Serializer,
","Serialize","iroh_docs::sync::PeerIdBytes"],["1.51.0 · source§impl<T, const N: usize> SlicePattern for [T; N]
","SlicePattern","iroh_docs::sync::PeerIdBytes"],["1.34.0 · source§impl<T, const N: usize> TryFrom<&[T]> for [T; N]where\n T: Copy,
Tries to create an array [T; N] by copying from a slice &[T]. Succeeds if\nslice.len() == N.
\n\nlet bytes: [u8; 3] = [1, 0, 2];\n\nlet bytes_head: [u8; 2] = <[u8; 2]>::try_from(&bytes[0..2]).unwrap();\nassert_eq!(1, u16::from_le_bytes(bytes_head));\n\nlet bytes_tail: [u8; 2] = bytes[1..3].try_into().unwrap();\nassert_eq!(512, u16::from_le_bytes(bytes_tail));
\n§type Error = TryFromSliceError
The type returned in the event of a conversion error.","TryFrom<&[T]>","iroh_docs::sync::PeerIdBytes"],["1.59.0 · source§impl<T, const N: usize> TryFrom<&mut [T]> for [T; N]where\n T: Copy,
Tries to create an array [T; N] by copying from a mutable slice &mut [T].\nSucceeds if slice.len() == N.
\n\nlet mut bytes: [u8; 3] = [1, 0, 2];\n\nlet bytes_head: [u8; 2] = <[u8; 2]>::try_from(&mut bytes[0..2]).unwrap();\nassert_eq!(1, u16::from_le_bytes(bytes_head));\n\nlet bytes_tail: [u8; 2] = (&mut bytes[1..3]).try_into().unwrap();\nassert_eq!(512, u16::from_le_bytes(bytes_tail));
\n§type Error = TryFromSliceError
The type returned in the event of a conversion error.","TryFrom<&mut [T]>","iroh_docs::sync::PeerIdBytes"],["§impl<T, A, const N: usize> TryFrom<Vec<T, A>> for [T; N]where\n A: Allocator,
§fn try_from(vec: Vec<T, A>) -> Result<[T; N], Vec<T, A>>
Gets the entire contents of the Vec<T> as an array,\nif its size exactly matches that of the requested array.
\n§Examples
\nassert_eq!(vec![1, 2, 3].try_into(), Ok([1, 2, 3]));\nassert_eq!(<Vec<i32>>::new().try_into(), Ok([]));
\nIf the length doesn’t match, the input comes back in Err:
\n\nlet r: Result<[i32; 4], _> = (0..10).collect::<Vec<_>>().try_into();\nassert_eq!(r, Err(vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9]));
\nIf you’re fine with just getting a prefix of the Vec<T>,\nyou can call .truncate(N) first.
\n\nlet mut v = String::from(\"hello world\").into_bytes();\nv.sort();\nv.truncate(2);\nlet [a, b]: [_; 2] = v.try_into().unwrap();\nassert_eq!(a, b' ');\nassert_eq!(b, b'd');
\n","TryFrom>","iroh_docs::sync::PeerIdBytes"],["1.48.0 · source§impl<T, A, const N: usize> TryFrom<Vec<T, A>> for [T; N]where\n A: Allocator,
source§fn try_from(vec: Vec<T, A>) -> Result<[T; N], Vec<T, A>>
Gets the entire contents of the Vec<T> as an array,\nif its size exactly matches that of the requested array.
\n§Examples
\nassert_eq!(vec![1, 2, 3].try_into(), Ok([1, 2, 3]));\nassert_eq!(<Vec<i32>>::new().try_into(), Ok([]));
\nIf the length doesn’t match, the input comes back in Err:
\n\nlet r: Result<[i32; 4], _> = (0..10).collect::<Vec<_>>().try_into();\nassert_eq!(r, Err(vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9]));
\nIf you’re fine with just getting a prefix of the Vec<T>,\nyou can call .truncate(N) first.
\n\nlet mut v = String::from(\"hello world\").into_bytes();\nv.sort();\nv.truncate(2);\nlet [a, b]: [_; 2] = v.try_into().unwrap();\nassert_eq!(a, b' ');\nassert_eq!(b, b'd');
\n","TryFrom>","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, T, E, const N: usize> TryJoin for [Fut; N]where\n Fut: IntoFuture<Output = Result<T, E>>,
§type Future = TryJoin<<Fut as IntoFuture>::IntoFuture, T, E, N>
Which kind of future are we turning this into?","TryJoin","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> Value for [T; N]where\n T: Value,
§type SelfType<'a> = [<T as Value>::SelfType<'a>; N]\nwhere\n [T; N]: 'a
SelfType<’a> must be the same type as Self with all lifetimes replaced with ’a§type AsBytes<'a> = Vec<u8>\nwhere\n [T; N]: 'a
§fn fixed_width() -> Option<usize>
Width of a fixed type, or None for variable width§fn from_bytes<'a>(data: &'a [u8]) -> [<T as Value>::SelfType<'a>; N]where\n [T; N]: 'a,
Deserializes data\nImplementations may return a view over data, or an owned type","Value","iroh_docs::sync::PeerIdBytes"],["","ValueOrd","iroh_docs::sync::PeerIdBytes"],["§impl<Z, const N: usize> Zeroize for [Z; N]where\n Z: Zeroize,
Impl [Zeroize] on arrays of types that impl [Zeroize].
\n","Zeroize","iroh_docs::sync::PeerIdBytes"],["","Zip","iroh_docs::sync::PeerIdBytes"],["source§impl<T, const N: usize> ConstParamTy for [T; N]where\n T: ConstParamTy,
","ConstParamTy","iroh_docs::sync::PeerIdBytes"],["1.58.0 · source§impl<T, const N: usize> Copy for [T; N]where\n T: Copy,
","Copy","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Eq for [T; N]where\n T: Eq,
","Eq","iroh_docs::sync::PeerIdBytes"],["source§impl<T, const N: usize> StructuralPartialEq for [T; N]
","StructuralPartialEq","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> Unaligned for [T; N]where\n T: Unaligned,
","Unaligned","iroh_docs::sync::PeerIdBytes"],["§impl<Z, const N: usize> ZeroizeOnDrop for [Z; N]where\n Z: ZeroizeOnDrop,
Impl [ZeroizeOnDrop] on arrays of types that impl [ZeroizeOnDrop].
\n","ZeroizeOnDrop","iroh_docs::sync::PeerIdBytes"]]
+"iroh_docs":[["source§impl<T, const N: usize> [T; N]
1.55.0 · sourcepub fn map<F, U>(self, f: F) -> [U; N]where\n F: FnMut(T) -> U,
Returns an array of the same size as self, with function f applied to each element\nin order.
\nIf you don’t necessarily need a new fixed-size array, consider using\nIterator::map instead.
\n§Note on performance and stack usage
\nUnfortunately, usages of this method are currently not always optimized\nas well as they could be. This mainly concerns large arrays, as mapping\nover small arrays seem to be optimized just fine. Also note that in\ndebug mode (i.e. without any optimizations), this method can use a lot\nof stack space (a few times the size of the array or more).
\nTherefore, in performance-critical code, try to avoid using this method\non large arrays or check the emitted code. Also try to avoid chained\nmaps (e.g. arr.map(...).map(...)).
\nIn many cases, you can instead use Iterator::map by calling .iter()\nor .into_iter() on your array. [T; N]::map is only necessary if you\nreally need a new array of the same size as the result. Rust’s lazy\niterators tend to get optimized very well.
\n§Examples
\nlet x = [1, 2, 3];\nlet y = x.map(|v| v + 1);\nassert_eq!(y, [2, 3, 4]);\n\nlet x = [1, 2, 3];\nlet mut temp = 0;\nlet y = x.map(|v| { temp += 1; v * temp });\nassert_eq!(y, [1, 4, 9]);\n\nlet x = [\"Ferris\", \"Bueller's\", \"Day\", \"Off\"];\nlet y = x.map(|v| v.len());\nassert_eq!(y, [6, 9, 3, 3]);
\nsourcepub fn try_map<F, R>(\n self,\n f: F\n) -> <<R as Try>::Residual as Residual<[<R as Try>::Output; N]>>::TryType
🔬This is a nightly-only experimental API. (array_try_map)
A fallible function f applied to each element on array self in order to\nreturn an array the same size as self or the first error encountered.
\nThe return type of this function depends on the return type of the closure.\nIf you return Result<T, E> from the closure, you’ll get a Result<[T; N], E>.\nIf you return Option<T> from the closure, you’ll get an Option<[T; N]>.
\n§Examples
\n#![feature(array_try_map)]\n\nlet a = [\"1\", \"2\", \"3\"];\nlet b = a.try_map(|v| v.parse::<u32>()).unwrap().map(|v| v + 1);\nassert_eq!(b, [2, 3, 4]);\n\nlet a = [\"1\", \"2a\", \"3\"];\nlet b = a.try_map(|v| v.parse::<u32>());\nassert!(b.is_err());\n\nuse std::num::NonZero;\n\nlet z = [1, 2, 0, 3, 4];\nassert_eq!(z.try_map(NonZero::new), None);\n\nlet a = [1, 2, 3];\nlet b = a.try_map(NonZero::new);\nlet c = b.map(|x| x.map(NonZero::get));\nassert_eq!(c, Some(a));
\n1.57.0 (const: 1.57.0) · sourcepub const fn as_slice(&self) -> &[T]
Returns a slice containing the entire array. Equivalent to &s[..].
\n1.57.0 · sourcepub fn as_mut_slice(&mut self) -> &mut [T]
Returns a mutable slice containing the entire array. Equivalent to\n&mut s[..].
\n1.77.0 · sourcepub fn each_ref(&self) -> [&T; N]
Borrows each element and returns an array of references with the same\nsize as self.
\n§Example
\nlet floats = [3.1, 2.7, -1.0];\nlet float_refs: [&f64; 3] = floats.each_ref();\nassert_eq!(float_refs, [&3.1, &2.7, &-1.0]);
\nThis method is particularly useful if combined with other methods, like\nmap. This way, you can avoid moving the original\narray if its elements are not Copy.
\n\nlet strings = [\"Ferris\".to_string(), \"♥\".to_string(), \"Rust\".to_string()];\nlet is_ascii = strings.each_ref().map(|s| s.is_ascii());\nassert_eq!(is_ascii, [true, false, true]);\n\n// We can still access the original array: it has not been moved.\nassert_eq!(strings.len(), 3);
\n1.77.0 · sourcepub fn each_mut(&mut self) -> [&mut T; N]
Borrows each element mutably and returns an array of mutable references\nwith the same size as self.
\n§Example
\n\nlet mut floats = [3.1, 2.7, -1.0];\nlet float_refs: [&mut f64; 3] = floats.each_mut();\n*float_refs[0] = 0.0;\nassert_eq!(float_refs, [&mut 0.0, &mut 2.7, &mut -1.0]);\nassert_eq!(floats, [0.0, 2.7, -1.0]);
\nsourcepub fn split_array_ref<const M: usize>(&self) -> (&[T; M], &[T])
🔬This is a nightly-only experimental API. (split_array)
Divides one array reference into two at an index.
\nThe first will contain all indices from [0, M) (excluding\nthe index M itself) and the second will contain all\nindices from [M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet v = [1, 2, 3, 4, 5, 6];\n\n{\n let (left, right) = v.split_array_ref::<0>();\n assert_eq!(left, &[]);\n assert_eq!(right, &[1, 2, 3, 4, 5, 6]);\n}\n\n{\n let (left, right) = v.split_array_ref::<2>();\n assert_eq!(left, &[1, 2]);\n assert_eq!(right, &[3, 4, 5, 6]);\n}\n\n{\n let (left, right) = v.split_array_ref::<6>();\n assert_eq!(left, &[1, 2, 3, 4, 5, 6]);\n assert_eq!(right, &[]);\n}
\nsourcepub fn split_array_mut<const M: usize>(&mut self) -> (&mut [T; M], &mut [T])
🔬This is a nightly-only experimental API. (split_array)
Divides one mutable array reference into two at an index.
\nThe first will contain all indices from [0, M) (excluding\nthe index M itself) and the second will contain all\nindices from [M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet mut v = [1, 0, 3, 0, 5, 6];\nlet (left, right) = v.split_array_mut::<2>();\nassert_eq!(left, &mut [1, 0][..]);\nassert_eq!(right, &mut [3, 0, 5, 6]);\nleft[1] = 2;\nright[1] = 4;\nassert_eq!(v, [1, 2, 3, 4, 5, 6]);
\nsourcepub fn rsplit_array_ref<const M: usize>(&self) -> (&[T], &[T; M])
🔬This is a nightly-only experimental API. (split_array)
Divides one array reference into two at an index from the end.
\nThe first will contain all indices from [0, N - M) (excluding\nthe index N - M itself) and the second will contain all\nindices from [N - M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet v = [1, 2, 3, 4, 5, 6];\n\n{\n let (left, right) = v.rsplit_array_ref::<0>();\n assert_eq!(left, &[1, 2, 3, 4, 5, 6]);\n assert_eq!(right, &[]);\n}\n\n{\n let (left, right) = v.rsplit_array_ref::<2>();\n assert_eq!(left, &[1, 2, 3, 4]);\n assert_eq!(right, &[5, 6]);\n}\n\n{\n let (left, right) = v.rsplit_array_ref::<6>();\n assert_eq!(left, &[]);\n assert_eq!(right, &[1, 2, 3, 4, 5, 6]);\n}
\nsourcepub fn rsplit_array_mut<const M: usize>(&mut self) -> (&mut [T], &mut [T; M])
🔬This is a nightly-only experimental API. (split_array)
Divides one mutable array reference into two at an index from the end.
\nThe first will contain all indices from [0, N - M) (excluding\nthe index N - M itself) and the second will contain all\nindices from [N - M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet mut v = [1, 0, 3, 0, 5, 6];\nlet (left, right) = v.rsplit_array_mut::<4>();\nassert_eq!(left, &mut [1, 0]);\nassert_eq!(right, &mut [3, 0, 5, 6][..]);\nleft[1] = 2;\nright[1] = 4;\nassert_eq!(v, [1, 2, 3, 4, 5, 6]);
\n",0,"iroh_docs::sync::PeerIdBytes"],["source§impl<const N: usize> [u8; N]
sourcepub const fn as_ascii(&self) -> Option<&[AsciiChar; N]>
🔬This is a nightly-only experimental API. (ascii_char)
Converts this array of bytes into a array of ASCII characters,\nor returns None if any of the characters is non-ASCII.
\n§Examples
\n#![feature(ascii_char)]\n#![feature(const_option)]\n\nconst HEX_DIGITS: [std::ascii::Char; 16] =\n *b\"0123456789abcdef\".as_ascii().unwrap();\n\nassert_eq!(HEX_DIGITS[1].as_str(), \"1\");\nassert_eq!(HEX_DIGITS[10].as_str(), \"a\");
\nsourcepub const unsafe fn as_ascii_unchecked(&self) -> &[AsciiChar; N]
🔬This is a nightly-only experimental API. (ascii_char)
Converts this array of bytes into a array of ASCII characters,\nwithout checking whether they’re valid.
\n§Safety
\nEvery byte in the array must be in 0..=127, or else this is UB.
\n",0,"iroh_docs::sync::PeerIdBytes"],["§impl<T> Array for [T; 32]where\n T: Default,
§fn as_slice_mut(&mut self) -> &mut [T]
Gives a unique slice over the whole thing. Read more","Array","iroh_docs::sync::PeerIdBytes"],["","Array","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> AsBytes for [T; N]where\n T: AsBytes,
§fn write_to_prefix(&self, bytes: &mut [u8]) -> Option<()>
","AsBytes","iroh_docs::sync::PeerIdBytes"],["","AsBytes","iroh_docs::sync::PeerIdBytes"],["","AsMut<[T]>","iroh_docs::sync::PeerIdBytes"],["","AsRef<[T]>","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> BitView for [T; N]where\n T: BitStore,
Note that overly-large arrays may cause the conversions to fail.
\n§fn view_bits<O>(&self) -> &BitSlice<T, O>where\n O: BitOrder,
Views a memory region as an immutable bit-slice.§fn try_view_bits<O>(&self) -> Result<&BitSlice<T, O>, BitSpanError<T>>where\n O: BitOrder,
Attempts to view a memory region as an immutable bit-slice. Read more§fn view_bits_mut<O>(&mut self) -> &mut BitSlice<T, O>where\n O: BitOrder,
Views a memory region as a mutable bit-slice.§fn try_view_bits_mut<O>(\n &mut self\n) -> Result<&mut BitSlice<T, O>, BitSpanError<T>>where\n O: BitOrder,
Attempts to view a memory region as a mutable bit-slice. Read more","BitView","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> BitViewSized for [T; N]where\n T: BitStore,
§fn as_raw_slice(&self) -> &[<[T; N] as BitView>::Store]
Views the type as a slice of its elements.§fn as_raw_mut_slice(&mut self) -> &mut [<[T; N] as BitView>::Store]
Views the type as a mutable slice of its elements.§fn into_bitarray<O>(self) -> BitArray<Self, O>where\n O: BitOrder,
Wraps self in a BitArray.","BitViewSized","iroh_docs::sync::PeerIdBytes"],["","Borrow<[T]>","iroh_docs::sync::PeerIdBytes"],["1.4.0 · source§impl<T, const N: usize> BorrowMut<[T]> for [T; N]
source§fn borrow_mut(&mut self) -> &mut [T]
Mutably borrows from an owned value. Read more","BorrowMut<[T]>","iroh_docs::sync::PeerIdBytes"],["","Chain","iroh_docs::sync::PeerIdBytes"],["","Clone","iroh_docs::sync::PeerIdBytes"],["","Debug","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize> Decode for [u8; N]
Decodes a byte array from byte[n] as described in RFC4251 § 5:
\n\nA byte represents an arbitrary 8-bit value (octet). Fixed length\ndata is sometimes represented as an array of bytes, written\nbyte[n], where n is the number of bytes in the array.
\n
\n","Decode","iroh_docs::sync::PeerIdBytes"],["§impl<'a, T, const N: usize> DecodeValue<'a> for [T; N]where\n T: Decode<'a>,
§fn decode_value<R>(reader: &mut R, header: Header) -> Result<[T; N], Error>where\n R: Reader<'a>,
Attempt to decode this message using the provided [Reader].","DecodeValue<'a>","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["source§impl<'de, T> Deserialize<'de> for [T; 32]where\n T: Deserialize<'de>,
source§fn deserialize<D>(\n deserializer: D\n) -> Result<[T; 32], <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more","Deserialize<'de>","iroh_docs::sync::PeerIdBytes"],["source§impl<'de, const N: usize> Deserialize<'de> for [u8; N]
source§fn deserialize<D>(\n deserializer: D\n) -> Result<[u8; N], <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
","Deserialize<'de>","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize> Encode for [u8; N]
Encodes [u8; N] into byte[n] as described in RFC4251 § 5:
\n\nA byte represents an arbitrary 8-bit value (octet). Fixed length\ndata is sometimes represented as an array of bytes, written\nbyte[n], where n is the number of bytes in the array.
\n
\n§fn encoded_len(&self) -> Result<usize, Error>
Get the length of this type encoded in bytes, prior to Base64 encoding.§fn encode(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value using the provided [Writer].§fn encoded_len_prefixed(&self) -> Result<usize, Error>
Return the length of this type after encoding when prepended with a\nuint32 length prefix.§fn encode_prefixed(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value, first prepending a uint32 length prefix\nset to [Encode::encoded_len].","Encode","iroh_docs::sync::PeerIdBytes"],["","EncodeLabelSet","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> EncodeValue for [T; N]where\n T: Encode,
","EncodeValue","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["§impl<'a> FindToken<&'a u8> for [u8; 32]
§fn find_token(&self, token: &u8) -> bool
Returns true if self contains the token","FindToken<&'a u8>","iroh_docs::sync::PeerIdBytes"],["§impl FindToken<u8> for [u8; 32]
§fn find_token(&self, token: u8) -> bool
Returns true if self contains the token","FindToken","iroh_docs::sync::PeerIdBytes"],["","FixedTag","iroh_docs::sync::PeerIdBytes"],["","From<&Signature>","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["§impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>>> for [T; 32]
","From, B0>, B0>, B0>, B0>, B0>>>","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["","From>","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["source§impl From<NamespaceId> for [u8; 32]
source§fn from(value: NamespaceId) -> Self
Converts to this type from the input type.","From","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["","From>","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> FromBytes for [T; N]where\n T: FromBytes,
§fn slice_from_prefix(bytes: &[u8], count: usize) -> Option<(&[Self], &[u8])>where\n Self: Sized,
Interprets the prefix of the given bytes as a &[Self] with length\nequal to count without copying. Read more§fn slice_from_suffix(bytes: &[u8], count: usize) -> Option<(&[u8], &[Self])>where\n Self: Sized,
Interprets the suffix of the given bytes as a &[Self] with length\nequal to count without copying. Read more§fn read_from_prefix(bytes: &[u8]) -> Option<Self>where\n Self: Sized,
","FromBytes","iroh_docs::sync::PeerIdBytes"],["","FromHex","iroh_docs::sync::PeerIdBytes"],["","FromZeroes","iroh_docs::sync::PeerIdBytes"],["","Hash","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Hash for [T; N]where\n T: Hash,
The hash of an array is the same as that of the corresponding slice,\nas required by the Borrow implementation.
\n\nuse std::hash::BuildHasher;\n\nlet b = std::hash::RandomState::new();\nlet a: [u8; 3] = [0xa8, 0x3c, 0x09];\nlet s: &[u8] = &[0xa8, 0x3c, 0x09];\nassert_eq!(b.hash_one(a), b.hash_one(s));
\n","Hash","iroh_docs::sync::PeerIdBytes"],["","Index","iroh_docs::sync::PeerIdBytes"],["","IndexMut","iroh_docs::sync::PeerIdBytes"],["","InputLength","iroh_docs::sync::PeerIdBytes"],["1.53.0 · source§impl<T, const N: usize> IntoIterator for [T; N]
source§fn into_iter(self) -> <[T; N] as IntoIterator>::IntoIter
Creates a consuming iterator, that is, one that moves each value out of\nthe array (from start to end). The array cannot be used after calling\nthis unless T implements Copy, so the whole array is copied.
\nArrays have special behavior when calling .into_iter() prior to the\n2021 edition – see the array Editions section for more information.
\n","IntoIterator","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize> IntoResponse for [u8; N]
§fn into_response(self) -> Response<Body>
Create a response.","IntoResponse","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, const N: usize> Join for [Fut; N]where\n Fut: IntoFuture,
§type Output = [<Fut as IntoFuture>::Output; N]
The resulting output type.§type Future = Join<<Fut as IntoFuture>::IntoFuture, N>
The Future implementation returned by this method.","Join","iroh_docs::sync::PeerIdBytes"],["","Key","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> MaxSize for [T; N]where\n T: MaxSize,
§const POSTCARD_MAX_SIZE: usize = _
The maximum possible size that the serialization of this\ntype can have, in bytes.","MaxSize","iroh_docs::sync::PeerIdBytes"],["","Merge","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Ord for [T; N]where\n T: Ord,
Implements comparison of arrays lexicographically.
\n1.21.0 · source§fn max(self, other: Self) -> Selfwhere\n Self: Sized,
Compares and returns the maximum of two values. Read more","Ord","iroh_docs::sync::PeerIdBytes"],["","PartialEq<&[U]>","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, U, const N: usize> PartialEq<&mut [U]> for [T; N]where\n T: PartialEq<U>,
","PartialEq<&mut [U]>","iroh_docs::sync::PeerIdBytes"],["","PartialEq<[U]>","iroh_docs::sync::PeerIdBytes"],["","PartialEq<[U; N]>","iroh_docs::sync::PeerIdBytes"],["","PartialEq","iroh_docs::sync::PeerIdBytes"],["§impl<A, B, const N: usize, const M: usize> PartialEq<Vec<A, N>> for [B; M]where\n A: PartialEq<B>,
","PartialEq>","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> PartialOrd for [T; N]where\n T: PartialOrd,
Implements comparison of arrays lexicographically.
\nsource§fn le(&self, other: &[T; N]) -> bool
This method tests less than or equal to (for self and other) and is used by the <=\noperator. Read more","PartialOrd","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, const N: usize> Race for [Fut; N]where\n Fut: IntoFuture,
§type Output = <Fut as IntoFuture>::Output
The resulting output type.§type Future = Race<<Fut as IntoFuture>::IntoFuture, N>
Which kind of future are we turning this into?","Race","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, T, E, const N: usize> RaceOk for [Fut; N]where\n Fut: IntoFuture<Output = Result<T, E>>,
§type Future = RaceOk<<Fut as IntoFuture>::IntoFuture, T, E, N>
Which kind of future are we turning this into?","RaceOk","iroh_docs::sync::PeerIdBytes"],["","Schema","iroh_docs::sync::PeerIdBytes"],["source§impl<T> Serialize for [T; 32]where\n T: 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","iroh_docs::sync::PeerIdBytes"],["source§impl<const N: usize> Serialize for [u8; N]
source§fn serialize<S>(\n &self,\n serializer: S\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where\n S: Serializer,
","Serialize","iroh_docs::sync::PeerIdBytes"],["1.51.0 · source§impl<T, const N: usize> SlicePattern for [T; N]
","SlicePattern","iroh_docs::sync::PeerIdBytes"],["1.34.0 · source§impl<T, const N: usize> TryFrom<&[T]> for [T; N]where\n T: Copy,
Tries to create an array [T; N] by copying from a slice &[T]. Succeeds if\nslice.len() == N.
\n\nlet bytes: [u8; 3] = [1, 0, 2];\n\nlet bytes_head: [u8; 2] = <[u8; 2]>::try_from(&bytes[0..2]).unwrap();\nassert_eq!(1, u16::from_le_bytes(bytes_head));\n\nlet bytes_tail: [u8; 2] = bytes[1..3].try_into().unwrap();\nassert_eq!(512, u16::from_le_bytes(bytes_tail));
\n§type Error = TryFromSliceError
The type returned in the event of a conversion error.","TryFrom<&[T]>","iroh_docs::sync::PeerIdBytes"],["1.59.0 · source§impl<T, const N: usize> TryFrom<&mut [T]> for [T; N]where\n T: Copy,
Tries to create an array [T; N] by copying from a mutable slice &mut [T].\nSucceeds if slice.len() == N.
\n\nlet mut bytes: [u8; 3] = [1, 0, 2];\n\nlet bytes_head: [u8; 2] = <[u8; 2]>::try_from(&mut bytes[0..2]).unwrap();\nassert_eq!(1, u16::from_le_bytes(bytes_head));\n\nlet bytes_tail: [u8; 2] = (&mut bytes[1..3]).try_into().unwrap();\nassert_eq!(512, u16::from_le_bytes(bytes_tail));
\n§type Error = TryFromSliceError
The type returned in the event of a conversion error.","TryFrom<&mut [T]>","iroh_docs::sync::PeerIdBytes"],["§impl<T, A, const N: usize> TryFrom<Vec<T, A>> for [T; N]where\n A: Allocator,
§fn try_from(vec: Vec<T, A>) -> Result<[T; N], Vec<T, A>>
Gets the entire contents of the Vec<T> as an array,\nif its size exactly matches that of the requested array.
\n§Examples
\nassert_eq!(vec![1, 2, 3].try_into(), Ok([1, 2, 3]));\nassert_eq!(<Vec<i32>>::new().try_into(), Ok([]));
\nIf the length doesn’t match, the input comes back in Err:
\n\nlet r: Result<[i32; 4], _> = (0..10).collect::<Vec<_>>().try_into();\nassert_eq!(r, Err(vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9]));
\nIf you’re fine with just getting a prefix of the Vec<T>,\nyou can call .truncate(N) first.
\n\nlet mut v = String::from(\"hello world\").into_bytes();\nv.sort();\nv.truncate(2);\nlet [a, b]: [_; 2] = v.try_into().unwrap();\nassert_eq!(a, b' ');\nassert_eq!(b, b'd');
\n","TryFrom>","iroh_docs::sync::PeerIdBytes"],["1.48.0 · source§impl<T, A, const N: usize> TryFrom<Vec<T, A>> for [T; N]where\n A: Allocator,
source§fn try_from(vec: Vec<T, A>) -> Result<[T; N], Vec<T, A>>
Gets the entire contents of the Vec<T> as an array,\nif its size exactly matches that of the requested array.
\n§Examples
\nassert_eq!(vec![1, 2, 3].try_into(), Ok([1, 2, 3]));\nassert_eq!(<Vec<i32>>::new().try_into(), Ok([]));
\nIf the length doesn’t match, the input comes back in Err:
\n\nlet r: Result<[i32; 4], _> = (0..10).collect::<Vec<_>>().try_into();\nassert_eq!(r, Err(vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9]));
\nIf you’re fine with just getting a prefix of the Vec<T>,\nyou can call .truncate(N) first.
\n\nlet mut v = String::from(\"hello world\").into_bytes();\nv.sort();\nv.truncate(2);\nlet [a, b]: [_; 2] = v.try_into().unwrap();\nassert_eq!(a, b' ');\nassert_eq!(b, b'd');
\n","TryFrom>","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, T, E, const N: usize> TryJoin for [Fut; N]where\n Fut: IntoFuture<Output = Result<T, E>>,
§type Future = TryJoin<<Fut as IntoFuture>::IntoFuture, T, E, N>
Which kind of future are we turning this into?","TryJoin","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> Value for [T; N]where\n T: Value,
§type SelfType<'a> = [<T as Value>::SelfType<'a>; N]\nwhere\n [T; N]: 'a
SelfType<’a> must be the same type as Self with all lifetimes replaced with ’a§type AsBytes<'a> = Vec<u8>\nwhere\n [T; N]: 'a
§fn fixed_width() -> Option<usize>
Width of a fixed type, or None for variable width§fn from_bytes<'a>(data: &'a [u8]) -> [<T as Value>::SelfType<'a>; N]where\n [T; N]: 'a,
Deserializes data\nImplementations may return a view over data, or an owned type","Value","iroh_docs::sync::PeerIdBytes"],["","ValueOrd","iroh_docs::sync::PeerIdBytes"],["§impl<Z, const N: usize> Zeroize for [Z; N]where\n Z: Zeroize,
Impl [Zeroize] on arrays of types that impl [Zeroize].
\n","Zeroize","iroh_docs::sync::PeerIdBytes"],["","Zip","iroh_docs::sync::PeerIdBytes"],["source§impl<T, const N: usize> ConstParamTy for [T; N]where\n T: ConstParamTy,
","ConstParamTy","iroh_docs::sync::PeerIdBytes"],["1.58.0 · source§impl<T, const N: usize> Copy for [T; N]where\n T: Copy,
","Copy","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Eq for [T; N]where\n T: Eq,
","Eq","iroh_docs::sync::PeerIdBytes"],["source§impl<T, const N: usize> StructuralPartialEq for [T; N]
","StructuralPartialEq","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> Unaligned for [T; N]where\n T: Unaligned,
","Unaligned","iroh_docs::sync::PeerIdBytes"],["§impl<Z, const N: usize> ZeroizeOnDrop for [Z; N]where\n Z: ZeroizeOnDrop,
Impl [ZeroizeOnDrop] on arrays of types that impl [ZeroizeOnDrop].
\n","ZeroizeOnDrop","iroh_docs::sync::PeerIdBytes"]]
};if (window.register_type_impls) {window.register_type_impls(type_impls);} else {window.pending_type_impls = type_impls;}})()
\ No newline at end of file
pub struct Record { /* private fields */ }Expand description
The data part of an entry in a Replica.
Implementations§
source§impl Record
impl Record
Implementations§
source§impl Record
impl Record
sourcepub fn empty_current() -> Self
pub fn empty_current() -> Self
Create a tombstone record with the timestamp set to now.
sourcepub fn new_current(hash: Hash, len: u64) -> Self
pub fn new_current(hash: Hash, len: u64) -> Self
Create a new Record with the timestamp set to now.
sourcepub fn new_current(hash: Hash, len: u64) -> Self
pub fn new_current(hash: Hash, len: u64) -> Self
Create a new Record with the timestamp set to now.
sourcepub fn content_len(&self) -> u64
pub fn content_len(&self) -> u64
Get the length of the data addressed by this record’s content hash.
-sourcepub fn content_hash(&self) -> Hash
pub fn content_hash(&self) -> Hash
Get the [struct@Hash] of the content data of this record.
sourcepub fn content_hash(&self) -> Hash
pub fn content_hash(&self) -> Hash
Get the Hash of the content data of this record.
Trait Implementations§
source§impl<'de> Deserialize<'de> for Record
impl<'de> Deserialize<'de> for Record
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
source§impl Ord for Record
impl Ord for Record
Ordering for entry values.
diff --git a/pr/2595/docs/iroh_docs/sync/struct.Replica.html b/pr/2595/docs/iroh_docs/sync/struct.Replica.html index 23a9798651..c4e161f3c3 100644 --- a/pr/2595/docs/iroh_docs/sync/struct.Replica.html +++ b/pr/2595/docs/iroh_docs/sync/struct.Replica.html @@ -5,7 +5,7 @@ &mut self, key: impl AsRef<[u8]>, author: &Author, - hash: Hash, + hash: Hash, len: u64 ) -> Result<usize, InsertError>Insert a new record at the given key.
The entry will by signed by the provided author.
@@ -35,7 +35,7 @@ or an error if the entry failed to validate or if a store operation failed.
Hashes the given data and inserts it.
+) -> Result<Hash, InsertError>Hashes the given data and inserts it.
This does not store the content, just the record of it. Returns the calculated hash.
sourcepub fn record_id(
diff --git a/pr/2595/docs/iroh_docs/sync/struct.SignedEntry.html b/pr/2595/docs/iroh_docs/sync/struct.SignedEntry.html
index 21644eacb1..9ef5e98134 100644
--- a/pr/2595/docs/iroh_docs/sync/struct.SignedEntry.html
+++ b/pr/2595/docs/iroh_docs/sync/struct.SignedEntry.html
@@ -14,7 +14,7 @@
pub fn record_id( diff --git a/pr/2595/docs/iroh_docs/sync/struct.SignedEntry.html b/pr/2595/docs/iroh_docs/sync/struct.SignedEntry.html index 21644eacb1..9ef5e98134 100644 --- a/pr/2595/docs/iroh_docs/sync/struct.SignedEntry.html +++ b/pr/2595/docs/iroh_docs/sync/struct.SignedEntry.html @@ -14,7 +14,7 @@
sourcepub fn signature(&self) -> &EntrySignature
pub fn signature(&self) -> &EntrySignature
Get the signature.
sourcepub fn validate_empty(&self) -> Result<(), ValidationFailure>
pub fn validate_empty(&self) -> Result<(), ValidationFailure>
Validate that the entry has the empty hash if the length is 0, or a non-zero length.
sourcepub fn content_hash(&self) -> Hash
pub fn content_hash(&self) -> Hash
Get the content [struct@Hash] of the entry.
sourcepub fn content_hash(&self) -> Hash
pub fn content_hash(&self) -> Hash
Get the content Hash of the entry.
sourcepub fn content_len(&self) -> u64
pub fn content_len(&self) -> u64
Get the content length of the entry.
Get the author bytes of this entry.
Methods from Deref<Target = Record>§
sourcepub fn content_len(&self) -> u64
pub fn content_len(&self) -> u64
Get the length of the data addressed by this record’s content hash.
-sourcepub fn content_hash(&self) -> Hash
pub fn content_hash(&self) -> Hash
Get the [struct@Hash] of the content data of this record.
sourcepub fn content_hash(&self) -> Hash
pub fn content_hash(&self) -> Hash
Get the Hash of the content data of this record.
Trait Implementations§
source§impl Clone for SignedEntry
impl Clone for SignedEntry
source§fn clone(&self) -> SignedEntry
fn clone(&self) -> SignedEntry
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Debug for SignedEntry
impl Debug for SignedEntry
source§impl Deref for SignedEntry
impl Deref for SignedEntry
source§impl<'de> Deserialize<'de> for SignedEntry
impl<'de> Deserialize<'de> for SignedEntry
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
source§impl From<SignedEntry> for Entry
impl From<SignedEntry> for Entry
source§fn from(value: SignedEntry) -> Self
fn from(value: SignedEntry) -> Self
source§impl Ord for SignedEntry
impl Ord for SignedEntry
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
diff --git a/pr/2595/docs/iroh_docs/sync/type.ContentStatusCallback.html b/pr/2595/docs/iroh_docs/sync/type.ContentStatusCallback.html
index 46d5a5a49c..84ffdbe8ee 100644
--- a/pr/2595/docs/iroh_docs/sync/type.ContentStatusCallback.html
+++ b/pr/2595/docs/iroh_docs/sync/type.ContentStatusCallback.html
@@ -1,2 +1,2 @@
-ContentStatusCallback in iroh_docs::sync - Rust Type Alias iroh_docs::sync::ContentStatusCallback
source · pub type ContentStatusCallback = Arc<dyn Fn(Hash) -> ContentStatus + Send + Sync + 'static>;
Expand description
Callback that may be set on a replica to determine the availability status for a content hash.
+ContentStatusCallback in iroh_docs::sync - Rust Type Alias iroh_docs::sync::ContentStatusCallback
source · pub type ContentStatusCallback = Arc<dyn Fn(Hash) -> ContentStatus + Send + Sync + 'static>;
Expand description
Callback that may be set on a replica to determine the availability status for a content hash.
Aliased Type§
struct ContentStatusCallback { /* private fields */ }
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_net/discovery/dns/index.html b/pr/2595/docs/iroh_net/discovery/dns/index.html
index 5a80538422..a752b49d78 100644
--- a/pr/2595/docs/iroh_net/discovery/dns/index.html
+++ b/pr/2595/docs/iroh_net/discovery/dns/index.html
@@ -1,2 +1,2 @@
-iroh_net::discovery::dns - Rust Expand description
DNS node discovery for iroh-net
+iroh_net::discovery::dns - Rust Expand description
DNS node discovery for iroh-net
Structs§
- DNS node discovery
Constants§
- The n0 testing DNS node origin, for production.
- The n0 testing DNS node origin, for testing.
- Testing DNS node origin, must run server from
crate::test_utils::DnsPkarrServer.
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_net/discovery/dns/struct.DnsDiscovery.html b/pr/2595/docs/iroh_net/discovery/dns/struct.DnsDiscovery.html
index 3e7d5d71cc..7628fb45a9 100644
--- a/pr/2595/docs/iroh_net/discovery/dns/struct.DnsDiscovery.html
+++ b/pr/2595/docs/iroh_net/discovery/dns/struct.DnsDiscovery.html
@@ -28,7 +28,7 @@ custom discovery mechanism.
For testing it is also possible to use the N0_DNS_NODE_ORIGIN_STAGING domain
with DnsDiscovery::new. This would then use a hosted discovery service again,
but for testing purposes.
-Trait Implementations§
Trait Implementations§
source§impl Debug for DnsDiscovery
source§impl Discovery for DnsDiscovery
source§fn resolve(
&self,
ep: Endpoint,
node_id: NodeId
diff --git a/pr/2595/docs/iroh_net/discovery/trait.Discovery.html b/pr/2595/docs/iroh_net/discovery/trait.Discovery.html
index a53a618708..d3832a56b5 100644
--- a/pr/2595/docs/iroh_net/discovery/trait.Discovery.html
+++ b/pr/2595/docs/iroh_net/discovery/trait.Discovery.html
@@ -29,4 +29,4 @@ These tasks will be run on the runtime of the Option<BoxStream<Result<DiscoveryItem>>>
Implementors§
source§impl Discovery for DnsDiscovery
source§impl Discovery for LocalSwarmDiscovery
source§impl Discovery for PkarrPublisher
source§impl Discovery for PkarrResolver
source§impl Discovery for ConcurrentDiscovery
\ No newline at end of file
+
fn max(self, other: Self) -> Selfwhere
diff --git a/pr/2595/docs/iroh_docs/sync/type.ContentStatusCallback.html b/pr/2595/docs/iroh_docs/sync/type.ContentStatusCallback.html
index 46d5a5a49c..84ffdbe8ee 100644
--- a/pr/2595/docs/iroh_docs/sync/type.ContentStatusCallback.html
+++ b/pr/2595/docs/iroh_docs/sync/type.ContentStatusCallback.html
@@ -1,2 +1,2 @@
-ContentStatusCallback in iroh_docs::sync - Rust Type Alias iroh_docs::sync::ContentStatusCallback
source · pub type ContentStatusCallback = Arc<dyn Fn(Hash) -> ContentStatus + Send + Sync + 'static>;
Expand description
Callback that may be set on a replica to determine the availability status for a content hash.
+ContentStatusCallback in iroh_docs::sync - Rust Type Alias iroh_docs::sync::ContentStatusCallback
source · pub type ContentStatusCallback = Arc<dyn Fn(Hash) -> ContentStatus + Send + Sync + 'static>;
Expand description
Callback that may be set on a replica to determine the availability status for a content hash.
Aliased Type§
struct ContentStatusCallback { /* private fields */ }
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_net/discovery/dns/index.html b/pr/2595/docs/iroh_net/discovery/dns/index.html
index 5a80538422..a752b49d78 100644
--- a/pr/2595/docs/iroh_net/discovery/dns/index.html
+++ b/pr/2595/docs/iroh_net/discovery/dns/index.html
@@ -1,2 +1,2 @@
-iroh_net::discovery::dns - Rust Expand description
DNS node discovery for iroh-net
+iroh_net::discovery::dns - Rust Expand description
DNS node discovery for iroh-net
Structs§
- DNS node discovery
Constants§
- The n0 testing DNS node origin, for production.
- The n0 testing DNS node origin, for testing.
- Testing DNS node origin, must run server from
crate::test_utils::DnsPkarrServer.
\ No newline at end of file
diff --git a/pr/2595/docs/iroh_net/discovery/dns/struct.DnsDiscovery.html b/pr/2595/docs/iroh_net/discovery/dns/struct.DnsDiscovery.html
index 3e7d5d71cc..7628fb45a9 100644
--- a/pr/2595/docs/iroh_net/discovery/dns/struct.DnsDiscovery.html
+++ b/pr/2595/docs/iroh_net/discovery/dns/struct.DnsDiscovery.html
@@ -28,7 +28,7 @@ custom discovery mechanism.
For testing it is also possible to use the N0_DNS_NODE_ORIGIN_STAGING domain
with DnsDiscovery::new. This would then use a hosted discovery service again,
but for testing purposes.
-Trait Implementations§
Trait Implementations§
source§impl Debug for DnsDiscovery
source§impl Discovery for DnsDiscovery
source§fn resolve(
&self,
ep: Endpoint,
node_id: NodeId
diff --git a/pr/2595/docs/iroh_net/discovery/trait.Discovery.html b/pr/2595/docs/iroh_net/discovery/trait.Discovery.html
index a53a618708..d3832a56b5 100644
--- a/pr/2595/docs/iroh_net/discovery/trait.Discovery.html
+++ b/pr/2595/docs/iroh_net/discovery/trait.Discovery.html
@@ -29,4 +29,4 @@ These tasks will be run on the runtime of the Option<BoxStream<Result<DiscoveryItem>>>
Implementors§
source§impl Discovery for DnsDiscovery
source§impl Discovery for LocalSwarmDiscovery
source§impl Discovery for PkarrPublisher
source§impl Discovery for PkarrResolver
source§impl Discovery for ConcurrentDiscovery
\ No newline at end of file
+
Type Alias iroh_docs::sync::ContentStatusCallback
source · pub type ContentStatusCallback = Arc<dyn Fn(Hash) -> ContentStatus + Send + Sync + 'static>;Expand description
Callback that may be set on a replica to determine the availability status for a content hash.
+Type Alias iroh_docs::sync::ContentStatusCallback
source · pub type ContentStatusCallback = Arc<dyn Fn(Hash) -> ContentStatus + Send + Sync + 'static>;Expand description
Callback that may be set on a replica to determine the availability status for a content hash.
Aliased Type§
struct ContentStatusCallback { /* private fields */ }Expand description
DNS node discovery for iroh-net
+Expand description
DNS node discovery for iroh-net
Structs§
- DNS node discovery
Constants§
- The n0 testing DNS node origin, for production.
- The n0 testing DNS node origin, for testing.
- Testing DNS node origin, must run server from
crate::test_utils::DnsPkarrServer.
For testing it is also possible to use the N0_DNS_NODE_ORIGIN_STAGING domain
with DnsDiscovery::new. This would then use a hosted discovery service again,
but for testing purposes.
Trait Implementations§
Trait Implementations§
source§impl Debug for DnsDiscovery
impl Debug for DnsDiscovery
source§impl Discovery for DnsDiscovery
impl Discovery for DnsDiscovery
source§fn resolve(
&self,
ep: Endpoint,
node_id: NodeId
diff --git a/pr/2595/docs/iroh_net/discovery/trait.Discovery.html b/pr/2595/docs/iroh_net/discovery/trait.Discovery.html
index a53a618708..d3832a56b5 100644
--- a/pr/2595/docs/iroh_net/discovery/trait.Discovery.html
+++ b/pr/2595/docs/iroh_net/discovery/trait.Discovery.html
@@ -29,4 +29,4 @@ These tasks will be run on the runtime of the Option<BoxStream<Result<DiscoveryItem>>>
fn resolve( &self, ep: Endpoint, node_id: NodeId diff --git a/pr/2595/docs/iroh_net/discovery/trait.Discovery.html b/pr/2595/docs/iroh_net/discovery/trait.Discovery.html index a53a618708..d3832a56b5 100644 --- a/pr/2595/docs/iroh_net/discovery/trait.Discovery.html +++ b/pr/2595/docs/iroh_net/discovery/trait.Discovery.html @@ -29,4 +29,4 @@ These tasks will be run on the runtime of the Option<BoxStream<Result<DiscoveryItem>>>
Implementors§
impl Discovery for DnsDiscovery
impl Discovery for LocalSwarmDiscovery
impl Discovery for PkarrPublisher
impl Discovery for PkarrResolver
impl Discovery for ConcurrentDiscovery
Implementors§
impl Discovery for DnsDiscovery
impl Discovery for LocalSwarmDiscovery
impl Discovery for PkarrPublisher
impl Discovery for PkarrResolver
impl Discovery for ConcurrentDiscovery
//! DNS node discovery for iroh-net
use anyhow::Result;
@@ -182,6 +186,10 @@
fn resolve(&self, ep: Endpoint, node_id: NodeId) -> Option<BoxStream<Result<DiscoveryItem>>> {
let resolver = ep.dns_resolver().clone();
let origin_domain = self.origin_domain.clone();
+ #[cfg(any(test, feature = "test-utils"))]
+ if origin_domain.contains(&TEST_DNS_NODE_ORIGIN.to_string()) {
+ panic!("wait. THIS IS ILLEGAL!");
+ }
let fut = async move {
let node_addr = resolver
.lookup_by_id_staggered(&node_id, &origin_domain, DNS_STAGGERING_MS)
diff --git a/pr/2595/docs/trait.impl/iroh_base/ticket/trait.Ticket.js b/pr/2595/docs/trait.impl/iroh_base/ticket/trait.Ticket.js
index 12fa1e3ee5..5d209fabd2 100644
--- a/pr/2595/docs/trait.impl/iroh_base/ticket/trait.Ticket.js
+++ b/pr/2595/docs/trait.impl/iroh_base/ticket/trait.Ticket.js
@@ -1,5 +1,5 @@
(function() {var implementors = {
"iroh":[],
"iroh_base":[],
-"iroh_docs":[["impl Ticket for DocTicket"]]
+"iroh_docs":[["impl Ticket for DocTicket"]]
};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
diff --git a/pr/2595/docs/type.impl/std/primitive.array.js b/pr/2595/docs/type.impl/std/primitive.array.js
index 588a8b53a3..3006964922 100644
--- a/pr/2595/docs/type.impl/std/primitive.array.js
+++ b/pr/2595/docs/type.impl/std/primitive.array.js
@@ -1,4 +1,4 @@
(function() {var type_impls = {
"iroh":[["source§impl<T, const N: usize> [T; N]
1.55.0 · sourcepub fn map<F, U>(self, f: F) -> [U; N]where\n F: FnMut(T) -> U,
Returns an array of the same size as self, with function f applied to each element\nin order.
\nIf you don’t necessarily need a new fixed-size array, consider using\nIterator::map instead.
\n§Note on performance and stack usage
\nUnfortunately, usages of this method are currently not always optimized\nas well as they could be. This mainly concerns large arrays, as mapping\nover small arrays seem to be optimized just fine. Also note that in\ndebug mode (i.e. without any optimizations), this method can use a lot\nof stack space (a few times the size of the array or more).
\nTherefore, in performance-critical code, try to avoid using this method\non large arrays or check the emitted code. Also try to avoid chained\nmaps (e.g. arr.map(...).map(...)).
\nIn many cases, you can instead use Iterator::map by calling .iter()\nor .into_iter() on your array. [T; N]::map is only necessary if you\nreally need a new array of the same size as the result. Rust’s lazy\niterators tend to get optimized very well.
\n§Examples
\nlet x = [1, 2, 3];\nlet y = x.map(|v| v + 1);\nassert_eq!(y, [2, 3, 4]);\n\nlet x = [1, 2, 3];\nlet mut temp = 0;\nlet y = x.map(|v| { temp += 1; v * temp });\nassert_eq!(y, [1, 4, 9]);\n\nlet x = [\"Ferris\", \"Bueller's\", \"Day\", \"Off\"];\nlet y = x.map(|v| v.len());\nassert_eq!(y, [6, 9, 3, 3]);
\nsourcepub fn try_map<F, R>(\n self,\n f: F\n) -> <<R as Try>::Residual as Residual<[<R as Try>::Output; N]>>::TryType
🔬This is a nightly-only experimental API. (array_try_map)
A fallible function f applied to each element on array self in order to\nreturn an array the same size as self or the first error encountered.
\nThe return type of this function depends on the return type of the closure.\nIf you return Result<T, E> from the closure, you’ll get a Result<[T; N], E>.\nIf you return Option<T> from the closure, you’ll get an Option<[T; N]>.
\n§Examples
\n#![feature(array_try_map)]\n\nlet a = [\"1\", \"2\", \"3\"];\nlet b = a.try_map(|v| v.parse::<u32>()).unwrap().map(|v| v + 1);\nassert_eq!(b, [2, 3, 4]);\n\nlet a = [\"1\", \"2a\", \"3\"];\nlet b = a.try_map(|v| v.parse::<u32>());\nassert!(b.is_err());\n\nuse std::num::NonZero;\n\nlet z = [1, 2, 0, 3, 4];\nassert_eq!(z.try_map(NonZero::new), None);\n\nlet a = [1, 2, 3];\nlet b = a.try_map(NonZero::new);\nlet c = b.map(|x| x.map(NonZero::get));\nassert_eq!(c, Some(a));
\n1.57.0 (const: 1.57.0) · sourcepub const fn as_slice(&self) -> &[T]
Returns a slice containing the entire array. Equivalent to &s[..].
\n1.57.0 · sourcepub fn as_mut_slice(&mut self) -> &mut [T]
Returns a mutable slice containing the entire array. Equivalent to\n&mut s[..].
\n1.77.0 · sourcepub fn each_ref(&self) -> [&T; N]
Borrows each element and returns an array of references with the same\nsize as self.
\n§Example
\nlet floats = [3.1, 2.7, -1.0];\nlet float_refs: [&f64; 3] = floats.each_ref();\nassert_eq!(float_refs, [&3.1, &2.7, &-1.0]);
\nThis method is particularly useful if combined with other methods, like\nmap. This way, you can avoid moving the original\narray if its elements are not Copy.
\n\nlet strings = [\"Ferris\".to_string(), \"♥\".to_string(), \"Rust\".to_string()];\nlet is_ascii = strings.each_ref().map(|s| s.is_ascii());\nassert_eq!(is_ascii, [true, false, true]);\n\n// We can still access the original array: it has not been moved.\nassert_eq!(strings.len(), 3);
\n1.77.0 · sourcepub fn each_mut(&mut self) -> [&mut T; N]
Borrows each element mutably and returns an array of mutable references\nwith the same size as self.
\n§Example
\n\nlet mut floats = [3.1, 2.7, -1.0];\nlet float_refs: [&mut f64; 3] = floats.each_mut();\n*float_refs[0] = 0.0;\nassert_eq!(float_refs, [&mut 0.0, &mut 2.7, &mut -1.0]);\nassert_eq!(floats, [0.0, 2.7, -1.0]);
\nsourcepub fn split_array_ref<const M: usize>(&self) -> (&[T; M], &[T])
🔬This is a nightly-only experimental API. (split_array)
Divides one array reference into two at an index.
\nThe first will contain all indices from [0, M) (excluding\nthe index M itself) and the second will contain all\nindices from [M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet v = [1, 2, 3, 4, 5, 6];\n\n{\n let (left, right) = v.split_array_ref::<0>();\n assert_eq!(left, &[]);\n assert_eq!(right, &[1, 2, 3, 4, 5, 6]);\n}\n\n{\n let (left, right) = v.split_array_ref::<2>();\n assert_eq!(left, &[1, 2]);\n assert_eq!(right, &[3, 4, 5, 6]);\n}\n\n{\n let (left, right) = v.split_array_ref::<6>();\n assert_eq!(left, &[1, 2, 3, 4, 5, 6]);\n assert_eq!(right, &[]);\n}
\nsourcepub fn split_array_mut<const M: usize>(&mut self) -> (&mut [T; M], &mut [T])
🔬This is a nightly-only experimental API. (split_array)
Divides one mutable array reference into two at an index.
\nThe first will contain all indices from [0, M) (excluding\nthe index M itself) and the second will contain all\nindices from [M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet mut v = [1, 0, 3, 0, 5, 6];\nlet (left, right) = v.split_array_mut::<2>();\nassert_eq!(left, &mut [1, 0][..]);\nassert_eq!(right, &mut [3, 0, 5, 6]);\nleft[1] = 2;\nright[1] = 4;\nassert_eq!(v, [1, 2, 3, 4, 5, 6]);
\nsourcepub fn rsplit_array_ref<const M: usize>(&self) -> (&[T], &[T; M])
🔬This is a nightly-only experimental API. (split_array)
Divides one array reference into two at an index from the end.
\nThe first will contain all indices from [0, N - M) (excluding\nthe index N - M itself) and the second will contain all\nindices from [N - M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet v = [1, 2, 3, 4, 5, 6];\n\n{\n let (left, right) = v.rsplit_array_ref::<0>();\n assert_eq!(left, &[1, 2, 3, 4, 5, 6]);\n assert_eq!(right, &[]);\n}\n\n{\n let (left, right) = v.rsplit_array_ref::<2>();\n assert_eq!(left, &[1, 2, 3, 4]);\n assert_eq!(right, &[5, 6]);\n}\n\n{\n let (left, right) = v.rsplit_array_ref::<6>();\n assert_eq!(left, &[]);\n assert_eq!(right, &[1, 2, 3, 4, 5, 6]);\n}
\nsourcepub fn rsplit_array_mut<const M: usize>(&mut self) -> (&mut [T], &mut [T; M])
🔬This is a nightly-only experimental API. (split_array)
Divides one mutable array reference into two at an index from the end.
\nThe first will contain all indices from [0, N - M) (excluding\nthe index N - M itself) and the second will contain all\nindices from [N - M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet mut v = [1, 0, 3, 0, 5, 6];\nlet (left, right) = v.rsplit_array_mut::<4>();\nassert_eq!(left, &mut [1, 0]);\nassert_eq!(right, &mut [3, 0, 5, 6][..]);\nleft[1] = 2;\nright[1] = 4;\nassert_eq!(v, [1, 2, 3, 4, 5, 6]);
\n",0,"iroh::docs::PeerIdBytes"],["source§impl<const N: usize> [u8; N]
sourcepub const fn as_ascii(&self) -> Option<&[AsciiChar; N]>
🔬This is a nightly-only experimental API. (ascii_char)
Converts this array of bytes into a array of ASCII characters,\nor returns None if any of the characters is non-ASCII.
\n§Examples
\n#![feature(ascii_char)]\n#![feature(const_option)]\n\nconst HEX_DIGITS: [std::ascii::Char; 16] =\n *b\"0123456789abcdef\".as_ascii().unwrap();\n\nassert_eq!(HEX_DIGITS[1].as_str(), \"1\");\nassert_eq!(HEX_DIGITS[10].as_str(), \"a\");
\nsourcepub const unsafe fn as_ascii_unchecked(&self) -> &[AsciiChar; N]
🔬This is a nightly-only experimental API. (ascii_char)
Converts this array of bytes into a array of ASCII characters,\nwithout checking whether they’re valid.
\n§Safety
\nEvery byte in the array must be in 0..=127, or else this is UB.
\n",0,"iroh::docs::PeerIdBytes"],["§impl<T> Array for [T; 32]where\n T: Default,
§fn as_slice_mut(&mut self) -> &mut [T]
Gives a unique slice over the whole thing. Read more","Array","iroh::docs::PeerIdBytes"],["","Array","iroh::docs::PeerIdBytes"],["§impl<const N: usize, T> AsBytes for [T; N]where\n T: AsBytes,
§fn write_to_prefix(&self, bytes: &mut [u8]) -> Option<()>
","AsBytes","iroh::docs::PeerIdBytes"],["","AsBytes","iroh::docs::PeerIdBytes"],["","AsMut<[T]>","iroh::docs::PeerIdBytes"],["","AsRef<[T]>","iroh::docs::PeerIdBytes"],["§impl<T, const N: usize> BitView for [T; N]where\n T: BitStore,
Note that overly-large arrays may cause the conversions to fail.
\n§fn view_bits<O>(&self) -> &BitSlice<T, O>where\n O: BitOrder,
Views a memory region as an immutable bit-slice.§fn try_view_bits<O>(&self) -> Result<&BitSlice<T, O>, BitSpanError<T>>where\n O: BitOrder,
Attempts to view a memory region as an immutable bit-slice. Read more§fn view_bits_mut<O>(&mut self) -> &mut BitSlice<T, O>where\n O: BitOrder,
Views a memory region as a mutable bit-slice.§fn try_view_bits_mut<O>(\n &mut self\n) -> Result<&mut BitSlice<T, O>, BitSpanError<T>>where\n O: BitOrder,
Attempts to view a memory region as a mutable bit-slice. Read more","BitView","iroh::docs::PeerIdBytes"],["§impl<T, const N: usize> BitViewSized for [T; N]where\n T: BitStore,
§fn as_raw_slice(&self) -> &[<[T; N] as BitView>::Store]
Views the type as a slice of its elements.§fn as_raw_mut_slice(&mut self) -> &mut [<[T; N] as BitView>::Store]
Views the type as a mutable slice of its elements.§fn into_bitarray<O>(self) -> BitArray<Self, O>where\n O: BitOrder,
Wraps self in a BitArray.","BitViewSized","iroh::docs::PeerIdBytes"],["","Borrow<[T]>","iroh::docs::PeerIdBytes"],["1.4.0 · source§impl<T, const N: usize> BorrowMut<[T]> for [T; N]
source§fn borrow_mut(&mut self) -> &mut [T]
Mutably borrows from an owned value. Read more","BorrowMut<[T]>","iroh::docs::PeerIdBytes"],["","Chain","iroh::docs::PeerIdBytes"],["","Clone","iroh::docs::PeerIdBytes"],["","Debug","iroh::docs::PeerIdBytes"],["§impl<const N: usize> Decode for [u8; N]
Decodes a byte array from byte[n] as described in RFC4251 § 5:
\n\nA byte represents an arbitrary 8-bit value (octet). Fixed length\ndata is sometimes represented as an array of bytes, written\nbyte[n], where n is the number of bytes in the array.
\n
\n","Decode","iroh::docs::PeerIdBytes"],["§impl<'a, T, const N: usize> DecodeValue<'a> for [T; N]where\n T: Decode<'a>,
§fn decode_value<R>(reader: &mut R, header: Header) -> Result<[T; N], Error>where\n R: Reader<'a>,
Attempt to decode this message using the provided [Reader].","DecodeValue<'a>","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["","Default","iroh::docs::PeerIdBytes"],["source§impl<'de, T> Deserialize<'de> for [T; 32]where\n T: Deserialize<'de>,
source§fn deserialize<D>(\n deserializer: D\n) -> Result<[T; 32], <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more","Deserialize<'de>","iroh::docs::PeerIdBytes"],["source§impl<'de, const N: usize> Deserialize<'de> for [u8; N]
source§fn deserialize<D>(\n deserializer: D\n) -> Result<[u8; N], <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
","Deserialize<'de>","iroh::docs::PeerIdBytes"],["§impl<const N: usize> Encode for [u8; N]
Encodes [u8; N] into byte[n] as described in RFC4251 § 5:
\n\nA byte represents an arbitrary 8-bit value (octet). Fixed length\ndata is sometimes represented as an array of bytes, written\nbyte[n], where n is the number of bytes in the array.
\n
\n§fn encoded_len(&self) -> Result<usize, Error>
Get the length of this type encoded in bytes, prior to Base64 encoding.§fn encode(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value using the provided [Writer].§fn encoded_len_prefixed(&self) -> Result<usize, Error>
Return the length of this type after encoding when prepended with a\nuint32 length prefix.§fn encode_prefixed(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value, first prepending a uint32 length prefix\nset to [Encode::encoded_len].","Encode","iroh::docs::PeerIdBytes"],["","EncodeLabelSet","iroh::docs::PeerIdBytes"],["§impl<T, const N: usize> EncodeValue for [T; N]where\n T: Encode,
","EncodeValue","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["","Fill","iroh::docs::PeerIdBytes"],["§impl<'a> FindToken<&'a u8> for [u8; 32]
§fn find_token(&self, token: &u8) -> bool
Returns true if self contains the token","FindToken<&'a u8>","iroh::docs::PeerIdBytes"],["§impl FindToken<u8> for [u8; 32]
§fn find_token(&self, token: u8) -> bool
Returns true if self contains the token","FindToken","iroh::docs::PeerIdBytes"],["","FixedTag","iroh::docs::PeerIdBytes"],["","From<&Signature>","iroh::docs::PeerIdBytes"],["","From","iroh::docs::PeerIdBytes"],["§impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>>> for [T; 32]
","From, B0>, B0>, B0>, B0>, B0>>>","iroh::docs::PeerIdBytes"],["","From","iroh::docs::PeerIdBytes"],["","From","iroh::docs::PeerIdBytes"],["","From>","iroh::docs::PeerIdBytes"],["","From","iroh::docs::PeerIdBytes"],["","From","iroh::docs::PeerIdBytes"],["","From","iroh::docs::PeerIdBytes"],["","From>","iroh::docs::PeerIdBytes"],["§impl<const N: usize, T> FromBytes for [T; N]where\n T: FromBytes,
§fn slice_from_prefix(bytes: &[u8], count: usize) -> Option<(&[Self], &[u8])>where\n Self: Sized,
Interprets the prefix of the given bytes as a &[Self] with length\nequal to count without copying. Read more§fn slice_from_suffix(bytes: &[u8], count: usize) -> Option<(&[u8], &[Self])>where\n Self: Sized,
Interprets the suffix of the given bytes as a &[Self] with length\nequal to count without copying. Read more§fn read_from_prefix(bytes: &[u8]) -> Option<Self>where\n Self: Sized,
","FromBytes","iroh::docs::PeerIdBytes"],["","FromHex","iroh::docs::PeerIdBytes"],["","FromZeroes","iroh::docs::PeerIdBytes"],["","Hash","iroh::docs::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Hash for [T; N]where\n T: Hash,
The hash of an array is the same as that of the corresponding slice,\nas required by the Borrow implementation.
\n\nuse std::hash::BuildHasher;\n\nlet b = std::hash::RandomState::new();\nlet a: [u8; 3] = [0xa8, 0x3c, 0x09];\nlet s: &[u8] = &[0xa8, 0x3c, 0x09];\nassert_eq!(b.hash_one(a), b.hash_one(s));
\n","Hash","iroh::docs::PeerIdBytes"],["","Index","iroh::docs::PeerIdBytes"],["","IndexMut","iroh::docs::PeerIdBytes"],["","InputLength","iroh::docs::PeerIdBytes"],["1.53.0 · source§impl<T, const N: usize> IntoIterator for [T; N]
source§fn into_iter(self) -> <[T; N] as IntoIterator>::IntoIter
Creates a consuming iterator, that is, one that moves each value out of\nthe array (from start to end). The array cannot be used after calling\nthis unless T implements Copy, so the whole array is copied.
\nArrays have special behavior when calling .into_iter() prior to the\n2021 edition – see the array Editions section for more information.
\n","IntoIterator","iroh::docs::PeerIdBytes"],["§impl<const N: usize> IntoResponse for [u8; N]
§fn into_response(self) -> Response<Body>
Create a response.","IntoResponse","iroh::docs::PeerIdBytes"],["§impl<Fut, const N: usize> Join for [Fut; N]where\n Fut: IntoFuture,
§type Output = [<Fut as IntoFuture>::Output; N]
The resulting output type.§type Future = Join<<Fut as IntoFuture>::IntoFuture, N>
The Future implementation returned by this method.","Join","iroh::docs::PeerIdBytes"],["","Key","iroh::docs::PeerIdBytes"],["§impl<T, const N: usize> MaxSize for [T; N]where\n T: MaxSize,
§const POSTCARD_MAX_SIZE: usize = _
The maximum possible size that the serialization of this\ntype can have, in bytes.","MaxSize","iroh::docs::PeerIdBytes"],["","Merge","iroh::docs::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Ord for [T; N]where\n T: Ord,
Implements comparison of arrays lexicographically.
\n1.21.0 · source§fn max(self, other: Self) -> Selfwhere\n Self: Sized,
Compares and returns the maximum of two values. Read more","Ord","iroh::docs::PeerIdBytes"],["","PartialEq<&[U]>","iroh::docs::PeerIdBytes"],["1.0.0 · source§impl<T, U, const N: usize> PartialEq<&mut [U]> for [T; N]where\n T: PartialEq<U>,
","PartialEq<&mut [U]>","iroh::docs::PeerIdBytes"],["","PartialEq<[U]>","iroh::docs::PeerIdBytes"],["","PartialEq<[U; N]>","iroh::docs::PeerIdBytes"],["","PartialEq","iroh::docs::PeerIdBytes"],["§impl<A, B, const N: usize, const M: usize> PartialEq<Vec<A, N>> for [B; M]where\n A: PartialEq<B>,
","PartialEq>","iroh::docs::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> PartialOrd for [T; N]where\n T: PartialOrd,
Implements comparison of arrays lexicographically.
\nsource§fn le(&self, other: &[T; N]) -> bool
This method tests less than or equal to (for self and other) and is used by the <=\noperator. Read more","PartialOrd","iroh::docs::PeerIdBytes"],["§impl<Fut, const N: usize> Race for [Fut; N]where\n Fut: IntoFuture,
§type Output = <Fut as IntoFuture>::Output
The resulting output type.§type Future = Race<<Fut as IntoFuture>::IntoFuture, N>
Which kind of future are we turning this into?","Race","iroh::docs::PeerIdBytes"],["§impl<Fut, T, E, const N: usize> RaceOk for [Fut; N]where\n Fut: IntoFuture<Output = Result<T, E>>,
§type Future = RaceOk<<Fut as IntoFuture>::IntoFuture, T, E, N>
Which kind of future are we turning this into?","RaceOk","iroh::docs::PeerIdBytes"],["","Schema","iroh::docs::PeerIdBytes"],["source§impl<T> Serialize for [T; 32]where\n T: 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","iroh::docs::PeerIdBytes"],["source§impl<const N: usize> Serialize for [u8; N]
source§fn serialize<S>(\n &self,\n serializer: S\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where\n S: Serializer,
","Serialize","iroh::docs::PeerIdBytes"],["1.51.0 · source§impl<T, const N: usize> SlicePattern for [T; N]
","SlicePattern","iroh::docs::PeerIdBytes"],["1.34.0 · source§impl<T, const N: usize> TryFrom<&[T]> for [T; N]where\n T: Copy,
Tries to create an array [T; N] by copying from a slice &[T]. Succeeds if\nslice.len() == N.
\n\nlet bytes: [u8; 3] = [1, 0, 2];\n\nlet bytes_head: [u8; 2] = <[u8; 2]>::try_from(&bytes[0..2]).unwrap();\nassert_eq!(1, u16::from_le_bytes(bytes_head));\n\nlet bytes_tail: [u8; 2] = bytes[1..3].try_into().unwrap();\nassert_eq!(512, u16::from_le_bytes(bytes_tail));
\n§type Error = TryFromSliceError
The type returned in the event of a conversion error.","TryFrom<&[T]>","iroh::docs::PeerIdBytes"],["1.59.0 · source§impl<T, const N: usize> TryFrom<&mut [T]> for [T; N]where\n T: Copy,
Tries to create an array [T; N] by copying from a mutable slice &mut [T].\nSucceeds if slice.len() == N.
\n\nlet mut bytes: [u8; 3] = [1, 0, 2];\n\nlet bytes_head: [u8; 2] = <[u8; 2]>::try_from(&mut bytes[0..2]).unwrap();\nassert_eq!(1, u16::from_le_bytes(bytes_head));\n\nlet bytes_tail: [u8; 2] = (&mut bytes[1..3]).try_into().unwrap();\nassert_eq!(512, u16::from_le_bytes(bytes_tail));
\n§type Error = TryFromSliceError
The type returned in the event of a conversion error.","TryFrom<&mut [T]>","iroh::docs::PeerIdBytes"],["§impl<T, A, const N: usize> TryFrom<Vec<T, A>> for [T; N]where\n A: Allocator,
§fn try_from(vec: Vec<T, A>) -> Result<[T; N], Vec<T, A>>
Gets the entire contents of the Vec<T> as an array,\nif its size exactly matches that of the requested array.
\n§Examples
\nassert_eq!(vec![1, 2, 3].try_into(), Ok([1, 2, 3]));\nassert_eq!(<Vec<i32>>::new().try_into(), Ok([]));
\nIf the length doesn’t match, the input comes back in Err:
\n\nlet r: Result<[i32; 4], _> = (0..10).collect::<Vec<_>>().try_into();\nassert_eq!(r, Err(vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9]));
\nIf you’re fine with just getting a prefix of the Vec<T>,\nyou can call .truncate(N) first.
\n\nlet mut v = String::from(\"hello world\").into_bytes();\nv.sort();\nv.truncate(2);\nlet [a, b]: [_; 2] = v.try_into().unwrap();\nassert_eq!(a, b' ');\nassert_eq!(b, b'd');
\n","TryFrom>","iroh::docs::PeerIdBytes"],["1.48.0 · source§impl<T, A, const N: usize> TryFrom<Vec<T, A>> for [T; N]where\n A: Allocator,
source§fn try_from(vec: Vec<T, A>) -> Result<[T; N], Vec<T, A>>
Gets the entire contents of the Vec<T> as an array,\nif its size exactly matches that of the requested array.
\n§Examples
\nassert_eq!(vec![1, 2, 3].try_into(), Ok([1, 2, 3]));\nassert_eq!(<Vec<i32>>::new().try_into(), Ok([]));
\nIf the length doesn’t match, the input comes back in Err:
\n\nlet r: Result<[i32; 4], _> = (0..10).collect::<Vec<_>>().try_into();\nassert_eq!(r, Err(vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9]));
\nIf you’re fine with just getting a prefix of the Vec<T>,\nyou can call .truncate(N) first.
\n\nlet mut v = String::from(\"hello world\").into_bytes();\nv.sort();\nv.truncate(2);\nlet [a, b]: [_; 2] = v.try_into().unwrap();\nassert_eq!(a, b' ');\nassert_eq!(b, b'd');
\n","TryFrom>","iroh::docs::PeerIdBytes"],["§impl<Fut, T, E, const N: usize> TryJoin for [Fut; N]where\n Fut: IntoFuture<Output = Result<T, E>>,
§type Future = TryJoin<<Fut as IntoFuture>::IntoFuture, T, E, N>
Which kind of future are we turning this into?","TryJoin","iroh::docs::PeerIdBytes"],["§impl<const N: usize, T> Value for [T; N]where\n T: Value,
§type SelfType<'a> = [<T as Value>::SelfType<'a>; N]\nwhere\n [T; N]: 'a
SelfType<’a> must be the same type as Self with all lifetimes replaced with ’a§type AsBytes<'a> = Vec<u8>\nwhere\n [T; N]: 'a
§fn fixed_width() -> Option<usize>
Width of a fixed type, or None for variable width§fn from_bytes<'a>(data: &'a [u8]) -> [<T as Value>::SelfType<'a>; N]where\n [T; N]: 'a,
Deserializes data\nImplementations may return a view over data, or an owned type","Value","iroh::docs::PeerIdBytes"],["","ValueOrd","iroh::docs::PeerIdBytes"],["§impl<Z, const N: usize> Zeroize for [Z; N]where\n Z: Zeroize,
Impl [Zeroize] on arrays of types that impl [Zeroize].
\n","Zeroize","iroh::docs::PeerIdBytes"],["","Zip","iroh::docs::PeerIdBytes"],["source§impl<T, const N: usize> ConstParamTy for [T; N]where\n T: ConstParamTy,
","ConstParamTy","iroh::docs::PeerIdBytes"],["1.58.0 · source§impl<T, const N: usize> Copy for [T; N]where\n T: Copy,
","Copy","iroh::docs::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Eq for [T; N]where\n T: Eq,
","Eq","iroh::docs::PeerIdBytes"],["source§impl<T, const N: usize> StructuralPartialEq for [T; N]
","StructuralPartialEq","iroh::docs::PeerIdBytes"],["§impl<const N: usize, T> Unaligned for [T; N]where\n T: Unaligned,
","Unaligned","iroh::docs::PeerIdBytes"],["§impl<Z, const N: usize> ZeroizeOnDrop for [Z; N]where\n Z: ZeroizeOnDrop,
Impl [ZeroizeOnDrop] on arrays of types that impl [ZeroizeOnDrop].
\n","ZeroizeOnDrop","iroh::docs::PeerIdBytes"]],
-"iroh_docs":[["source§impl<T, const N: usize> [T; N]
1.55.0 · sourcepub fn map<F, U>(self, f: F) -> [U; N]where\n F: FnMut(T) -> U,
Returns an array of the same size as self, with function f applied to each element\nin order.
\nIf you don’t necessarily need a new fixed-size array, consider using\nIterator::map instead.
\n§Note on performance and stack usage
\nUnfortunately, usages of this method are currently not always optimized\nas well as they could be. This mainly concerns large arrays, as mapping\nover small arrays seem to be optimized just fine. Also note that in\ndebug mode (i.e. without any optimizations), this method can use a lot\nof stack space (a few times the size of the array or more).
\nTherefore, in performance-critical code, try to avoid using this method\non large arrays or check the emitted code. Also try to avoid chained\nmaps (e.g. arr.map(...).map(...)).
\nIn many cases, you can instead use Iterator::map by calling .iter()\nor .into_iter() on your array. [T; N]::map is only necessary if you\nreally need a new array of the same size as the result. Rust’s lazy\niterators tend to get optimized very well.
\n§Examples
\nlet x = [1, 2, 3];\nlet y = x.map(|v| v + 1);\nassert_eq!(y, [2, 3, 4]);\n\nlet x = [1, 2, 3];\nlet mut temp = 0;\nlet y = x.map(|v| { temp += 1; v * temp });\nassert_eq!(y, [1, 4, 9]);\n\nlet x = [\"Ferris\", \"Bueller's\", \"Day\", \"Off\"];\nlet y = x.map(|v| v.len());\nassert_eq!(y, [6, 9, 3, 3]);
\nsourcepub fn try_map<F, R>(\n self,\n f: F\n) -> <<R as Try>::Residual as Residual<[<R as Try>::Output; N]>>::TryType
🔬This is a nightly-only experimental API. (array_try_map)
A fallible function f applied to each element on array self in order to\nreturn an array the same size as self or the first error encountered.
\nThe return type of this function depends on the return type of the closure.\nIf you return Result<T, E> from the closure, you’ll get a Result<[T; N], E>.\nIf you return Option<T> from the closure, you’ll get an Option<[T; N]>.
\n§Examples
\n#![feature(array_try_map)]\n\nlet a = [\"1\", \"2\", \"3\"];\nlet b = a.try_map(|v| v.parse::<u32>()).unwrap().map(|v| v + 1);\nassert_eq!(b, [2, 3, 4]);\n\nlet a = [\"1\", \"2a\", \"3\"];\nlet b = a.try_map(|v| v.parse::<u32>());\nassert!(b.is_err());\n\nuse std::num::NonZero;\n\nlet z = [1, 2, 0, 3, 4];\nassert_eq!(z.try_map(NonZero::new), None);\n\nlet a = [1, 2, 3];\nlet b = a.try_map(NonZero::new);\nlet c = b.map(|x| x.map(NonZero::get));\nassert_eq!(c, Some(a));
\n1.57.0 (const: 1.57.0) · sourcepub const fn as_slice(&self) -> &[T]
Returns a slice containing the entire array. Equivalent to &s[..].
\n1.57.0 · sourcepub fn as_mut_slice(&mut self) -> &mut [T]
Returns a mutable slice containing the entire array. Equivalent to\n&mut s[..].
\n1.77.0 · sourcepub fn each_ref(&self) -> [&T; N]
Borrows each element and returns an array of references with the same\nsize as self.
\n§Example
\nlet floats = [3.1, 2.7, -1.0];\nlet float_refs: [&f64; 3] = floats.each_ref();\nassert_eq!(float_refs, [&3.1, &2.7, &-1.0]);
\nThis method is particularly useful if combined with other methods, like\nmap. This way, you can avoid moving the original\narray if its elements are not Copy.
\n\nlet strings = [\"Ferris\".to_string(), \"♥\".to_string(), \"Rust\".to_string()];\nlet is_ascii = strings.each_ref().map(|s| s.is_ascii());\nassert_eq!(is_ascii, [true, false, true]);\n\n// We can still access the original array: it has not been moved.\nassert_eq!(strings.len(), 3);
\n1.77.0 · sourcepub fn each_mut(&mut self) -> [&mut T; N]
Borrows each element mutably and returns an array of mutable references\nwith the same size as self.
\n§Example
\n\nlet mut floats = [3.1, 2.7, -1.0];\nlet float_refs: [&mut f64; 3] = floats.each_mut();\n*float_refs[0] = 0.0;\nassert_eq!(float_refs, [&mut 0.0, &mut 2.7, &mut -1.0]);\nassert_eq!(floats, [0.0, 2.7, -1.0]);
\nsourcepub fn split_array_ref<const M: usize>(&self) -> (&[T; M], &[T])
🔬This is a nightly-only experimental API. (split_array)
Divides one array reference into two at an index.
\nThe first will contain all indices from [0, M) (excluding\nthe index M itself) and the second will contain all\nindices from [M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet v = [1, 2, 3, 4, 5, 6];\n\n{\n let (left, right) = v.split_array_ref::<0>();\n assert_eq!(left, &[]);\n assert_eq!(right, &[1, 2, 3, 4, 5, 6]);\n}\n\n{\n let (left, right) = v.split_array_ref::<2>();\n assert_eq!(left, &[1, 2]);\n assert_eq!(right, &[3, 4, 5, 6]);\n}\n\n{\n let (left, right) = v.split_array_ref::<6>();\n assert_eq!(left, &[1, 2, 3, 4, 5, 6]);\n assert_eq!(right, &[]);\n}
\nsourcepub fn split_array_mut<const M: usize>(&mut self) -> (&mut [T; M], &mut [T])
🔬This is a nightly-only experimental API. (split_array)
Divides one mutable array reference into two at an index.
\nThe first will contain all indices from [0, M) (excluding\nthe index M itself) and the second will contain all\nindices from [M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet mut v = [1, 0, 3, 0, 5, 6];\nlet (left, right) = v.split_array_mut::<2>();\nassert_eq!(left, &mut [1, 0][..]);\nassert_eq!(right, &mut [3, 0, 5, 6]);\nleft[1] = 2;\nright[1] = 4;\nassert_eq!(v, [1, 2, 3, 4, 5, 6]);
\nsourcepub fn rsplit_array_ref<const M: usize>(&self) -> (&[T], &[T; M])
🔬This is a nightly-only experimental API. (split_array)
Divides one array reference into two at an index from the end.
\nThe first will contain all indices from [0, N - M) (excluding\nthe index N - M itself) and the second will contain all\nindices from [N - M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet v = [1, 2, 3, 4, 5, 6];\n\n{\n let (left, right) = v.rsplit_array_ref::<0>();\n assert_eq!(left, &[1, 2, 3, 4, 5, 6]);\n assert_eq!(right, &[]);\n}\n\n{\n let (left, right) = v.rsplit_array_ref::<2>();\n assert_eq!(left, &[1, 2, 3, 4]);\n assert_eq!(right, &[5, 6]);\n}\n\n{\n let (left, right) = v.rsplit_array_ref::<6>();\n assert_eq!(left, &[]);\n assert_eq!(right, &[1, 2, 3, 4, 5, 6]);\n}
\nsourcepub fn rsplit_array_mut<const M: usize>(&mut self) -> (&mut [T], &mut [T; M])
🔬This is a nightly-only experimental API. (split_array)
Divides one mutable array reference into two at an index from the end.
\nThe first will contain all indices from [0, N - M) (excluding\nthe index N - M itself) and the second will contain all\nindices from [N - M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet mut v = [1, 0, 3, 0, 5, 6];\nlet (left, right) = v.rsplit_array_mut::<4>();\nassert_eq!(left, &mut [1, 0]);\nassert_eq!(right, &mut [3, 0, 5, 6][..]);\nleft[1] = 2;\nright[1] = 4;\nassert_eq!(v, [1, 2, 3, 4, 5, 6]);
\n",0,"iroh_docs::sync::PeerIdBytes"],["source§impl<const N: usize> [u8; N]
sourcepub const fn as_ascii(&self) -> Option<&[AsciiChar; N]>
🔬This is a nightly-only experimental API. (ascii_char)
Converts this array of bytes into a array of ASCII characters,\nor returns None if any of the characters is non-ASCII.
\n§Examples
\n#![feature(ascii_char)]\n#![feature(const_option)]\n\nconst HEX_DIGITS: [std::ascii::Char; 16] =\n *b\"0123456789abcdef\".as_ascii().unwrap();\n\nassert_eq!(HEX_DIGITS[1].as_str(), \"1\");\nassert_eq!(HEX_DIGITS[10].as_str(), \"a\");
\nsourcepub const unsafe fn as_ascii_unchecked(&self) -> &[AsciiChar; N]
🔬This is a nightly-only experimental API. (ascii_char)
Converts this array of bytes into a array of ASCII characters,\nwithout checking whether they’re valid.
\n§Safety
\nEvery byte in the array must be in 0..=127, or else this is UB.
\n",0,"iroh_docs::sync::PeerIdBytes"],["§impl<T> Array for [T; 32]where\n T: Default,
§fn as_slice_mut(&mut self) -> &mut [T]
Gives a unique slice over the whole thing. Read more","Array","iroh_docs::sync::PeerIdBytes"],["","Array","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> AsBytes for [T; N]where\n T: AsBytes,
§fn write_to_prefix(&self, bytes: &mut [u8]) -> Option<()>
","AsBytes","iroh_docs::sync::PeerIdBytes"],["","AsBytes","iroh_docs::sync::PeerIdBytes"],["","AsMut<[T]>","iroh_docs::sync::PeerIdBytes"],["","AsRef<[T]>","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> BitView for [T; N]where\n T: BitStore,
Note that overly-large arrays may cause the conversions to fail.
\n§fn view_bits<O>(&self) -> &BitSlice<T, O>where\n O: BitOrder,
Views a memory region as an immutable bit-slice.§fn try_view_bits<O>(&self) -> Result<&BitSlice<T, O>, BitSpanError<T>>where\n O: BitOrder,
Attempts to view a memory region as an immutable bit-slice. Read more§fn view_bits_mut<O>(&mut self) -> &mut BitSlice<T, O>where\n O: BitOrder,
Views a memory region as a mutable bit-slice.§fn try_view_bits_mut<O>(\n &mut self\n) -> Result<&mut BitSlice<T, O>, BitSpanError<T>>where\n O: BitOrder,
Attempts to view a memory region as a mutable bit-slice. Read more","BitView","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> BitViewSized for [T; N]where\n T: BitStore,
§fn as_raw_slice(&self) -> &[<[T; N] as BitView>::Store]
Views the type as a slice of its elements.§fn as_raw_mut_slice(&mut self) -> &mut [<[T; N] as BitView>::Store]
Views the type as a mutable slice of its elements.§fn into_bitarray<O>(self) -> BitArray<Self, O>where\n O: BitOrder,
Wraps self in a BitArray.","BitViewSized","iroh_docs::sync::PeerIdBytes"],["","Borrow<[T]>","iroh_docs::sync::PeerIdBytes"],["1.4.0 · source§impl<T, const N: usize> BorrowMut<[T]> for [T; N]
source§fn borrow_mut(&mut self) -> &mut [T]
Mutably borrows from an owned value. Read more","BorrowMut<[T]>","iroh_docs::sync::PeerIdBytes"],["","Chain","iroh_docs::sync::PeerIdBytes"],["","Clone","iroh_docs::sync::PeerIdBytes"],["","Debug","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize> Decode for [u8; N]
Decodes a byte array from byte[n] as described in RFC4251 § 5:
\n\nA byte represents an arbitrary 8-bit value (octet). Fixed length\ndata is sometimes represented as an array of bytes, written\nbyte[n], where n is the number of bytes in the array.
\n
\n","Decode","iroh_docs::sync::PeerIdBytes"],["§impl<'a, T, const N: usize> DecodeValue<'a> for [T; N]where\n T: Decode<'a>,
§fn decode_value<R>(reader: &mut R, header: Header) -> Result<[T; N], Error>where\n R: Reader<'a>,
Attempt to decode this message using the provided [Reader].","DecodeValue<'a>","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["source§impl<'de, T> Deserialize<'de> for [T; 32]where\n T: Deserialize<'de>,
source§fn deserialize<D>(\n deserializer: D\n) -> Result<[T; 32], <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more","Deserialize<'de>","iroh_docs::sync::PeerIdBytes"],["source§impl<'de, const N: usize> Deserialize<'de> for [u8; N]
source§fn deserialize<D>(\n deserializer: D\n) -> Result<[u8; N], <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
","Deserialize<'de>","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize> Encode for [u8; N]
Encodes [u8; N] into byte[n] as described in RFC4251 § 5:
\n\nA byte represents an arbitrary 8-bit value (octet). Fixed length\ndata is sometimes represented as an array of bytes, written\nbyte[n], where n is the number of bytes in the array.
\n
\n§fn encoded_len(&self) -> Result<usize, Error>
Get the length of this type encoded in bytes, prior to Base64 encoding.§fn encode(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value using the provided [Writer].§fn encoded_len_prefixed(&self) -> Result<usize, Error>
Return the length of this type after encoding when prepended with a\nuint32 length prefix.§fn encode_prefixed(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value, first prepending a uint32 length prefix\nset to [Encode::encoded_len].","Encode","iroh_docs::sync::PeerIdBytes"],["","EncodeLabelSet","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> EncodeValue for [T; N]where\n T: Encode,
","EncodeValue","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["§impl<'a> FindToken<&'a u8> for [u8; 32]
§fn find_token(&self, token: &u8) -> bool
Returns true if self contains the token","FindToken<&'a u8>","iroh_docs::sync::PeerIdBytes"],["§impl FindToken<u8> for [u8; 32]
§fn find_token(&self, token: u8) -> bool
Returns true if self contains the token","FindToken","iroh_docs::sync::PeerIdBytes"],["","FixedTag","iroh_docs::sync::PeerIdBytes"],["","From<&Signature>","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["§impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>>> for [T; 32]
","From, B0>, B0>, B0>, B0>, B0>>>","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["","From>","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["source§impl From<NamespaceId> for [u8; 32]
source§fn from(value: NamespaceId) -> Self
Converts to this type from the input type.","From","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["","From>","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> FromBytes for [T; N]where\n T: FromBytes,
§fn slice_from_prefix(bytes: &[u8], count: usize) -> Option<(&[Self], &[u8])>where\n Self: Sized,
Interprets the prefix of the given bytes as a &[Self] with length\nequal to count without copying. Read more§fn slice_from_suffix(bytes: &[u8], count: usize) -> Option<(&[u8], &[Self])>where\n Self: Sized,
Interprets the suffix of the given bytes as a &[Self] with length\nequal to count without copying. Read more§fn read_from_prefix(bytes: &[u8]) -> Option<Self>where\n Self: Sized,
","FromBytes","iroh_docs::sync::PeerIdBytes"],["","FromHex","iroh_docs::sync::PeerIdBytes"],["","FromZeroes","iroh_docs::sync::PeerIdBytes"],["","Hash","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Hash for [T; N]where\n T: Hash,
The hash of an array is the same as that of the corresponding slice,\nas required by the Borrow implementation.
\n\nuse std::hash::BuildHasher;\n\nlet b = std::hash::RandomState::new();\nlet a: [u8; 3] = [0xa8, 0x3c, 0x09];\nlet s: &[u8] = &[0xa8, 0x3c, 0x09];\nassert_eq!(b.hash_one(a), b.hash_one(s));
\n","Hash","iroh_docs::sync::PeerIdBytes"],["","Index","iroh_docs::sync::PeerIdBytes"],["","IndexMut","iroh_docs::sync::PeerIdBytes"],["","InputLength","iroh_docs::sync::PeerIdBytes"],["1.53.0 · source§impl<T, const N: usize> IntoIterator for [T; N]
source§fn into_iter(self) -> <[T; N] as IntoIterator>::IntoIter
Creates a consuming iterator, that is, one that moves each value out of\nthe array (from start to end). The array cannot be used after calling\nthis unless T implements Copy, so the whole array is copied.
\nArrays have special behavior when calling .into_iter() prior to the\n2021 edition – see the array Editions section for more information.
\n","IntoIterator","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize> IntoResponse for [u8; N]
§fn into_response(self) -> Response<Body>
Create a response.","IntoResponse","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, const N: usize> Join for [Fut; N]where\n Fut: IntoFuture,
§type Output = [<Fut as IntoFuture>::Output; N]
The resulting output type.§type Future = Join<<Fut as IntoFuture>::IntoFuture, N>
The Future implementation returned by this method.","Join","iroh_docs::sync::PeerIdBytes"],["","Key","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> MaxSize for [T; N]where\n T: MaxSize,
§const POSTCARD_MAX_SIZE: usize = _
The maximum possible size that the serialization of this\ntype can have, in bytes.","MaxSize","iroh_docs::sync::PeerIdBytes"],["","Merge","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Ord for [T; N]where\n T: Ord,
Implements comparison of arrays lexicographically.
\n1.21.0 · source§fn max(self, other: Self) -> Selfwhere\n Self: Sized,
Compares and returns the maximum of two values. Read more","Ord","iroh_docs::sync::PeerIdBytes"],["","PartialEq<&[U]>","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, U, const N: usize> PartialEq<&mut [U]> for [T; N]where\n T: PartialEq<U>,
","PartialEq<&mut [U]>","iroh_docs::sync::PeerIdBytes"],["","PartialEq<[U]>","iroh_docs::sync::PeerIdBytes"],["","PartialEq<[U; N]>","iroh_docs::sync::PeerIdBytes"],["","PartialEq","iroh_docs::sync::PeerIdBytes"],["§impl<A, B, const N: usize, const M: usize> PartialEq<Vec<A, N>> for [B; M]where\n A: PartialEq<B>,
","PartialEq>","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> PartialOrd for [T; N]where\n T: PartialOrd,
Implements comparison of arrays lexicographically.
\nsource§fn le(&self, other: &[T; N]) -> bool
This method tests less than or equal to (for self and other) and is used by the <=\noperator. Read more","PartialOrd","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, const N: usize> Race for [Fut; N]where\n Fut: IntoFuture,
§type Output = <Fut as IntoFuture>::Output
The resulting output type.§type Future = Race<<Fut as IntoFuture>::IntoFuture, N>
Which kind of future are we turning this into?","Race","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, T, E, const N: usize> RaceOk for [Fut; N]where\n Fut: IntoFuture<Output = Result<T, E>>,
§type Future = RaceOk<<Fut as IntoFuture>::IntoFuture, T, E, N>
Which kind of future are we turning this into?","RaceOk","iroh_docs::sync::PeerIdBytes"],["","Schema","iroh_docs::sync::PeerIdBytes"],["source§impl<T> Serialize for [T; 32]where\n T: 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","iroh_docs::sync::PeerIdBytes"],["source§impl<const N: usize> Serialize for [u8; N]
source§fn serialize<S>(\n &self,\n serializer: S\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where\n S: Serializer,
","Serialize","iroh_docs::sync::PeerIdBytes"],["1.51.0 · source§impl<T, const N: usize> SlicePattern for [T; N]
","SlicePattern","iroh_docs::sync::PeerIdBytes"],["1.34.0 · source§impl<T, const N: usize> TryFrom<&[T]> for [T; N]where\n T: Copy,
Tries to create an array [T; N] by copying from a slice &[T]. Succeeds if\nslice.len() == N.
\n\nlet bytes: [u8; 3] = [1, 0, 2];\n\nlet bytes_head: [u8; 2] = <[u8; 2]>::try_from(&bytes[0..2]).unwrap();\nassert_eq!(1, u16::from_le_bytes(bytes_head));\n\nlet bytes_tail: [u8; 2] = bytes[1..3].try_into().unwrap();\nassert_eq!(512, u16::from_le_bytes(bytes_tail));
\n§type Error = TryFromSliceError
The type returned in the event of a conversion error.","TryFrom<&[T]>","iroh_docs::sync::PeerIdBytes"],["1.59.0 · source§impl<T, const N: usize> TryFrom<&mut [T]> for [T; N]where\n T: Copy,
Tries to create an array [T; N] by copying from a mutable slice &mut [T].\nSucceeds if slice.len() == N.
\n\nlet mut bytes: [u8; 3] = [1, 0, 2];\n\nlet bytes_head: [u8; 2] = <[u8; 2]>::try_from(&mut bytes[0..2]).unwrap();\nassert_eq!(1, u16::from_le_bytes(bytes_head));\n\nlet bytes_tail: [u8; 2] = (&mut bytes[1..3]).try_into().unwrap();\nassert_eq!(512, u16::from_le_bytes(bytes_tail));
\n§type Error = TryFromSliceError
The type returned in the event of a conversion error.","TryFrom<&mut [T]>","iroh_docs::sync::PeerIdBytes"],["§impl<T, A, const N: usize> TryFrom<Vec<T, A>> for [T; N]where\n A: Allocator,
§fn try_from(vec: Vec<T, A>) -> Result<[T; N], Vec<T, A>>
Gets the entire contents of the Vec<T> as an array,\nif its size exactly matches that of the requested array.
\n§Examples
\nassert_eq!(vec![1, 2, 3].try_into(), Ok([1, 2, 3]));\nassert_eq!(<Vec<i32>>::new().try_into(), Ok([]));
\nIf the length doesn’t match, the input comes back in Err:
\n\nlet r: Result<[i32; 4], _> = (0..10).collect::<Vec<_>>().try_into();\nassert_eq!(r, Err(vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9]));
\nIf you’re fine with just getting a prefix of the Vec<T>,\nyou can call .truncate(N) first.
\n\nlet mut v = String::from(\"hello world\").into_bytes();\nv.sort();\nv.truncate(2);\nlet [a, b]: [_; 2] = v.try_into().unwrap();\nassert_eq!(a, b' ');\nassert_eq!(b, b'd');
\n","TryFrom>","iroh_docs::sync::PeerIdBytes"],["1.48.0 · source§impl<T, A, const N: usize> TryFrom<Vec<T, A>> for [T; N]where\n A: Allocator,
source§fn try_from(vec: Vec<T, A>) -> Result<[T; N], Vec<T, A>>
Gets the entire contents of the Vec<T> as an array,\nif its size exactly matches that of the requested array.
\n§Examples
\nassert_eq!(vec![1, 2, 3].try_into(), Ok([1, 2, 3]));\nassert_eq!(<Vec<i32>>::new().try_into(), Ok([]));
\nIf the length doesn’t match, the input comes back in Err:
\n\nlet r: Result<[i32; 4], _> = (0..10).collect::<Vec<_>>().try_into();\nassert_eq!(r, Err(vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9]));
\nIf you’re fine with just getting a prefix of the Vec<T>,\nyou can call .truncate(N) first.
\n\nlet mut v = String::from(\"hello world\").into_bytes();\nv.sort();\nv.truncate(2);\nlet [a, b]: [_; 2] = v.try_into().unwrap();\nassert_eq!(a, b' ');\nassert_eq!(b, b'd');
\n","TryFrom>","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, T, E, const N: usize> TryJoin for [Fut; N]where\n Fut: IntoFuture<Output = Result<T, E>>,
§type Future = TryJoin<<Fut as IntoFuture>::IntoFuture, T, E, N>
Which kind of future are we turning this into?","TryJoin","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> Value for [T; N]where\n T: Value,
§type SelfType<'a> = [<T as Value>::SelfType<'a>; N]\nwhere\n [T; N]: 'a
SelfType<’a> must be the same type as Self with all lifetimes replaced with ’a§type AsBytes<'a> = Vec<u8>\nwhere\n [T; N]: 'a
§fn fixed_width() -> Option<usize>
Width of a fixed type, or None for variable width§fn from_bytes<'a>(data: &'a [u8]) -> [<T as Value>::SelfType<'a>; N]where\n [T; N]: 'a,
Deserializes data\nImplementations may return a view over data, or an owned type","Value","iroh_docs::sync::PeerIdBytes"],["","ValueOrd","iroh_docs::sync::PeerIdBytes"],["§impl<Z, const N: usize> Zeroize for [Z; N]where\n Z: Zeroize,
Impl [Zeroize] on arrays of types that impl [Zeroize].
\n","Zeroize","iroh_docs::sync::PeerIdBytes"],["","Zip","iroh_docs::sync::PeerIdBytes"],["source§impl<T, const N: usize> ConstParamTy for [T; N]where\n T: ConstParamTy,
","ConstParamTy","iroh_docs::sync::PeerIdBytes"],["1.58.0 · source§impl<T, const N: usize> Copy for [T; N]where\n T: Copy,
","Copy","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Eq for [T; N]where\n T: Eq,
","Eq","iroh_docs::sync::PeerIdBytes"],["source§impl<T, const N: usize> StructuralPartialEq for [T; N]
","StructuralPartialEq","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> Unaligned for [T; N]where\n T: Unaligned,
","Unaligned","iroh_docs::sync::PeerIdBytes"],["§impl<Z, const N: usize> ZeroizeOnDrop for [Z; N]where\n Z: ZeroizeOnDrop,
Impl [ZeroizeOnDrop] on arrays of types that impl [ZeroizeOnDrop].
\n","ZeroizeOnDrop","iroh_docs::sync::PeerIdBytes"]]
+"iroh_docs":[["source§impl<T, const N: usize> [T; N]
1.55.0 · sourcepub fn map<F, U>(self, f: F) -> [U; N]where\n F: FnMut(T) -> U,
Returns an array of the same size as self, with function f applied to each element\nin order.
\nIf you don’t necessarily need a new fixed-size array, consider using\nIterator::map instead.
\n§Note on performance and stack usage
\nUnfortunately, usages of this method are currently not always optimized\nas well as they could be. This mainly concerns large arrays, as mapping\nover small arrays seem to be optimized just fine. Also note that in\ndebug mode (i.e. without any optimizations), this method can use a lot\nof stack space (a few times the size of the array or more).
\nTherefore, in performance-critical code, try to avoid using this method\non large arrays or check the emitted code. Also try to avoid chained\nmaps (e.g. arr.map(...).map(...)).
\nIn many cases, you can instead use Iterator::map by calling .iter()\nor .into_iter() on your array. [T; N]::map is only necessary if you\nreally need a new array of the same size as the result. Rust’s lazy\niterators tend to get optimized very well.
\n§Examples
\nlet x = [1, 2, 3];\nlet y = x.map(|v| v + 1);\nassert_eq!(y, [2, 3, 4]);\n\nlet x = [1, 2, 3];\nlet mut temp = 0;\nlet y = x.map(|v| { temp += 1; v * temp });\nassert_eq!(y, [1, 4, 9]);\n\nlet x = [\"Ferris\", \"Bueller's\", \"Day\", \"Off\"];\nlet y = x.map(|v| v.len());\nassert_eq!(y, [6, 9, 3, 3]);
\nsourcepub fn try_map<F, R>(\n self,\n f: F\n) -> <<R as Try>::Residual as Residual<[<R as Try>::Output; N]>>::TryType
🔬This is a nightly-only experimental API. (array_try_map)
A fallible function f applied to each element on array self in order to\nreturn an array the same size as self or the first error encountered.
\nThe return type of this function depends on the return type of the closure.\nIf you return Result<T, E> from the closure, you’ll get a Result<[T; N], E>.\nIf you return Option<T> from the closure, you’ll get an Option<[T; N]>.
\n§Examples
\n#![feature(array_try_map)]\n\nlet a = [\"1\", \"2\", \"3\"];\nlet b = a.try_map(|v| v.parse::<u32>()).unwrap().map(|v| v + 1);\nassert_eq!(b, [2, 3, 4]);\n\nlet a = [\"1\", \"2a\", \"3\"];\nlet b = a.try_map(|v| v.parse::<u32>());\nassert!(b.is_err());\n\nuse std::num::NonZero;\n\nlet z = [1, 2, 0, 3, 4];\nassert_eq!(z.try_map(NonZero::new), None);\n\nlet a = [1, 2, 3];\nlet b = a.try_map(NonZero::new);\nlet c = b.map(|x| x.map(NonZero::get));\nassert_eq!(c, Some(a));
\n1.57.0 (const: 1.57.0) · sourcepub const fn as_slice(&self) -> &[T]
Returns a slice containing the entire array. Equivalent to &s[..].
\n1.57.0 · sourcepub fn as_mut_slice(&mut self) -> &mut [T]
Returns a mutable slice containing the entire array. Equivalent to\n&mut s[..].
\n1.77.0 · sourcepub fn each_ref(&self) -> [&T; N]
Borrows each element and returns an array of references with the same\nsize as self.
\n§Example
\nlet floats = [3.1, 2.7, -1.0];\nlet float_refs: [&f64; 3] = floats.each_ref();\nassert_eq!(float_refs, [&3.1, &2.7, &-1.0]);
\nThis method is particularly useful if combined with other methods, like\nmap. This way, you can avoid moving the original\narray if its elements are not Copy.
\n\nlet strings = [\"Ferris\".to_string(), \"♥\".to_string(), \"Rust\".to_string()];\nlet is_ascii = strings.each_ref().map(|s| s.is_ascii());\nassert_eq!(is_ascii, [true, false, true]);\n\n// We can still access the original array: it has not been moved.\nassert_eq!(strings.len(), 3);
\n1.77.0 · sourcepub fn each_mut(&mut self) -> [&mut T; N]
Borrows each element mutably and returns an array of mutable references\nwith the same size as self.
\n§Example
\n\nlet mut floats = [3.1, 2.7, -1.0];\nlet float_refs: [&mut f64; 3] = floats.each_mut();\n*float_refs[0] = 0.0;\nassert_eq!(float_refs, [&mut 0.0, &mut 2.7, &mut -1.0]);\nassert_eq!(floats, [0.0, 2.7, -1.0]);
\nsourcepub fn split_array_ref<const M: usize>(&self) -> (&[T; M], &[T])
🔬This is a nightly-only experimental API. (split_array)
Divides one array reference into two at an index.
\nThe first will contain all indices from [0, M) (excluding\nthe index M itself) and the second will contain all\nindices from [M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet v = [1, 2, 3, 4, 5, 6];\n\n{\n let (left, right) = v.split_array_ref::<0>();\n assert_eq!(left, &[]);\n assert_eq!(right, &[1, 2, 3, 4, 5, 6]);\n}\n\n{\n let (left, right) = v.split_array_ref::<2>();\n assert_eq!(left, &[1, 2]);\n assert_eq!(right, &[3, 4, 5, 6]);\n}\n\n{\n let (left, right) = v.split_array_ref::<6>();\n assert_eq!(left, &[1, 2, 3, 4, 5, 6]);\n assert_eq!(right, &[]);\n}
\nsourcepub fn split_array_mut<const M: usize>(&mut self) -> (&mut [T; M], &mut [T])
🔬This is a nightly-only experimental API. (split_array)
Divides one mutable array reference into two at an index.
\nThe first will contain all indices from [0, M) (excluding\nthe index M itself) and the second will contain all\nindices from [M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet mut v = [1, 0, 3, 0, 5, 6];\nlet (left, right) = v.split_array_mut::<2>();\nassert_eq!(left, &mut [1, 0][..]);\nassert_eq!(right, &mut [3, 0, 5, 6]);\nleft[1] = 2;\nright[1] = 4;\nassert_eq!(v, [1, 2, 3, 4, 5, 6]);
\nsourcepub fn rsplit_array_ref<const M: usize>(&self) -> (&[T], &[T; M])
🔬This is a nightly-only experimental API. (split_array)
Divides one array reference into two at an index from the end.
\nThe first will contain all indices from [0, N - M) (excluding\nthe index N - M itself) and the second will contain all\nindices from [N - M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet v = [1, 2, 3, 4, 5, 6];\n\n{\n let (left, right) = v.rsplit_array_ref::<0>();\n assert_eq!(left, &[1, 2, 3, 4, 5, 6]);\n assert_eq!(right, &[]);\n}\n\n{\n let (left, right) = v.rsplit_array_ref::<2>();\n assert_eq!(left, &[1, 2, 3, 4]);\n assert_eq!(right, &[5, 6]);\n}\n\n{\n let (left, right) = v.rsplit_array_ref::<6>();\n assert_eq!(left, &[]);\n assert_eq!(right, &[1, 2, 3, 4, 5, 6]);\n}
\nsourcepub fn rsplit_array_mut<const M: usize>(&mut self) -> (&mut [T], &mut [T; M])
🔬This is a nightly-only experimental API. (split_array)
Divides one mutable array reference into two at an index from the end.
\nThe first will contain all indices from [0, N - M) (excluding\nthe index N - M itself) and the second will contain all\nindices from [N - M, N) (excluding the index N itself).
\n§Panics
\nPanics if M > N.
\n§Examples
\n#![feature(split_array)]\n\nlet mut v = [1, 0, 3, 0, 5, 6];\nlet (left, right) = v.rsplit_array_mut::<4>();\nassert_eq!(left, &mut [1, 0]);\nassert_eq!(right, &mut [3, 0, 5, 6][..]);\nleft[1] = 2;\nright[1] = 4;\nassert_eq!(v, [1, 2, 3, 4, 5, 6]);
\n",0,"iroh_docs::sync::PeerIdBytes"],["source§impl<const N: usize> [u8; N]
sourcepub const fn as_ascii(&self) -> Option<&[AsciiChar; N]>
🔬This is a nightly-only experimental API. (ascii_char)
Converts this array of bytes into a array of ASCII characters,\nor returns None if any of the characters is non-ASCII.
\n§Examples
\n#![feature(ascii_char)]\n#![feature(const_option)]\n\nconst HEX_DIGITS: [std::ascii::Char; 16] =\n *b\"0123456789abcdef\".as_ascii().unwrap();\n\nassert_eq!(HEX_DIGITS[1].as_str(), \"1\");\nassert_eq!(HEX_DIGITS[10].as_str(), \"a\");
\nsourcepub const unsafe fn as_ascii_unchecked(&self) -> &[AsciiChar; N]
🔬This is a nightly-only experimental API. (ascii_char)
Converts this array of bytes into a array of ASCII characters,\nwithout checking whether they’re valid.
\n§Safety
\nEvery byte in the array must be in 0..=127, or else this is UB.
\n",0,"iroh_docs::sync::PeerIdBytes"],["§impl<T> Array for [T; 32]where\n T: Default,
§fn as_slice_mut(&mut self) -> &mut [T]
Gives a unique slice over the whole thing. Read more","Array","iroh_docs::sync::PeerIdBytes"],["","Array","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> AsBytes for [T; N]where\n T: AsBytes,
§fn write_to_prefix(&self, bytes: &mut [u8]) -> Option<()>
","AsBytes","iroh_docs::sync::PeerIdBytes"],["","AsBytes","iroh_docs::sync::PeerIdBytes"],["","AsMut<[T]>","iroh_docs::sync::PeerIdBytes"],["","AsRef<[T]>","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> BitView for [T; N]where\n T: BitStore,
Note that overly-large arrays may cause the conversions to fail.
\n§fn view_bits<O>(&self) -> &BitSlice<T, O>where\n O: BitOrder,
Views a memory region as an immutable bit-slice.§fn try_view_bits<O>(&self) -> Result<&BitSlice<T, O>, BitSpanError<T>>where\n O: BitOrder,
Attempts to view a memory region as an immutable bit-slice. Read more§fn view_bits_mut<O>(&mut self) -> &mut BitSlice<T, O>where\n O: BitOrder,
Views a memory region as a mutable bit-slice.§fn try_view_bits_mut<O>(\n &mut self\n) -> Result<&mut BitSlice<T, O>, BitSpanError<T>>where\n O: BitOrder,
Attempts to view a memory region as a mutable bit-slice. Read more","BitView","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> BitViewSized for [T; N]where\n T: BitStore,
§fn as_raw_slice(&self) -> &[<[T; N] as BitView>::Store]
Views the type as a slice of its elements.§fn as_raw_mut_slice(&mut self) -> &mut [<[T; N] as BitView>::Store]
Views the type as a mutable slice of its elements.§fn into_bitarray<O>(self) -> BitArray<Self, O>where\n O: BitOrder,
Wraps self in a BitArray.","BitViewSized","iroh_docs::sync::PeerIdBytes"],["","Borrow<[T]>","iroh_docs::sync::PeerIdBytes"],["1.4.0 · source§impl<T, const N: usize> BorrowMut<[T]> for [T; N]
source§fn borrow_mut(&mut self) -> &mut [T]
Mutably borrows from an owned value. Read more","BorrowMut<[T]>","iroh_docs::sync::PeerIdBytes"],["","Chain","iroh_docs::sync::PeerIdBytes"],["","Clone","iroh_docs::sync::PeerIdBytes"],["","Debug","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize> Decode for [u8; N]
Decodes a byte array from byte[n] as described in RFC4251 § 5:
\n\nA byte represents an arbitrary 8-bit value (octet). Fixed length\ndata is sometimes represented as an array of bytes, written\nbyte[n], where n is the number of bytes in the array.
\n
\n","Decode","iroh_docs::sync::PeerIdBytes"],["§impl<'a, T, const N: usize> DecodeValue<'a> for [T; N]where\n T: Decode<'a>,
§fn decode_value<R>(reader: &mut R, header: Header) -> Result<[T; N], Error>where\n R: Reader<'a>,
Attempt to decode this message using the provided [Reader].","DecodeValue<'a>","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["","Default","iroh_docs::sync::PeerIdBytes"],["source§impl<'de, T> Deserialize<'de> for [T; 32]where\n T: Deserialize<'de>,
source§fn deserialize<D>(\n deserializer: D\n) -> Result<[T; 32], <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more","Deserialize<'de>","iroh_docs::sync::PeerIdBytes"],["source§impl<'de, const N: usize> Deserialize<'de> for [u8; N]
source§fn deserialize<D>(\n deserializer: D\n) -> Result<[u8; N], <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
","Deserialize<'de>","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize> Encode for [u8; N]
Encodes [u8; N] into byte[n] as described in RFC4251 § 5:
\n\nA byte represents an arbitrary 8-bit value (octet). Fixed length\ndata is sometimes represented as an array of bytes, written\nbyte[n], where n is the number of bytes in the array.
\n
\n§fn encoded_len(&self) -> Result<usize, Error>
Get the length of this type encoded in bytes, prior to Base64 encoding.§fn encode(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value using the provided [Writer].§fn encoded_len_prefixed(&self) -> Result<usize, Error>
Return the length of this type after encoding when prepended with a\nuint32 length prefix.§fn encode_prefixed(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value, first prepending a uint32 length prefix\nset to [Encode::encoded_len].","Encode","iroh_docs::sync::PeerIdBytes"],["","EncodeLabelSet","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> EncodeValue for [T; N]where\n T: Encode,
","EncodeValue","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["","Fill","iroh_docs::sync::PeerIdBytes"],["§impl<'a> FindToken<&'a u8> for [u8; 32]
§fn find_token(&self, token: &u8) -> bool
Returns true if self contains the token","FindToken<&'a u8>","iroh_docs::sync::PeerIdBytes"],["§impl FindToken<u8> for [u8; 32]
§fn find_token(&self, token: u8) -> bool
Returns true if self contains the token","FindToken","iroh_docs::sync::PeerIdBytes"],["","FixedTag","iroh_docs::sync::PeerIdBytes"],["","From<&Signature>","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["§impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>>> for [T; 32]
","From, B0>, B0>, B0>, B0>, B0>>>","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["","From>","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["source§impl From<NamespaceId> for [u8; 32]
source§fn from(value: NamespaceId) -> Self
Converts to this type from the input type.","From","iroh_docs::sync::PeerIdBytes"],["","From","iroh_docs::sync::PeerIdBytes"],["","From>","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> FromBytes for [T; N]where\n T: FromBytes,
§fn slice_from_prefix(bytes: &[u8], count: usize) -> Option<(&[Self], &[u8])>where\n Self: Sized,
Interprets the prefix of the given bytes as a &[Self] with length\nequal to count without copying. Read more§fn slice_from_suffix(bytes: &[u8], count: usize) -> Option<(&[u8], &[Self])>where\n Self: Sized,
Interprets the suffix of the given bytes as a &[Self] with length\nequal to count without copying. Read more§fn read_from_prefix(bytes: &[u8]) -> Option<Self>where\n Self: Sized,
","FromBytes","iroh_docs::sync::PeerIdBytes"],["","FromHex","iroh_docs::sync::PeerIdBytes"],["","FromZeroes","iroh_docs::sync::PeerIdBytes"],["","Hash","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Hash for [T; N]where\n T: Hash,
The hash of an array is the same as that of the corresponding slice,\nas required by the Borrow implementation.
\n\nuse std::hash::BuildHasher;\n\nlet b = std::hash::RandomState::new();\nlet a: [u8; 3] = [0xa8, 0x3c, 0x09];\nlet s: &[u8] = &[0xa8, 0x3c, 0x09];\nassert_eq!(b.hash_one(a), b.hash_one(s));
\n","Hash","iroh_docs::sync::PeerIdBytes"],["","Index","iroh_docs::sync::PeerIdBytes"],["","IndexMut","iroh_docs::sync::PeerIdBytes"],["","InputLength","iroh_docs::sync::PeerIdBytes"],["1.53.0 · source§impl<T, const N: usize> IntoIterator for [T; N]
source§fn into_iter(self) -> <[T; N] as IntoIterator>::IntoIter
Creates a consuming iterator, that is, one that moves each value out of\nthe array (from start to end). The array cannot be used after calling\nthis unless T implements Copy, so the whole array is copied.
\nArrays have special behavior when calling .into_iter() prior to the\n2021 edition – see the array Editions section for more information.
\n","IntoIterator","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize> IntoResponse for [u8; N]
§fn into_response(self) -> Response<Body>
Create a response.","IntoResponse","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, const N: usize> Join for [Fut; N]where\n Fut: IntoFuture,
§type Output = [<Fut as IntoFuture>::Output; N]
The resulting output type.§type Future = Join<<Fut as IntoFuture>::IntoFuture, N>
The Future implementation returned by this method.","Join","iroh_docs::sync::PeerIdBytes"],["","Key","iroh_docs::sync::PeerIdBytes"],["§impl<T, const N: usize> MaxSize for [T; N]where\n T: MaxSize,
§const POSTCARD_MAX_SIZE: usize = _
The maximum possible size that the serialization of this\ntype can have, in bytes.","MaxSize","iroh_docs::sync::PeerIdBytes"],["","Merge","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Ord for [T; N]where\n T: Ord,
Implements comparison of arrays lexicographically.
\n1.21.0 · source§fn max(self, other: Self) -> Selfwhere\n Self: Sized,
Compares and returns the maximum of two values. Read more","Ord","iroh_docs::sync::PeerIdBytes"],["","PartialEq<&[U]>","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, U, const N: usize> PartialEq<&mut [U]> for [T; N]where\n T: PartialEq<U>,
","PartialEq<&mut [U]>","iroh_docs::sync::PeerIdBytes"],["","PartialEq<[U]>","iroh_docs::sync::PeerIdBytes"],["","PartialEq<[U; N]>","iroh_docs::sync::PeerIdBytes"],["","PartialEq","iroh_docs::sync::PeerIdBytes"],["§impl<A, B, const N: usize, const M: usize> PartialEq<Vec<A, N>> for [B; M]where\n A: PartialEq<B>,
","PartialEq>","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> PartialOrd for [T; N]where\n T: PartialOrd,
Implements comparison of arrays lexicographically.
\nsource§fn le(&self, other: &[T; N]) -> bool
This method tests less than or equal to (for self and other) and is used by the <=\noperator. Read more","PartialOrd","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, const N: usize> Race for [Fut; N]where\n Fut: IntoFuture,
§type Output = <Fut as IntoFuture>::Output
The resulting output type.§type Future = Race<<Fut as IntoFuture>::IntoFuture, N>
Which kind of future are we turning this into?","Race","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, T, E, const N: usize> RaceOk for [Fut; N]where\n Fut: IntoFuture<Output = Result<T, E>>,
§type Future = RaceOk<<Fut as IntoFuture>::IntoFuture, T, E, N>
Which kind of future are we turning this into?","RaceOk","iroh_docs::sync::PeerIdBytes"],["","Schema","iroh_docs::sync::PeerIdBytes"],["source§impl<T> Serialize for [T; 32]where\n T: 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","iroh_docs::sync::PeerIdBytes"],["source§impl<const N: usize> Serialize for [u8; N]
source§fn serialize<S>(\n &self,\n serializer: S\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where\n S: Serializer,
","Serialize","iroh_docs::sync::PeerIdBytes"],["1.51.0 · source§impl<T, const N: usize> SlicePattern for [T; N]
","SlicePattern","iroh_docs::sync::PeerIdBytes"],["1.34.0 · source§impl<T, const N: usize> TryFrom<&[T]> for [T; N]where\n T: Copy,
Tries to create an array [T; N] by copying from a slice &[T]. Succeeds if\nslice.len() == N.
\n\nlet bytes: [u8; 3] = [1, 0, 2];\n\nlet bytes_head: [u8; 2] = <[u8; 2]>::try_from(&bytes[0..2]).unwrap();\nassert_eq!(1, u16::from_le_bytes(bytes_head));\n\nlet bytes_tail: [u8; 2] = bytes[1..3].try_into().unwrap();\nassert_eq!(512, u16::from_le_bytes(bytes_tail));
\n§type Error = TryFromSliceError
The type returned in the event of a conversion error.","TryFrom<&[T]>","iroh_docs::sync::PeerIdBytes"],["1.59.0 · source§impl<T, const N: usize> TryFrom<&mut [T]> for [T; N]where\n T: Copy,
Tries to create an array [T; N] by copying from a mutable slice &mut [T].\nSucceeds if slice.len() == N.
\n\nlet mut bytes: [u8; 3] = [1, 0, 2];\n\nlet bytes_head: [u8; 2] = <[u8; 2]>::try_from(&mut bytes[0..2]).unwrap();\nassert_eq!(1, u16::from_le_bytes(bytes_head));\n\nlet bytes_tail: [u8; 2] = (&mut bytes[1..3]).try_into().unwrap();\nassert_eq!(512, u16::from_le_bytes(bytes_tail));
\n§type Error = TryFromSliceError
The type returned in the event of a conversion error.","TryFrom<&mut [T]>","iroh_docs::sync::PeerIdBytes"],["§impl<T, A, const N: usize> TryFrom<Vec<T, A>> for [T; N]where\n A: Allocator,
§fn try_from(vec: Vec<T, A>) -> Result<[T; N], Vec<T, A>>
Gets the entire contents of the Vec<T> as an array,\nif its size exactly matches that of the requested array.
\n§Examples
\nassert_eq!(vec![1, 2, 3].try_into(), Ok([1, 2, 3]));\nassert_eq!(<Vec<i32>>::new().try_into(), Ok([]));
\nIf the length doesn’t match, the input comes back in Err:
\n\nlet r: Result<[i32; 4], _> = (0..10).collect::<Vec<_>>().try_into();\nassert_eq!(r, Err(vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9]));
\nIf you’re fine with just getting a prefix of the Vec<T>,\nyou can call .truncate(N) first.
\n\nlet mut v = String::from(\"hello world\").into_bytes();\nv.sort();\nv.truncate(2);\nlet [a, b]: [_; 2] = v.try_into().unwrap();\nassert_eq!(a, b' ');\nassert_eq!(b, b'd');
\n","TryFrom>","iroh_docs::sync::PeerIdBytes"],["1.48.0 · source§impl<T, A, const N: usize> TryFrom<Vec<T, A>> for [T; N]where\n A: Allocator,
source§fn try_from(vec: Vec<T, A>) -> Result<[T; N], Vec<T, A>>
Gets the entire contents of the Vec<T> as an array,\nif its size exactly matches that of the requested array.
\n§Examples
\nassert_eq!(vec![1, 2, 3].try_into(), Ok([1, 2, 3]));\nassert_eq!(<Vec<i32>>::new().try_into(), Ok([]));
\nIf the length doesn’t match, the input comes back in Err:
\n\nlet r: Result<[i32; 4], _> = (0..10).collect::<Vec<_>>().try_into();\nassert_eq!(r, Err(vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9]));
\nIf you’re fine with just getting a prefix of the Vec<T>,\nyou can call .truncate(N) first.
\n\nlet mut v = String::from(\"hello world\").into_bytes();\nv.sort();\nv.truncate(2);\nlet [a, b]: [_; 2] = v.try_into().unwrap();\nassert_eq!(a, b' ');\nassert_eq!(b, b'd');
\n","TryFrom>","iroh_docs::sync::PeerIdBytes"],["§impl<Fut, T, E, const N: usize> TryJoin for [Fut; N]where\n Fut: IntoFuture<Output = Result<T, E>>,
§type Future = TryJoin<<Fut as IntoFuture>::IntoFuture, T, E, N>
Which kind of future are we turning this into?","TryJoin","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> Value for [T; N]where\n T: Value,
§type SelfType<'a> = [<T as Value>::SelfType<'a>; N]\nwhere\n [T; N]: 'a
SelfType<’a> must be the same type as Self with all lifetimes replaced with ’a§type AsBytes<'a> = Vec<u8>\nwhere\n [T; N]: 'a
§fn fixed_width() -> Option<usize>
Width of a fixed type, or None for variable width§fn from_bytes<'a>(data: &'a [u8]) -> [<T as Value>::SelfType<'a>; N]where\n [T; N]: 'a,
Deserializes data\nImplementations may return a view over data, or an owned type","Value","iroh_docs::sync::PeerIdBytes"],["","ValueOrd","iroh_docs::sync::PeerIdBytes"],["§impl<Z, const N: usize> Zeroize for [Z; N]where\n Z: Zeroize,
Impl [Zeroize] on arrays of types that impl [Zeroize].
\n","Zeroize","iroh_docs::sync::PeerIdBytes"],["","Zip","iroh_docs::sync::PeerIdBytes"],["source§impl<T, const N: usize> ConstParamTy for [T; N]where\n T: ConstParamTy,
","ConstParamTy","iroh_docs::sync::PeerIdBytes"],["1.58.0 · source§impl<T, const N: usize> Copy for [T; N]where\n T: Copy,
","Copy","iroh_docs::sync::PeerIdBytes"],["1.0.0 · source§impl<T, const N: usize> Eq for [T; N]where\n T: Eq,
","Eq","iroh_docs::sync::PeerIdBytes"],["source§impl<T, const N: usize> StructuralPartialEq for [T; N]
","StructuralPartialEq","iroh_docs::sync::PeerIdBytes"],["§impl<const N: usize, T> Unaligned for [T; N]where\n T: Unaligned,
","Unaligned","iroh_docs::sync::PeerIdBytes"],["§impl<Z, const N: usize> ZeroizeOnDrop for [Z; N]where\n Z: ZeroizeOnDrop,
Impl [ZeroizeOnDrop] on arrays of types that impl [ZeroizeOnDrop].
\n","ZeroizeOnDrop","iroh_docs::sync::PeerIdBytes"]]
};if (window.register_type_impls) {window.register_type_impls(type_impls);} else {window.pending_type_impls = type_impls;}})()
\ No newline at end of file