pub struct ContentHashesIterator { /* private fields */ }
Expand description
Iterator for all content hashes
+pub struct ContentHashesIterator { /* private fields */ }
Source§impl<I> IteratorRandom for Iwhere
+ I: Iterator,
impl<I> IteratorRandom for Iwhere
+ I: Iterator,
Source§fn choose_stable<R>(self, rng: &mut R) -> Option<Self::Item>
fn choose_stable<R>(self, rng: &mut R) -> Option<Self::Item>
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<S, T> ProgressIterator for Twhere
T: Iterator<Item = S>,
impl<S, T> ProgressIterator for Twhere
T: Iterator<Item = S>,
§fn progress_with(self, progress: ProgressBar) -> ProgressBarIter<T>
fn progress_with(self, progress: ProgressBar) -> ProgressBarIter<T>
§fn try_progress(self) -> Option<ProgressBarIter<Self>>
fn try_progress(self) -> Option<ProgressBarIter<Self>>
Iterator::size_hint()
to get length.
Returns Some(..)
only if size_hint.1
is Some
. If you want to create a progress bar
even if size_hint.1
returns None
use progress_count()
diff --git a/pr/35/docs/iroh_docs/store/fs/struct.LatestIterator.html b/pr/35/docs/iroh_docs/store/fs/struct.LatestIterator.html
index a177167..9c7d8ed 100644
--- a/pr/35/docs/iroh_docs/store/fs/struct.LatestIterator.html
+++ b/pr/35/docs/iroh_docs/store/fs/struct.LatestIterator.html
@@ -1,4 +1,4 @@
-pub struct LatestIterator<'a>(/* private fields */);
Expand description
Iterator over the latest entry per author.
+pub struct LatestIterator<'a>(/* private fields */);
Expand description
Iterator over the latest entry per author.
Trait Implementations§
Source§impl<'a> Debug for LatestIterator<'a>
impl<'a> Debug for LatestIterator<'a>
Source§impl Iterator for LatestIterator<'_>
impl Iterator for LatestIterator<'_>
Source§type Item = Result<(AuthorId, u64, Vec<u8>), Error>
type Item = Result<(AuthorId, u64, Vec<u8>), Error>
Source§fn next(&mut self) -> Option<Self::Item>
fn next(&mut self) -> Option<Self::Item>
Source§fn next_chunk<const N: usize>(
&mut self,
) -> Result<[Self::Item; N], IntoIter<Self::Item, N>>
fn next_chunk<const N: usize>( &mut self, ) -> Result<[Self::Item; N], IntoIter<Self::Item, N>>
Source§impl<I> IteratorRandom for Iwhere
+ I: Iterator,
impl<I> IteratorRandom for Iwhere
+ I: Iterator,
Source§fn choose_stable<R>(self, rng: &mut R) -> Option<Self::Item>
fn choose_stable<R>(self, rng: &mut R) -> Option<Self::Item>
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<S, T> ProgressIterator for Twhere
T: Iterator<Item = S>,
impl<S, T> ProgressIterator for Twhere
T: Iterator<Item = S>,
§fn progress_with(self, progress: ProgressBar) -> ProgressBarIter<T>
fn progress_with(self, progress: ProgressBar) -> ProgressBarIter<T>
§fn try_progress(self) -> Option<ProgressBarIter<Self>>
fn try_progress(self) -> Option<ProgressBarIter<Self>>
Iterator::size_hint()
to get length.
Returns Some(..)
only if size_hint.1
is Some
. If you want to create a progress bar
even if size_hint.1
returns None
use progress_count()
diff --git a/pr/35/docs/iroh_docs/store/fs/struct.ParentIterator.html b/pr/35/docs/iroh_docs/store/fs/struct.ParentIterator.html
index 937701b..efa12ae 100644
--- a/pr/35/docs/iroh_docs/store/fs/struct.ParentIterator.html
+++ b/pr/35/docs/iroh_docs/store/fs/struct.ParentIterator.html
@@ -1,4 +1,4 @@
-pub struct ParentIterator { /* private fields */ }
Expand description
Iterator over parent entries, i.e. entries with the same namespace and author, and a key which +
pub struct ParentIterator { /* private fields */ }
Expand description
Iterator over parent entries, i.e. entries with the same namespace and author, and a key which is a prefix of the key passed to the iterator.
Trait Implementations§
Source§impl Debug for ParentIterator
impl Debug for ParentIterator
Source§impl Iterator for ParentIterator
impl Iterator for ParentIterator
Source§impl<I> IteratorRandom for Iwhere
+ I: Iterator,
impl<I> IteratorRandom for Iwhere
+ I: Iterator,
Source§fn choose_stable<R>(self, rng: &mut R) -> Option<Self::Item>
fn choose_stable<R>(self, rng: &mut R) -> Option<Self::Item>
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<S, T> ProgressIterator for Twhere
T: Iterator<Item = S>,
impl<S, T> ProgressIterator for Twhere
T: Iterator<Item = S>,
§fn progress_with(self, progress: ProgressBar) -> ProgressBarIter<T>
fn progress_with(self, progress: ProgressBar) -> ProgressBarIter<T>
§fn try_progress(self) -> Option<ProgressBarIter<Self>>
fn try_progress(self) -> Option<ProgressBarIter<Self>>
Iterator::size_hint()
to get length.
Returns Some(..)
only if size_hint.1
is Some
. If you want to create a progress bar
even if size_hint.1
returns None
use progress_count()
diff --git a/pr/35/docs/iroh_docs/store/fs/struct.RecordsRange.html b/pr/35/docs/iroh_docs/store/fs/struct.RecordsRange.html
index e0f213c..ac6b8bb 100644
--- a/pr/35/docs/iroh_docs/store/fs/struct.RecordsRange.html
+++ b/pr/35/docs/iroh_docs/store/fs/struct.RecordsRange.html
@@ -1,4 +1,4 @@
-pub struct RecordsRange<'a>(/* private fields */);
Expand description
An iterator over a range of entries from the records table.
+pub struct RecordsRange<'a>(/* private fields */);
Expand description
An iterator over a range of entries from the records table.
Trait Implementations§
Source§impl<'a> Debug for RecordsRange<'a>
impl<'a> Debug for RecordsRange<'a>
Source§impl Iterator for RecordsRange<'_>
impl Iterator for RecordsRange<'_>
Source§fn next(&mut self) -> Option<Self::Item>
fn next(&mut self) -> Option<Self::Item>
Source§fn next_chunk<const N: usize>(
&mut self,
) -> Result<[Self::Item; N], IntoIter<Self::Item, N>>
fn next_chunk<const N: usize>( &mut self, ) -> Result<[Self::Item; N], IntoIter<Self::Item, N>>
Source§impl<I> IteratorRandom for Iwhere
+ I: Iterator,
impl<I> IteratorRandom for Iwhere
+ I: Iterator,
Source§fn choose_stable<R>(self, rng: &mut R) -> Option<Self::Item>
fn choose_stable<R>(self, rng: &mut R) -> Option<Self::Item>
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<S, T> ProgressIterator for Twhere
T: Iterator<Item = S>,
impl<S, T> ProgressIterator for Twhere
T: Iterator<Item = S>,
§fn progress_with(self, progress: ProgressBar) -> ProgressBarIter<T>
fn progress_with(self, progress: ProgressBar) -> ProgressBarIter<T>
§fn try_progress(self) -> Option<ProgressBarIter<Self>>
fn try_progress(self) -> Option<ProgressBarIter<Self>>
Iterator::size_hint()
to get length.
Returns Some(..)
only if size_hint.1
is Some
. If you want to create a progress bar
even if size_hint.1
returns None
use progress_count()
diff --git a/pr/35/docs/search-index.js b/pr/35/docs/search-index.js
index e73c9f7..3b36e5d 100644
--- a/pr/35/docs/search-index.js
+++ b/pr/35/docs/search-index.js
@@ -1,4 +1,4 @@
-var searchIndex = new Map(JSON.parse('[["iroh_docs",{"t":"SFFFFFFFFCNNNNNNNNNNNNNNNNNNNNNNOCNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNCNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNCCNNNONNNNCNNNNCNNNNNNNNNCCNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNFFFNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNONNNNNNNNNNNNNNNNNNNNNNOONOONNNNNNNNNNNNNNNNNPPFPPPGPGGPPPGPPPPPPPPPPPPPPGPPNNNNNCNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOGPPPPPPPNNNNNNNNNNNNNNNNNNNNNNNNNNNNOOOOOOPPPFGPFPPGPPPPGPPPFPGPNNNNNNNNNNNNNNNNNNNNNNONNNNNNNNNNNNNNNNNNNNNOHNNNNNNNNNNNNONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNOONNONNNNNNNONONNNNNNNNNNNNNNNNNNNNNNNNNNNOOOOOFONNNNNNNNOOOOOOOOOONNNNNNNNOOOOOOOONNNNNSPGGGPPPPPPGPPPPPPPFFNNNNNNNNNNNNNNNNNNNNNNNNOHNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNHNNNNNNNNNNNNNOONOONNNONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNOOOOOOOOOOOOOOOFFNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNGPPPPNNNCNNNNNNNNNNNNNNNNNNNCNNNNNNNCCPFPPPGPFGPNNNNNNNNNNNNONNNNNNNNOOONONNNNNPPPFPPPFFFFPFFGPPPGIPPPGPPPPGFPGPPNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNONNNNNNNNNNNNNNNNNNNNNNNNNONNNNNNOOONNNNNNONNNNNNNOONONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNOOOOOOOOOOOOOPPFFPPFFPPFFPPFFPPFFPPFFPPFFPPFFPPFFPPFFFFFPPFFPPFFPPPPFFPPFFFFPPFFPPPPFFFFPPFFPPFPPFFGGFPPPPFFPPFFFFPPFFPPFFPPFFPPPOOOOOOOOOOOOOOONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNOONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNOOOOOOOOOOOOOOOOOONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNOOOOONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNOOOOONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNOOOOOOOOOOOOOOONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNOONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNPPPGPPGKPPPPGFGPPGFPPPGPPPKFFFGGEPNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNCMNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNMNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNFFFFFFNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNFPGGGPPGIFPFGPGGPPPPSPPPIIPPFPFFPFFFPPFPPGPPNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNOONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNOOOOOOOOO","n":["ALPN","Author","AuthorHeads","AuthorId","AuthorPublicKey","DocTicket","NamespaceId","NamespacePublicKey","NamespaceSecret","actor","as_bytes","","","","as_ref","","","","borrow","","","","","","","borrow_mut","","","","","","","capability","cli","clone","","","","","","","clone_into","","","","","","","clone_to_uninit","","","","","","","cmp","","","","compare","","","","default","","","","deref","","","","","","","deref_mut","","","","","","","deserialize","","","","","","","drop","","","","","","","encode_hex","","encode_hex_upper","","engine","eq","","","","equivalent","","","","","","","","","","","","fmt","","","","","","","","","","","","","","fmt_short","","from","","","","","","","","","","","","","","","","","","","","","","","","","from_bytes","","","","","from_ref","","","","","","","from_str","","","","","","","hash","","","","id","","init","","","","","","","into","","","","","","","into_public_key","","metrics","net","new","","","nodes","partial_cmp","","","","protocol","public_key","","","","rpc","serialize","","","","","","","sign","","store","sync","to_bytes","","","","","to_owned","","","","","","","to_string","","","","","","","try_from","","","","","","","","","try_into","","","","","","","type_id","","","","","","","verify","","","","vzip","","","","","","","OpenOpts","OpenState","SyncHandle","borrow","","","borrow_mut","","","clone","","clone_into","","clone_to_uninit","","close","content_hashes","default","","delete_author","delete_prefix","deref","","","deref_mut","","","deserialize","drop","","","","drop_replica","eq","equivalent","","","export_author","export_secret_key","flush_store","fmt","","","from","","","from_ref","","get_download_policy","get_exact","get_many","get_state","get_sync_peers","handles","has_news_for_us","import_author","import_namespace","init","","","insert_local","insert_remote","into","","","list_authors","list_replicas","open","register_useful_peer","serialize","set_download_policy","set_sync","shutdown","spawn","subscribe","","","subscribers","sync","","","sync_initial_message","sync_process_message","to_owned","","try_from","","","try_into","","","type_id","","","unsubscribe","vzip","","","Author","Auto","ConsoleEnv","Content","Create","Del","DisplayContentMode","DlPolicy","DlPolicyCmd","DocCommands","Drop","Everything","Export","FetchKind","Get","","Hash","Import","Join","Key","Keys","Leave","List","Nothing","Set","","Share","ShortHash","Sorting","Switch","Watch","augment_subcommands","","augment_subcommands_for_update","","author","authors","borrow","","","","","","borrow_mut","","","","","","clone","","","","","","clone_into","","","","","","clone_to_uninit","","","","","","command","command_for_update","default","deref","","","","","","deref_mut","","","","","","doc","drop","","","","","","fmt","","","","","","","","for_cli","for_console","from","","","","","","from_arg_matches","","from_arg_matches_mut","","from_ref","","","","","","has_subcommand","","init","","","","","","into","","","","","","iroh_data_dir","run","to_owned","","","","","","to_possible_value","","","to_string","","try_from","","","","","","try_into","","","","","","type_id","","","","","","update_from_arg_matches","","update_from_arg_matches_mut","","value_variants","","","vzip","","","","","","doc","","except","kind","addr_options","author","","","","","desc","doc","","","","","","","","","","id","in_place","key","","","mode","","","no_prompt","out","path","prefix","","","","sort","switch","","ticket","value","AuthorCommands","Create","Default","Delete","Export","Import","List","Switch","augment_subcommands","augment_subcommands_for_update","borrow","borrow_mut","clone","clone_into","clone_to_uninit","command","command_for_update","deref","deref_mut","drop","fmt","from","from_arg_matches","from_arg_matches_mut","from_ref","has_subcommand","init","into","run","to_owned","try_from","try_into","type_id","update_from_arg_matches","update_from_arg_matches_mut","vzip","author","","","","switch","","Accept","Connect","ContentReady","DefaultAuthor","DefaultAuthorStorage","DirectJoin","Engine","InsertLocal","InsertRemote","LiveEvent","Mem","NeighborDown","NeighborUp","NewNeighbor","Origin","PendingContentReady","Persistent","Resync","SyncEvent","SyncFinished","SyncReason","SyncReport","blob_store","borrow","","","","","","borrow_mut","","","","","","clone","","","clone_into","","","clone_to_uninit","","","default_author","deref","","","","","","deref_mut","","","","","","deserialize","","","drop","","","","","","endpoint","entry_to_content_status","eq","","","equivalent","","","","","","","","","finished","fmt","","","","","","from","","","","","","from_ref","","","get","handle_connection","init","","","","","","into","","","","","","leave","load","","local_pool_handle","origin","peer","persist","protect_cb","result","serialize","","","set","shutdown","spawn","start_sync","started","subscribe","sync","to_owned","","","try_from","","","","","","try_into","","","","","","type_id","","","","","","vzip","","","","","","content_status","entry","","from","hash","Metrics","actor_tick_main","borrow","borrow_mut","clone","clone_into","clone_to_uninit","default","deref","deref_mut","doc_gossip_tick_actor","doc_gossip_tick_event","doc_gossip_tick_main","doc_gossip_tick_pending_join","doc_live_tick_actor","doc_live_tick_main","doc_live_tick_pending_downloads","doc_live_tick_replica_event","doc_live_tick_running_sync_accept","doc_live_tick_running_sync_connect","drop","fmt","from","from_ref","init","into","iter","name","new_entries_local","new_entries_local_size","new_entries_remote","new_entries_remote_size","sync_via_accept_failure","sync_via_accept_success","sync_via_connect_failure","sync_via_connect_success","to_owned","try_from","try_into","type_id","vzip","ALPN","Abort","AbortReason","AcceptError","AcceptOutcome","Allow","AlreadySyncing","Close","","Connect","","ConnectError","InternalServerError","NotFound","Open","Reject","RemoteAbort","Sync","","SyncFinished","Timings","borrow","","","","","","borrow_mut","","","","","","clone","","","","clone_into","","","","clone_to_uninit","","","","connect","connect_and_sync","default","deref","","","","","","deref_mut","","","","","","deserialize","drop","","","","","","eq","equivalent","","","fmt","","","","","","","","from","","","","","","from_ref","","","","handle_connection","init","","","","","","into","","","","","","namespace","","outcome","peer","","process","serialize","source","","timings","to_owned","","","","to_string","","try_from","","","","","","try_into","","","","","","type_id","","","","","","vzip","","","","","","error","","","","namespace","","","peer","","","","reason","error","","","Builder","Docs","accept","borrow","","borrow_mut","","client","clone","clone_into","clone_to_uninit","default","deref","","deref_mut","","drop","","fmt","","from","","from_ref","handle_rpc_request","init","","into","","memory","new","persistent","protect_cb","shutdown","spawn","to_owned","try_from","","try_into","","type_id","","vzip","","AddrInfoOptions","Addresses","Id","Relay","RelayAndAddresses","apply","borrow","borrow_mut","client","clone","clone_into","clone_to_uninit","default","deref","deref_mut","deserialize","drop","eq","equivalent","","","fmt","","from","from_ref","from_str","init","into","proto","serialize","to_owned","to_string","try_from","try_into","type_id","vzip","authors","docs","Accept","Client","Connect","DirectJoin","NewNeighbor","Origin","Resync","SyncEvent","SyncReason","SyncReport","borrow","borrow_mut","clone","clone_into","clone_to_uninit","create","default","delete","deref","deref_mut","drop","export","finished","fmt","from","from_ref","import","init","into","list","new","origin","peer","result","set_default","started","to_owned","try_from","try_into","type_id","vzip","Abort","Accept","AllDone","Client","Connect","ContentReady","DirectJoin","Doc","Entry","ExportFileOutcome","ExportFileProgress","Found","ImportFileOutcome","ImportFileProgress","ImportProgress","IngestDone","InsertLocal","InsertRemote","LiveEvent","MemClient","NeighborDown","NeighborUp","NewNeighbor","Origin","PendingContentReady","Progress","Read","Resync","ShareMode","SyncEvent","SyncFinished","SyncReason","SyncReport","Write","authors","borrow","","","","","","","","","borrow_mut","","","","","","","","","chain","","clone","","","","","","clone_into","","","","","","clone_to_uninit","","","","","","close","create","del","deref","","","","","","","","","deref_mut","","","","","","","","","deserialize","","","drop","","","","","","","","","drop_doc","eq","","","","equivalent","","","","","","","","","","","","export_file","finish","","finished","fmt","","","","","","","","","","","from","","","","","","","","","","from_ref","","","","","","from_str","get_download_policy","get_exact","get_many","get_one","get_sync_peers","hash","id","import","import_and_subscribe","import_file","import_namespace","init","","","","","","","","","into","","","","","","","","","into_stream","","key","leave","list","merge","","new","open","origin","path","peer","poll_next","","ratelimit_stream","","ratelimit_stream_with_jitter","","result","serialize","","","set_bytes","set_download_policy","set_hash","share","size","","start_sync","started","status","subscribe","to_owned","","","","","","to_string","","try_from","","","","","","","","","try_into","","","","","","","","","try_poll_next","","type_id","","","","","","","","","vzip","","","","","","","","","zip","","hash","id","","","key","name","offset","size","content_status","entry","","from","hash","AuthorCreate","","AuthorCreateRequest","AuthorCreateResponse","AuthorDelete","","AuthorDeleteRequest","AuthorDeleteResponse","AuthorExport","","AuthorExportRequest","AuthorExportResponse","AuthorGetDefault","","AuthorGetDefaultRequest","AuthorGetDefaultResponse","AuthorImport","","AuthorImportRequest","AuthorImportResponse","AuthorList","","AuthorListRequest","AuthorListResponse","AuthorSetDefault","","AuthorSetDefaultRequest","AuthorSetDefaultResponse","Close","","CloseRequest","CloseResponse","Create","","CreateRequest","CreateResponse","Del","","DelRequest","DelResponse","DocListRequest","DocSubscribeRequest","DocSubscribeResponse","Drop","","DropRequest","DropResponse","ExportFile","","ExportFileRequest","ExportFileResponse","Get","","GetDownloadPolicy","","GetDownloadPolicyRequest","GetDownloadPolicyResponse","GetExact","","GetExactRequest","GetExactResponse","GetManyRequest","GetManyResponse","GetSyncPeers","","GetSyncPeersRequest","GetSyncPeersResponse","Import","","ImportFile","","ImportFileRequest","ImportFileResponse","ImportRequest","ImportResponse","Leave","","LeaveRequest","LeaveResponse","List","","ListResponse","Open","","OpenRequest","OpenResponse","Request","Response","RpcService","Set","","SetDownloadPolicy","","SetDownloadPolicyRequest","SetDownloadPolicyResponse","SetHash","","SetHashRequest","SetHashResponse","SetRequest","SetResponse","Share","","ShareRequest","ShareResponse","StartSync","","StartSyncRequest","StartSyncResponse","Status","","StatusRequest","StatusResponse","StreamCreated","Subscribe","","addr_options","author","","","","","author_id","","","","","","","","","borrow","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","borrow_mut","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","capability","","clone","clone_into","clone_to_uninit","deref","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","deref_mut","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","deserialize","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","doc_id","","","","","","","","","","","","","","","","","","drop","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","entry","","","","event","fmt","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","from","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","from_ref","hash","id","","in_place","include_empty","init","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","into","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","key","","","","mode","","path","","peers","","policy","","prefix","query","removed","serialize","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","size","status","to_owned","to_string","","try_from","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","try_into","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","type_id","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","value","vzip","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Any","","Asc","AuthorFilter","AuthorKey","Desc","DownloadPolicy","DownloadPolicyStore","EverythingExcept","Exact","","","FilterKind","FlatQuery","ImportNamespaceOutcome","Inserted","KeyAuthor","KeyFilter","MemPublicKeyStore","NoChange","NotFound","NothingExcept","OpenError","Other","Prefix","","PublicKeyStore","Query","QueryBuilder","SingleLatestPerKeyQuery","SortBy","SortDirection","Store","Upgraded","all","author","","author_key","","borrow","","","","","","","","","","","","","borrow_mut","","","","","","","","","","","","","build","","clone","","","","","","","","","","","clone_into","","","","","","","","","","","clone_to_uninit","","","","","","","","","","","default","","","","","","","","","deref","","","","","","","","","","","","","deref_mut","","","","","","","","","","","","","deserialize","","","","","","","","","drop","","","","","","","","","","","","","eq","","","","equivalent","","","","","","","","","","","","fmt","","","","","","","","","","","","","","","from","","","","","","","","","","","","","","","","","","","from_ref","","","","","","","","","","","from_str","fs","get_download_policy","include_empty","init","","","","","","","","","","","","","into","","","","","","","","","","","","","key_exact","","key_prefix","","limit","","matches","","","","namespace_key","","offset","","public_key","","serialize","","","","","","","","","single_latest_per_key","sort_by","sort_direction","source","to_owned","","","","","","","","","","","to_string","","try_from","","","","","","","","","","","","","try_into","","","","","","","","","","","","","type_id","","","","","","","","","","","","","vzip","","","","","","","","","","","","","ContentHashesIterator","LatestIterator","ParentIterator","RecordsRange","Store","StoreInstance","all","as_mut","as_ref","borrow","","","","","","borrow_mut","","","","","","close_replica","content_hashes","delete_author","deref","","","","","","deref_mut","","","","","","drop","","","","","","","flush","fmt","","","","","","from","","","","","","get_author","get_download_policy","","","get_exact","get_latest_for_each_author","get_many","get_sync_peers","has_news_for_us","import_author","import_namespace","init","","","","","","into","","","","","","into_fallible","","","","into_iter","","","","list_authors","list_namespaces","load_replica_info","memory","new_author","new_replica","next","","","","open_replica","persistent","progress_with","","","","public_key","","register_useful_peer","remove_replica","set_download_policy","snapshot","snapshot_owned","transpose_into_fallible","","","","try_from","","","","","","try_into","","","","","","type_id","","","","","","vzip","","","","","","AuthorHeads","BadSignature","Capability","CapabilityError","CapabilityKind","Closed","Complete","ContentStatus","ContentStatusCallback","Entry","EntryIsEmpty","EntrySignature","Event","Incomplete","InsertError","InsertOrigin","InvalidEmptyEntry","InvalidNamespace","Local","LocalInsert","MAX_TIMESTAMP_FUTURE_SHIFT","Missing","NamespaceMismatch","NewerEntryExists","PeerIdBytes","ProtocolMessage","Read","","ReadOnly","","Record","RecordIdentifier","RemoteInsert","Replica","ReplicaInfo","SignedEntry","Store","Sync","SyncOutcome","TooFarInTheFuture","Validation","ValidationFailure","Write","","as_byte_tuple","as_bytes","as_ref","author","","author_bytes","borrow","","","","","","","","","","","","","","","","","","borrow_mut","","","","","","","","","","","","","","","","","","capability","clone","","","","","","","","","","","","clone_into","","","","","","","","","","","","clone_to_uninit","","","","","","","","","","","","closed","cmp","","","","compare","","","","content_hash","","","content_len","","","decode","default","","","delete_prefix","deref","","","","","","","","","","","","","","","","","","","","deref_mut","","","","","","","","","","","","","","","","","","deserialize","","","","","","","","drop","","","","","","","","","","","","","","","","","","empty","empty_current","encode","","encode_hex","encode_hex_upper","entry","eq","","","","","","","equivalent","","","","","","","","","","","","","","","","","","","","","fmt","","","","","","","","","","","","","","","","","","","","","","","from","","","","","","","","","","","","","","","","","","","","","","","from_entry","","from_iter","","from_parts","from_raw","from_ref","","","","","","","","","","","","get","has_news_for","hash_and_insert","heads_received","id","","","init","","","","","","","","","","","","","","","","","","insert","","insert_remote_entry","into","","","","","","","","","","","","","","","","","","is_empty","","iter","key","","","key_bytes","kind","len","merge","","merge_capability","namespace","","new","","","","","new_current","new_empty","num_recv","num_sent","partial_cmp","","","","raw","record","record_id","secret_key","","serialize","","","","","","","","set_content_status_callback","sign","signature","source","subscribe","subscribers_count","sync_initial_message","sync_process_message","timestamp","","","to_byte_tuple","to_owned","","","","","","","","","","","","to_string","","","","","to_vec","try_from","","","","","","","","","","","","","","","","","","","try_from_primitive","try_into","","","","","","","","","","","","","","","","","","type_id","","","","","","","","","","","","","","","","","","unsubscribe","validate_empty","","verify","","vzip","","","","","","","","","","","","","","","","","","entry","","from","namespace","","remote_content_status","should_download","from","remote_content_status"],"q":[[0,"iroh_docs"],[278,"iroh_docs::actor"],[376,"iroh_docs::cli"],[549,"iroh_docs::cli::DlPolicyCmd"],[553,"iroh_docs::cli::DocCommands"],[590,"iroh_docs::cli::authors"],[626,"iroh_docs::cli::authors::AuthorCommands"],[632,"iroh_docs::engine"],[788,"iroh_docs::engine::LiveEvent"],[793,"iroh_docs::metrics"],[834,"iroh_docs::net"],[976,"iroh_docs::net::AcceptError"],[988,"iroh_docs::net::ConnectError"],[991,"iroh_docs::protocol"],[1034,"iroh_docs::rpc"],[1070,"iroh_docs::rpc::client"],[1072,"iroh_docs::rpc::client::authors"],[1113,"iroh_docs::rpc::client::docs"],[1377,"iroh_docs::rpc::client::docs::ImportProgress"],[1385,"iroh_docs::rpc::client::docs::LiveEvent"],[1390,"iroh_docs::rpc::proto"],[2578,"iroh_docs::store"],[2920,"iroh_docs::store::fs"],[3058,"iroh_docs::sync"],[3559,"iroh_docs::sync::Event"],[3566,"iroh_docs::sync::InsertOrigin"],[3568,"iroh_docs::keys"],[3569,"iroh_docs::ticket"],[3570,"core::cmp"],[3571,"core::result"],[3572,"serde::de"],[3573,"core::iter::traits::collect"],[3574,"core::fmt"],[3575,"alloc::string"],[3576,"ed25519_dalek::signing"],[3577,"ed25519_dalek::verifying"],[3578,"iroh_base::ticket"],[3579,"ed25519_dalek::errors"],[3580,"core::hash"],[3581,"iroh_base::node_addr"],[3582,"alloc::vec"],[3583,"rand_core"],[3584,"core::marker"],[3585,"core::option"],[3586,"iroh_docs::store::pubkeys"],[3587,"serde::ser"],[3588,"ed25519"],[3589,"core::any"],[3590,"anyhow"],[3591,"bytes::bytes"],[3592,"async_channel"],[3593,"iroh_docs::heads"],[3594,"core::num::nonzero"],[3595,"iroh_blobs::hash"],[3596,"clap_builder::builder::command"],[3597,"std::path"],[3598,"clap_builder::parser::matches::arg_matches"],[3599,"clap_builder"],[3600,"iroh_blobs::rpc::client::blobs"],[3601,"clap_builder::builder::possible_value"],[3602,"iroh_blobs::store::traits"],[3603,"iroh_docs::engine::live"],[3604,"iroh_docs::engine::state"],[3605,"std::io::error"],[3606,"iroh::endpoint"],[3607,"iroh_blobs::util::local_pool"],[3608,"iroh_blobs::net_protocol"],[3609,"iroh_gossip::net"],[3610,"iroh_blobs::downloader"],[3611,"futures_core::stream"],[3612,"alloc::vec::into_iter"],[3613,"core::future::future"],[3614,"iroh_base::key"],[3615,"core::ops::function"],[3616,"core::error"],[3617,"futures_lite::future"],[3618,"core::clone"],[3619,"quic_rpc::server"],[3620,"quic_rpc"],[3621,"quic_rpc::client"],[3622,"futures_concurrency::stream::chain::tuple"],[3623,"futures_concurrency::stream::into_stream"],[3624,"core::convert"],[3625,"futures_concurrency::stream::merge::tuple"],[3626,"core::pin"],[3627,"core::task::wake"],[3628,"core::task::poll"],[3629,"governor::state::direct"],[3630,"governor::state"],[3631,"governor::state::direct::streams"],[3632,"governor::clock::with_std"],[3633,"governor::middleware"],[3634,"governor::jitter"],[3635,"futures_concurrency::stream::zip::tuple"],[3636,"serde_error"],[3637,"quic_rpc::pattern::try_server_streaming"],[3638,"core::default"],[3639,"redb::table"],[3640,"iroh_docs::store::fs::ranges"],[3641,"fallible_iterator"],[3642,"core::iter::traits::iterator"],[3643,"indicatif::progress_bar"],[3644,"indicatif::iter"],[3645,"core::ops::deref"],[3646,"alloc::collections::btree::map"],[3647,"num_enum"]],"i":"``````````bjln1100AdAf5Ah54321605432`21605432160543216054365436543654321605432160543216054321605434343`65436665554443332211660055443343211666600555544444433333321605216054321605436543102160543216054343``21026543`1043`216054310``21043216054321605432166055432160543216054316052160543```E`EbEh21021212111201121021022110122221112102102111111211121011210111121111100202011212102102101210HhH``0Hf0`0``0Hb1`Hd2322422210223`220202Gn`0421350421350421350421350421353350421350421350042135042213550004213513130421351304213504213503042135425250421350421350421351313425042135AOfAOh11AOjAOlAOnB@`B@bB@d054321B@fB@hB@jB@l4B@n6984:8564687655BA`BAb0;`Ij0000000000000000000000000000000000BAdBAfBAhBAjBAlBAnJd0Kn``Jb`11`Jl221`201`2`1IlJ`3512Jn14623014614614621462301462301461462302`1461114446661146230146230146021462301462302302113211460222122146146230146230146230146230BB`BBb11BBd`Ld000000000000000000000000000000000000000`Md```LjM`2Mb30`1132030``2LlLn5234105234103410341030`041052341052334105233333410552234105234103`4105234105235115103521410352410523410523410523410523BBfBBhBBjBBlBBn2130210BC`BCbBCd``N`0Nh10111101010101010111010111110110101010`Of000000`0000000000000000000`0000000``Jd`0Jb0`0``0Hn00000000000J`111111110001011111A@j40`4Kn4````1```100``004`01A@b5``1`50Id20A@`42AAfA@dAA`A@f7548632103175462075462075462045475486321075486321078675486321057420777444222000431977548663210754886321075462064444424554575486321075486321031245315590931313197864444204944754620767548632107548632103175486321075486321031BCfBChBCj2BCl212BB`BBb11BBdNjACb``10``10``10``10``10``10``10``10``10`````10``10``1010``10````10``1010````10``10`10`````1010``10````10``10``10``010ADdAGfAIfAIjAIlAInAF`AFdAFjAFnAHhAHlAI`AIbAJ`NlNjACbACdACfAChACjAClACnAD`ADbADdADfADhADjADlADnAE`AEbAEdAEfAEhAEjAElAEnAF`AFbAFdAAhAFfAFhAFjAFlAFnAG`AGbAGdAGfAGhAGjAGlAGnAH`AHbAHdAHfAHhAHjAHlAHnAI`AIbAIdAIfAIhAIjAIlAInAJ`NlNjACbACdACfAChACjAClACnAD`ADbADdADfADhADjADlADnAE`AEbAEdAEfAEhAEjAElAEnAF`AFbAFdAAhAFfAFhAFjAFlAFnAG`AGbAGdAGfAGhAGjAGlAGnAH`AHbAHdAHfAHhAHjAHlAHnAI`AIbAIdAIfAIhAIjAIlAInAJ`ACjAD`Nl000NjACbACdACfACh7AClACn8ADbADdADfADhADjADlADnAE`AEbAEdAEfAEhAEjAElAEnAF`AFbAFdAAhAFfAFhAFjAFlAFnAG`AGbAGdAGfAGhAGjAGlAGnAH`AHbAHdAHfAHhAHjAHlAHnAI`AIbAIdAIfAIhAIjAIlAInAJ`NlNjACbACdACfAChACjAClACnAD`ADbADdADfADhADjADlADnAE`AEbAEdAEfAEhAEjAElAEnAF`AFbAFdAAhAFfAFhAFjAFlAFnAG`AGbAGdAGfAGhAGjAGlAGnAH`AHbAHdAHfAHhAHjAHlAHnAI`AIbAIdAIfAIhAIjAIlAInAJ`NjACbACdACfAChACjAClACnAD`ADbADdADfADhADjADlADnAE`AEbAEdAEfAEhAEjAElAEnAF`AFbAFdAAhAFfAFhAFjAFlAFnAG`AGbAGdAGfAGhAGjAGlAGnAH`AHbAHdAHfAHhAHjAHlAHnAI`AIbAIdAIfAIhAIjAIlAInAJ`ACdADbADdADhADlAE`AEdAEhAElAF`AFdAFjAFnAGbAGfAGjAGnAHbNlNjACbACdACfAChACjAClACnAD`ADbADdADfADhADjADlADnAE`AEbAEdAEfAEhAEjAElAEnAF`AFbAFdAAhAFfAFhAFjAFlAFnAG`AGbAGdAGfAGhAGjAGlAGnAH`AHbAHdAHfAHhAHjAHlAHnAI`AIbAIdAIfAIhAIjAIlAInAJ`AFbAFfAGdAGhACfNlNj0ACb0ACd4AChACjAClACnAD`ADbADdADfADhADjADlADnAE`AEbAEdAEfAEhAEjAElAEnAF`AFbAFdAAhAFfAFhAFjAFlAFnAG`AGbAGdAGfAGhAGjAGlAGnAH`AHbAHdAHfAHhAHjAHlAHnAI`AIbAIdAIfAIhAIjAIlAInAJ`NlNj0000000000000000000000000000ACb00000000000000000000000000000ACdACfAChACjAClACnAD`ADbADdADfADhADjADlADnAE`AEbAEdAEfAEhAEjAElAEnAF`AFbAFdAAhAFfAFhAFjAFlAFnAG`AGbAGdAGfAGhAGjAGlAGnAH`AHbAHdAHfAHhAHjAHlAHnAI`AIbAIdAIfAIhAIjAIlAInAJ`NlAFnACjACnAFdAGf5NjACbACdACfACh8ACl8AD`ADbADdADfADhADjADlADnAE`AEbAEdAEfAEhAEjAElAEnAF`AFbAFdAAhAFfAFhAFjAFlAFnAG`AGbAGdAGfAGhAGjAGlAGnAH`AHbAHdAHfAHhAHjAHlAHnAI`AIbAIdAIfAIhAIjAIlAInAJ`NlNjACbACdACfAChACjAClACnAD`ADbADdADfADhADjADlADnAE`AEbAEdAEfAEhAEjAElAEnAF`AFbAFdAAhAFfAFhAFjAFlAFnAG`AGbAGdAGfAGhAGjAGlAGnAH`AHbAHdAHfAHhAHjAHlAHnAI`AIbAIdAIfAIhAIjAIlAInAJ`AF`AFdAFnAGfADdAFf40AEdAHdAGjAH`AFjAGbAFlNjACbACdACfAChACjAClACnAD`ADbADdADfADhADjADlADnAE`AEbAEdAEfAEhAEjAElAEnAF`AFbAFdAAhAFfAFhAFjAFlAFnAG`AGbAGdAGfAGhAGjAGlAGnAH`AHbAHdAHfAHhAHjAHlAHnAI`AIbAIdAIfAIhAIjAIlAInAJ`AFnADjNlNjACb210ACd00ACfACh00ACjACl00ACnAD`00ADbADd00ADfADh00>ADl00ADnAE`00AEbAEd00AEfAEh00AEjAEl00AEnAF`00AFbAFd00AAh00AFf00AFh00AFj00AFlAFn00AG`AGb00AGdAGf00AGhAGj00AGlAGn00AH`AHb00AHdAHf00AHhAHj00AHlAHn00AI`AIb00AIdAIf00AIhAIj00AIlAIn00AJ`NlNjACbACdACfAChACjAClACnAD`ADbADdADfADhADjADlADnAE`AEbAEdAEfAEhAEjAElAEnAF`AFbAFdAAhAFfAFhAFjAFlAFnAG`AGbAGdAGfAGhAGjAGlAGnAH`AHbAHdAHfAHhAHjAHlAHnAI`AIbAIdAIfAIhAIjAIlAInAJ`NlNjACbACdACfAChACjAClACnAD`ADbADdADfADhADjADlADnAE`AEbAEdAEfAEhAEjAElAEnAF`AFbAFdAAhAFfAFhAFjAFlAFnAG`AGbAGdAGfAGhAGjAGlAGnAH`AHbAHdAHfAHhAHjAHlAHnAI`AIbAIdAIfAIhAIjAIlAInAJ`AF`NlNjACbACdACfAChACjAClACnAD`ADbADdADfADhADjADlADnAE`AEbAEdAEfAEhAEjAElAEnAF`AFbAFdAAhAFfAFhAFjAFlAFnAG`AGbAGdAGfAGhAGjAGlAGnAH`AHbAHdAHfAHhAHjAHlAHnAI`AIbAIdAIfAIhAIjAIlAInAJ`AKfAKhAKb`AKd1``ElAK`54```AJn3``0AKl3`027```````1F`AJh1Dh0AJl45762AJfAJj5;:=<267984105;:=<442798105;:=<2798105;:=<2798105;:=<29410;:=<267984105;:=<267984105;:=<98105;:=<267984105;:=<98=<999888===<<<26679884105;:=<266798410555;::==<<2798105;:=<8`AL`5378:95216<;>=378:95216<;>=565656:9>=445643:9216<;>=655738:9216<;>=79378:95216<;>=378:95216<;>=378:95216<;>=378:95216<;>=``````EfGd0ALd1ALfALh4ALj342150444342150342150344215043421503421504442444444434215034215031503150444444315044315042444443150342150342150342150342150`ANn```ANhFn```1``0``22ANbGh`2ANj4``G`Cl`6``3```64`76`10AMj00A@l1En678Gj546AM`AMbANl=>4ANd67ANfFf=>?6;:<543ANhANn94:;326?ANbFn:?>;6<=54Gh21;G`Cl>9?AMj98354>21?:A@l1:9>En12;012;01;01;:Gj3;?687054ANjAM`AMbANl>=55ANd778ANfFf=?>7<;6543ANhANn:4;<32Fn?>;5<=4GhANb2Source§impl<T, const N: usize> [T; N]
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,
pub 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.
If you don’t necessarily need a new fixed-size array, consider using\nIterator::map
instead.
§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(...)
).
In 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.
§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]);
Sourcepub fn try_map<R>(\n self,\n f: impl FnMut(T) -> R,\n) -> <<R as Try>::Residual as Residual<[<R as Try>::Output; N]>>::TryType
🔬This is a nightly-only experimental API. (array_try_map
)
pub fn try_map<R>(\n self,\n f: impl FnMut(T) -> R,\n) -> <<R as Try>::Residual as Residual<[<R as Try>::Output; N]>>::TryType
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.
The 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]>
.
§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));
1.57.0 (const: 1.57.0) · Sourcepub const fn as_slice(&self) -> &[T]
pub const fn as_slice(&self) -> &[T]
Returns a slice containing the entire array. Equivalent to &s[..]
.
1.57.0 (const: unstable) · Sourcepub fn as_mut_slice(&mut self) -> &mut [T]
pub fn as_mut_slice(&mut self) -> &mut [T]
Returns a mutable slice containing the entire array. Equivalent to\n&mut s[..]
.
1.77.0 (const: unstable) · Sourcepub fn each_ref(&self) -> [&T; N]
pub fn each_ref(&self) -> [&T; N]
Borrows each element and returns an array of references with the same\nsize as self
.
§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]);
This 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
.
let 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);
1.77.0 (const: unstable) · Sourcepub fn each_mut(&mut self) -> [&mut T; N]
pub 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
.
§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]);
Sourcepub fn split_array_ref<const M: usize>(&self) -> (&[T; M], &[T])
🔬This is a nightly-only experimental API. (split_array
)
pub fn split_array_ref<const M: usize>(&self) -> (&[T; M], &[T])
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).
§Panics
\nPanics if M > 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}
Sourcepub fn split_array_mut<const M: usize>(&mut self) -> (&mut [T; M], &mut [T])
🔬This is a nightly-only experimental API. (split_array
)
pub fn split_array_mut<const M: usize>(&mut self) -> (&mut [T; M], &mut [T])
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).
§Panics
\nPanics if M > 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]);
Sourcepub fn rsplit_array_ref<const M: usize>(&self) -> (&[T], &[T; M])
🔬This is a nightly-only experimental API. (split_array
)
pub fn rsplit_array_ref<const M: usize>(&self) -> (&[T], &[T; M])
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).
§Panics
\nPanics if M > 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}
Sourcepub fn rsplit_array_mut<const M: usize>(&mut self) -> (&mut [T], &mut [T; M])
🔬This is a nightly-only experimental API. (split_array
)
pub fn rsplit_array_mut<const M: usize>(&mut self) -> (&mut [T], &mut [T; M])
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).
§Panics
\nPanics if M > 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]);
Source§impl<const N: usize> [u8; N]
impl<const N: usize> [u8; N]
Sourcepub const fn as_ascii(&self) -> Option<&[AsciiChar; N]>
🔬This is a nightly-only experimental API. (ascii_char
)
pub const fn as_ascii(&self) -> Option<&[AsciiChar; N]>
ascii_char
)Converts this array of bytes into an array of ASCII characters,\nor returns None
if any of the characters is non-ASCII.
§Examples
\n#![feature(ascii_char)]\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\");
Sourcepub const unsafe fn as_ascii_unchecked(&self) -> &[AsciiChar; N]
🔬This is a nightly-only experimental API. (ascii_char
)
pub const unsafe fn as_ascii_unchecked(&self) -> &[AsciiChar; N]
ascii_char
)Converts this array of bytes into an 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.
§impl<T> Array for [T; 32]where\n T: Default,
impl<T> Array for [T; 32]where\n T: Default,
§fn as_slice_mut(&mut self) -> &mut [T]
fn as_slice_mut(&mut self) -> &mut [T]
§impl<const N: usize, T> AsBytes for [T; N]where\n T: AsBytes,
impl<const N: usize, T> AsBytes for [T; N]where\n T: AsBytes,
§fn as_bytes_mut(&mut self) -> &mut [u8] ⓘwhere\n Self: FromBytes,
fn as_bytes_mut(&mut self) -> &mut [u8] ⓘwhere\n Self: FromBytes,
§fn write_to_prefix(&self, bytes: &mut [u8]) -> Option<()>
fn write_to_prefix(&self, bytes: &mut [u8]) -> Option<()>
1.4.0 · Source§impl<T, const N: usize> BorrowMut<[T]> for [T; N]
impl<T, const N: usize> BorrowMut<[T]> for [T; N]
Source§fn borrow_mut(&mut self) -> &mut [T]
fn borrow_mut(&mut self) -> &mut [T]
§impl<const N: usize> Decode for [u8; N]
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\n
\nbyte[n]
, where n is the number of bytes in the array.
§impl<'a, T, const N: usize> DecodeValue<'a> for [T; N]where\n T: Decode<'a>,
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>,
fn decode_value<R>(reader: &mut R, header: Header) -> Result<[T; N], Error>where\n R: Reader<'a>,
Reader
].Source§impl<'de, T> Deserialize<'de> for [T; 32]where\n T: Deserialize<'de>,
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>,
fn deserialize<D>(\n deserializer: D,\n) -> Result<[T; 32], <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
§impl<const N: usize> Encode for [u8; N]
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\n
\nbyte[n]
, where n is the number of bytes in the array.
§fn encoded_len(&self) -> Result<usize, Error>
fn encoded_len(&self) -> Result<usize, Error>
§fn encode(&self, writer: &mut impl Writer) -> Result<(), Error>
fn encode(&self, writer: &mut impl Writer) -> Result<(), Error>
Writer
].§fn encoded_len_prefixed(&self) -> Result<usize, Error>
fn encoded_len_prefixed(&self) -> Result<usize, Error>
uint32
length prefix.§fn encode_prefixed(&self, writer: &mut impl Writer) -> Result<(), Error>
fn encode_prefixed(&self, writer: &mut impl Writer) -> Result<(), Error>
uint32
length prefix\nset to [Encode::encoded_len
].§impl<T, const N: usize> EncodeValue for [T; N]where\n T: Encode,
impl<T, const N: usize> EncodeValue for [T; N]where\n T: Encode,
§impl<'a> FindToken<&'a u8> for [u8; 32]
impl<'a> FindToken<&'a u8> for [u8; 32]
§fn find_token(&self, token: &u8) -> bool
fn find_token(&self, token: &u8) -> bool
§impl FindToken<u8> for [u8; 32]
impl FindToken<u8> for [u8; 32]
§fn find_token(&self, token: u8) -> bool
fn find_token(&self, token: u8) -> bool
§impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>>> for [T; 32]
Available on relaxed_coherence
only.
impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>>> for [T; 32]
relaxed_coherence
only.Source§impl From<NamespaceId> for [u8; 32]
impl From<NamespaceId> for [u8; 32]
Source§fn from(value: NamespaceId) -> Self
fn from(value: NamespaceId) -> Self
§impl<const N: usize, T> FromBytes for [T; N]where\n T: FromBytes,
impl<const N: usize, T> FromBytes for [T; N]where\n T: FromBytes,
§fn ref_from_prefix(bytes: &[u8]) -> Option<&Self>where\n Self: Sized,
fn ref_from_prefix(bytes: &[u8]) -> Option<&Self>where\n Self: Sized,
§fn ref_from_suffix(bytes: &[u8]) -> Option<&Self>where\n Self: Sized,
fn ref_from_suffix(bytes: &[u8]) -> Option<&Self>where\n Self: Sized,
§fn mut_from_prefix(bytes: &mut [u8]) -> Option<&mut Self>where\n Self: Sized + AsBytes,
fn mut_from_prefix(bytes: &mut [u8]) -> Option<&mut Self>where\n Self: Sized + AsBytes,
§fn mut_from_suffix(bytes: &mut [u8]) -> Option<&mut Self>where\n Self: Sized + AsBytes,
fn mut_from_suffix(bytes: &mut [u8]) -> Option<&mut Self>where\n Self: Sized + AsBytes,
§fn slice_from(bytes: &[u8]) -> Option<&[Self]>where\n Self: Sized,
fn slice_from(bytes: &[u8]) -> Option<&[Self]>where\n Self: Sized,
§fn slice_from_prefix(bytes: &[u8], count: usize) -> Option<(&[Self], &[u8])>where\n Self: Sized,
fn slice_from_prefix(bytes: &[u8], count: usize) -> Option<(&[Self], &[u8])>where\n Self: Sized,
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,
fn slice_from_suffix(bytes: &[u8], count: usize) -> Option<(&[u8], &[Self])>where\n Self: Sized,
bytes
as a &[Self]
with length\nequal to count
without copying. Read more§fn mut_slice_from(bytes: &mut [u8]) -> Option<&mut [Self]>where\n Self: Sized + AsBytes,
fn mut_slice_from(bytes: &mut [u8]) -> Option<&mut [Self]>where\n Self: Sized + AsBytes,
§fn mut_slice_from_prefix(\n bytes: &mut [u8],\n count: usize,\n) -> Option<(&mut [Self], &mut [u8])>where\n Self: Sized + AsBytes,
fn mut_slice_from_prefix(\n bytes: &mut [u8],\n count: usize,\n) -> Option<(&mut [Self], &mut [u8])>where\n Self: Sized + AsBytes,
bytes
as a &mut [Self]
with length\nequal to count
without copying. Read more§fn mut_slice_from_suffix(\n bytes: &mut [u8],\n count: usize,\n) -> Option<(&mut [u8], &mut [Self])>where\n Self: Sized + AsBytes,
fn mut_slice_from_suffix(\n bytes: &mut [u8],\n count: usize,\n) -> Option<(&mut [u8], &mut [Self])>where\n Self: Sized + AsBytes,
bytes
as a &mut [Self]
with length\nequal to count
without copying. Read more§fn read_from_prefix(bytes: &[u8]) -> Option<Self>where\n Self: Sized,
fn read_from_prefix(bytes: &[u8]) -> Option<Self>where\n Self: Sized,
1.0.0 · Source§impl<T, const N: usize> Hash for [T; N]where\n T: Hash,
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.
use 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));
1.53.0 · Source§impl<T, const N: usize> IntoIterator for [T; N]
impl<T, const N: usize> IntoIterator for [T; N]
Source§fn into_iter(self) -> <[T; N] as IntoIterator>::IntoIter
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).
\nThe array cannot be used after calling this unless T
implements\nCopy
, so the whole array is copied.
Arrays have special behavior when calling .into_iter()
prior to the\n2021 edition – see the array Editions section for more information.
§impl<const N: usize> IntoResponse for [u8; N]
impl<const N: usize> IntoResponse for [u8; N]
§fn into_response(self) -> Response<Body>
fn into_response(self) -> Response<Body>
§impl<Fut, const N: usize> Join for [Fut; N]where\n Fut: IntoFuture,
impl<Fut, const N: usize> Join for [Fut; N]where\n Fut: IntoFuture,
§type Output = [<Fut as IntoFuture>::Output; N]
type Output = [<Fut as IntoFuture>::Output; N]
§type Future = Join<<Fut as IntoFuture>::IntoFuture, N>
type Future = Join<<Fut as IntoFuture>::IntoFuture, N>
Future
implementation returned by this method.§impl<T, const N: usize> MaxSize for [T; N]where\n T: MaxSize,
impl<T, const N: usize> MaxSize for [T; N]where\n T: MaxSize,
§const POSTCARD_MAX_SIZE: usize = _
const POSTCARD_MAX_SIZE: usize = _
1.0.0 · Source§impl<T, const N: usize> Ord for [T; N]where\n T: Ord,
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,
fn max(self, other: Self) -> Selfwhere\n Self: Sized,
1.0.0 · Source§impl<T, const N: usize> PartialOrd for [T; N]where\n T: PartialOrd,
impl<T, const N: usize> PartialOrd for [T; N]where\n T: PartialOrd,
Implements comparison of arrays lexicographically.
\n§impl<Fut, const N: usize> Race for [Fut; N]where\n Fut: IntoFuture,
impl<Fut, const N: usize> Race for [Fut; N]where\n Fut: IntoFuture,
§type Output = <Fut as IntoFuture>::Output
type Output = <Fut as IntoFuture>::Output
§type Future = Race<<Fut as IntoFuture>::IntoFuture, N>
type Future = Race<<Fut as IntoFuture>::IntoFuture, N>
§impl<Fut, T, E, const N: usize> RaceOk for [Fut; N]where\n Fut: IntoFuture<Output = Result<T, E>>,
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>
type Future = RaceOk<<Fut as IntoFuture>::IntoFuture, T, E, N>
Source§impl<T> Serialize for [T; 32]where\n T: Serialize,
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,
fn serialize<S>(\n &self,\n serializer: S,\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where\n S: Serializer,
1.51.0 · Source§impl<T, const N: usize> SlicePattern for [T; N]
impl<T, const N: usize> SlicePattern for [T; N]
1.34.0 · Source§impl<T, const N: usize> TryFrom<&[T]> for [T; N]where\n T: Copy,
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]
.\nSucceeds if slice.len() == N
.
let 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));
1.59.0 · Source§impl<T, const N: usize> TryFrom<&mut [T]> for [T; N]where\n T: Copy,
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
.
let 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));
§impl<T, A, const N: usize> TryFrom<Vec<T, A>> for [T; N]where\n A: Allocator,
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>>
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.
§Examples
\nassert_eq!(vec![1, 2, 3].try_into(), Ok([1, 2, 3]));\nassert_eq!(<Vec<i32>>::new().try_into(), Ok([]));
If the length doesn’t match, the input comes back in Err
:
let 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]));
If you’re fine with just getting a prefix of the Vec<T>
,\nyou can call .truncate(N)
first.
let 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');
1.48.0 · Source§impl<T, A, const N: usize> TryFrom<Vec<T, A>> for [T; N]where\n A: Allocator,
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>>
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.
§Examples
\nassert_eq!(vec![1, 2, 3].try_into(), Ok([1, 2, 3]));\nassert_eq!(<Vec<i32>>::new().try_into(), Ok([]));
If the length doesn’t match, the input comes back in Err
:
let 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]));
If you’re fine with just getting a prefix of the Vec<T>
,\nyou can call .truncate(N)
first.
let 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');
§impl<Fut, T, E, const N: usize> TryJoin for [Fut; N]where\n Fut: IntoFuture<Output = Result<T, E>>,
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>
type Future = TryJoin<<Fut as IntoFuture>::IntoFuture, T, E, N>
§impl<T, const N: usize> ULE for [T; N]where\n T: ULE,
impl<T, const N: usize> ULE for [T; N]where\n T: ULE,
§fn validate_byte_slice(bytes: &[u8]) -> Result<(), ZeroVecError>
fn validate_byte_slice(bytes: &[u8]) -> Result<(), ZeroVecError>
&[u8]
. Read more§fn parse_byte_slice(bytes: &[u8]) -> Result<&[Self], ZeroVecError>
fn parse_byte_slice(bytes: &[u8]) -> Result<&[Self], ZeroVecError>
§unsafe fn from_byte_slice_unchecked(bytes: &[u8]) -> &[Self]
unsafe fn from_byte_slice_unchecked(bytes: &[u8]) -> &[Self]
&[u8]
, and return it as &[Self]
with the same lifetime, assuming\nthat this byte slice has previously been run through [Self::parse_byte_slice()
] with\nsuccess. Read more§fn as_byte_slice(slice: &[Self]) -> &[u8] ⓘ
fn as_byte_slice(slice: &[Self]) -> &[u8] ⓘ
§impl<const N: usize, T> Value for [T; N]where\n T: Value,
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
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 ’atype AsBytes<'a> = Vec<u8>\nwhere\n [T; N]: 'a
§fn fixed_width() -> Option<usize>
fn fixed_width() -> Option<usize>
§fn from_bytes<'a>(data: &'a [u8]) -> [<T as Value>::SelfType<'a>; N]where\n [T; N]: 'a,
fn from_bytes<'a>(data: &'a [u8]) -> [<T as Value>::SelfType<'a>; N]where\n [T; N]: 'a,
§impl<'a, T, const N: usize> Yokeable<'a> for [T; N]where\n T: 'static + for<'b> Yokeable<'b>,
impl<'a, T, const N: usize> Yokeable<'a> for [T; N]where\n T: 'static + for<'b> Yokeable<'b>,
§type Output = [<T as Yokeable<'a>>::Output; N]
type Output = [<T as Yokeable<'a>>::Output; N]
Self
with the 'static
replaced with 'a
, i.e. Self<'a>
§fn transform_owned(self) -> <[T; N] as Yokeable<'a>>::Output
fn transform_owned(self) -> <[T; N] as Yokeable<'a>>::Output
§unsafe fn make(from: <[T; N] as Yokeable<'a>>::Output) -> [T; N]
unsafe fn make(from: <[T; N] as Yokeable<'a>>::Output) -> [T; N]
Self<'a>
’s lifetime. Read more§fn transform_mut<F>(&'a mut self, f: F)
fn transform_mut<F>(&'a mut self, f: F)
self
between &'a mut Self<'static>
and &'a mut Self<'a>
,\nand pass it to f
. Read more§impl<'a, T, const N: usize> ZeroMapKV<'a> for [T; N]where\n T: AsULE + 'static,
impl<'a, T, const N: usize> ZeroMapKV<'a> for [T; N]where\n T: AsULE + 'static,
§impl<Z, const N: usize> Zeroize for [Z; N]where\n Z: Zeroize,
impl<Z, const N: usize> Zeroize for [Z; N]where\n Z: Zeroize,
Impl [Zeroize
] on arrays of types that impl [Zeroize
].
impl<T, const N: usize> ConstParamTy_ for [T; N]where\n T: ConstParamTy_,
impl<T, const N: usize> Copy for [T; N]where\n T: Copy,
impl<T, const N: usize> Eq for [T; N]where\n T: Eq,
impl<T, const N: usize> EqULE for [T; N]where\n T: EqULE,
impl<T, const N: usize> StructuralPartialEq for [T; N]
impl<const N: usize, T> Unaligned for [T; N]where\n T: Unaligned,
impl<T, const N: usize> UnsizedConstParamTy for [T; N]where\n T: UnsizedConstParamTy,
impl<Z, const N: usize> ZeroizeOnDrop for [Z; N]where\n Z: ZeroizeOnDrop,
Impl [ZeroizeOnDrop
] on arrays of types that impl [ZeroizeOnDrop
].
Source§impl<T, const N: usize> [T; N]
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,
pub 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.
If you don’t necessarily need a new fixed-size array, consider using\nIterator::map
instead.
§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(...)
).
In 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.
§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]);
Sourcepub fn try_map<R>(\n self,\n f: impl FnMut(T) -> R,\n) -> <<R as Try>::Residual as Residual<[<R as Try>::Output; N]>>::TryType
🔬This is a nightly-only experimental API. (array_try_map
)
pub fn try_map<R>(\n self,\n f: impl FnMut(T) -> R,\n) -> <<R as Try>::Residual as Residual<[<R as Try>::Output; N]>>::TryType
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.
The 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]>
.
§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));
1.57.0 (const: 1.57.0) · Sourcepub const fn as_slice(&self) -> &[T]
pub const fn as_slice(&self) -> &[T]
Returns a slice containing the entire array. Equivalent to &s[..]
.
1.57.0 (const: unstable) · Sourcepub fn as_mut_slice(&mut self) -> &mut [T]
pub fn as_mut_slice(&mut self) -> &mut [T]
Returns a mutable slice containing the entire array. Equivalent to\n&mut s[..]
.
1.77.0 (const: unstable) · Sourcepub fn each_ref(&self) -> [&T; N]
pub fn each_ref(&self) -> [&T; N]
Borrows each element and returns an array of references with the same\nsize as self
.
§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]);
This 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
.
let 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);
1.77.0 (const: unstable) · Sourcepub fn each_mut(&mut self) -> [&mut T; N]
pub 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
.
§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]);
Sourcepub fn split_array_ref<const M: usize>(&self) -> (&[T; M], &[T])
🔬This is a nightly-only experimental API. (split_array
)
pub fn split_array_ref<const M: usize>(&self) -> (&[T; M], &[T])
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).
§Panics
\nPanics if M > 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}
Sourcepub fn split_array_mut<const M: usize>(&mut self) -> (&mut [T; M], &mut [T])
🔬This is a nightly-only experimental API. (split_array
)
pub fn split_array_mut<const M: usize>(&mut self) -> (&mut [T; M], &mut [T])
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).
§Panics
\nPanics if M > 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]);
Sourcepub fn rsplit_array_ref<const M: usize>(&self) -> (&[T], &[T; M])
🔬This is a nightly-only experimental API. (split_array
)
pub fn rsplit_array_ref<const M: usize>(&self) -> (&[T], &[T; M])
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).
§Panics
\nPanics if M > 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}
Sourcepub fn rsplit_array_mut<const M: usize>(&mut self) -> (&mut [T], &mut [T; M])
🔬This is a nightly-only experimental API. (split_array
)
pub fn rsplit_array_mut<const M: usize>(&mut self) -> (&mut [T], &mut [T; M])
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).
§Panics
\nPanics if M > 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]);
Source§impl<const N: usize> [u8; N]
impl<const N: usize> [u8; N]
Sourcepub const fn as_ascii(&self) -> Option<&[AsciiChar; N]>
🔬This is a nightly-only experimental API. (ascii_char
)
pub const fn as_ascii(&self) -> Option<&[AsciiChar; N]>
ascii_char
)Converts this array of bytes into an array of ASCII characters,\nor returns None
if any of the characters is non-ASCII.
§Examples
\n#![feature(ascii_char)]\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\");
Sourcepub const unsafe fn as_ascii_unchecked(&self) -> &[AsciiChar; N]
🔬This is a nightly-only experimental API. (ascii_char
)
pub const unsafe fn as_ascii_unchecked(&self) -> &[AsciiChar; N]
ascii_char
)Converts this array of bytes into an 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.
§impl<T> Array for [T; 32]where\n T: Default,
impl<T> Array for [T; 32]where\n T: Default,
§fn as_slice_mut(&mut self) -> &mut [T]
fn as_slice_mut(&mut self) -> &mut [T]
§impl<const N: usize, T> AsBytes for [T; N]where\n T: AsBytes,
impl<const N: usize, T> AsBytes for [T; N]where\n T: AsBytes,
§fn as_bytes_mut(&mut self) -> &mut [u8] ⓘwhere\n Self: FromBytes,
fn as_bytes_mut(&mut self) -> &mut [u8] ⓘwhere\n Self: FromBytes,
§fn write_to_prefix(&self, bytes: &mut [u8]) -> Option<()>
fn write_to_prefix(&self, bytes: &mut [u8]) -> Option<()>
1.4.0 · Source§impl<T, const N: usize> BorrowMut<[T]> for [T; N]
impl<T, const N: usize> BorrowMut<[T]> for [T; N]
Source§fn borrow_mut(&mut self) -> &mut [T]
fn borrow_mut(&mut self) -> &mut [T]
§impl<const N: usize> Decode for [u8; N]
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\n
\nbyte[n]
, where n is the number of bytes in the array.
§impl<'a, T, const N: usize> DecodeValue<'a> for [T; N]where\n T: Decode<'a>,
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>,
fn decode_value<R>(reader: &mut R, header: Header) -> Result<[T; N], Error>where\n R: Reader<'a>,
Reader
].Source§impl<'de, T> Deserialize<'de> for [T; 32]where\n T: Deserialize<'de>,
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>,
fn deserialize<D>(\n deserializer: D,\n) -> Result<[T; 32], <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
§impl<const N: usize> Encode for [u8; N]
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\n
\nbyte[n]
, where n is the number of bytes in the array.
§fn encoded_len(&self) -> Result<usize, Error>
fn encoded_len(&self) -> Result<usize, Error>
§fn encode(&self, writer: &mut impl Writer) -> Result<(), Error>
fn encode(&self, writer: &mut impl Writer) -> Result<(), Error>
Writer
].§fn encoded_len_prefixed(&self) -> Result<usize, Error>
fn encoded_len_prefixed(&self) -> Result<usize, Error>
uint32
length prefix.§fn encode_prefixed(&self, writer: &mut impl Writer) -> Result<(), Error>
fn encode_prefixed(&self, writer: &mut impl Writer) -> Result<(), Error>
uint32
length prefix\nset to [Encode::encoded_len
].§impl<T, const N: usize> EncodeValue for [T; N]where\n T: Encode,
impl<T, const N: usize> EncodeValue for [T; N]where\n T: Encode,
§impl<'a> FindToken<&'a u8> for [u8; 32]
impl<'a> FindToken<&'a u8> for [u8; 32]
§fn find_token(&self, token: &u8) -> bool
fn find_token(&self, token: &u8) -> bool
§impl FindToken<u8> for [u8; 32]
impl FindToken<u8> for [u8; 32]
§fn find_token(&self, token: u8) -> bool
fn find_token(&self, token: u8) -> bool
§impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>>> for [T; 32]
Available on relaxed_coherence
only.
impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>>> for [T; 32]
relaxed_coherence
only.Source§impl From<NamespaceId> for [u8; 32]
impl From<NamespaceId> for [u8; 32]
Source§fn from(value: NamespaceId) -> Self
fn from(value: NamespaceId) -> Self
§impl<T, const N: usize> FromBytes for [T; N]where\n T: FromBytes,
impl<T, const N: usize> FromBytes for [T; N]where\n T: FromBytes,
§fn ref_from_bytes(\n source: &[u8],\n) -> Result<&Self, ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, Infallible>>where\n Self: KnownLayout + Immutable,
fn ref_from_bytes(\n source: &[u8],\n) -> Result<&Self, ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, Infallible>>where\n Self: KnownLayout + Immutable,
§fn ref_from_prefix(\n source: &[u8],\n) -> Result<(&Self, &[u8]), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, Infallible>>where\n Self: KnownLayout + Immutable,
fn ref_from_prefix(\n source: &[u8],\n) -> Result<(&Self, &[u8]), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, Infallible>>where\n Self: KnownLayout + Immutable,
§fn ref_from_suffix(\n source: &[u8],\n) -> Result<(&[u8], &Self), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, Infallible>>where\n Self: Immutable + KnownLayout,
fn ref_from_suffix(\n source: &[u8],\n) -> Result<(&[u8], &Self), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, Infallible>>where\n Self: Immutable + KnownLayout,
&Self
. Read more§fn mut_from_bytes(\n source: &mut [u8],\n) -> Result<&mut Self, ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, Infallible>>where\n Self: IntoBytes + KnownLayout,
fn mut_from_bytes(\n source: &mut [u8],\n) -> Result<&mut Self, ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, Infallible>>where\n Self: IntoBytes + KnownLayout,
§fn mut_from_prefix(\n source: &mut [u8],\n) -> Result<(&mut Self, &mut [u8]), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, Infallible>>where\n Self: IntoBytes + KnownLayout,
fn mut_from_prefix(\n source: &mut [u8],\n) -> Result<(&mut Self, &mut [u8]), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, Infallible>>where\n Self: IntoBytes + KnownLayout,
§fn mut_from_suffix(\n source: &mut [u8],\n) -> Result<(&mut [u8], &mut Self), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, Infallible>>where\n Self: IntoBytes + KnownLayout,
fn mut_from_suffix(\n source: &mut [u8],\n) -> Result<(&mut [u8], &mut Self), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, Infallible>>where\n Self: IntoBytes + KnownLayout,
§fn ref_from_bytes_with_elems(\n source: &[u8],\n count: usize,\n) -> Result<&Self, ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, Infallible>>where\n Self: KnownLayout<PointerMetadata = usize> + Immutable,
fn ref_from_bytes_with_elems(\n source: &[u8],\n count: usize,\n) -> Result<&Self, ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, Infallible>>where\n Self: KnownLayout<PointerMetadata = usize> + Immutable,
§fn ref_from_prefix_with_elems(\n source: &[u8],\n count: usize,\n) -> Result<(&Self, &[u8]), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, Infallible>>where\n Self: KnownLayout<PointerMetadata = usize> + Immutable,
fn ref_from_prefix_with_elems(\n source: &[u8],\n count: usize,\n) -> Result<(&Self, &[u8]), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, Infallible>>where\n Self: KnownLayout<PointerMetadata = usize> + Immutable,
§fn ref_from_suffix_with_elems(\n source: &[u8],\n count: usize,\n) -> Result<(&[u8], &Self), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, Infallible>>where\n Self: KnownLayout<PointerMetadata = usize> + Immutable,
fn ref_from_suffix_with_elems(\n source: &[u8],\n count: usize,\n) -> Result<(&[u8], &Self), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, Infallible>>where\n Self: KnownLayout<PointerMetadata = usize> + Immutable,
§fn mut_from_bytes_with_elems(\n source: &mut [u8],\n count: usize,\n) -> Result<&mut Self, ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, Infallible>>where\n Self: IntoBytes + KnownLayout<PointerMetadata = usize> + Immutable,
fn mut_from_bytes_with_elems(\n source: &mut [u8],\n count: usize,\n) -> Result<&mut Self, ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, Infallible>>where\n Self: IntoBytes + KnownLayout<PointerMetadata = usize> + Immutable,
§fn mut_from_prefix_with_elems(\n source: &mut [u8],\n count: usize,\n) -> Result<(&mut Self, &mut [u8]), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, Infallible>>where\n Self: IntoBytes + KnownLayout<PointerMetadata = usize>,
fn mut_from_prefix_with_elems(\n source: &mut [u8],\n count: usize,\n) -> Result<(&mut Self, &mut [u8]), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, Infallible>>where\n Self: IntoBytes + KnownLayout<PointerMetadata = usize>,
§fn mut_from_suffix_with_elems(\n source: &mut [u8],\n count: usize,\n) -> Result<(&mut [u8], &mut Self), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, Infallible>>where\n Self: IntoBytes + KnownLayout<PointerMetadata = usize>,
fn mut_from_suffix_with_elems(\n source: &mut [u8],\n count: usize,\n) -> Result<(&mut [u8], &mut Self), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, Infallible>>where\n Self: IntoBytes + KnownLayout<PointerMetadata = usize>,
§impl<const N: usize, T> FromBytes for [T; N]where\n T: FromBytes,
impl<const N: usize, T> FromBytes for [T; N]where\n T: FromBytes,
§fn ref_from_prefix(bytes: &[u8]) -> Option<&Self>where\n Self: Sized,
fn ref_from_prefix(bytes: &[u8]) -> Option<&Self>where\n Self: Sized,
§fn ref_from_suffix(bytes: &[u8]) -> Option<&Self>where\n Self: Sized,
fn ref_from_suffix(bytes: &[u8]) -> Option<&Self>where\n Self: Sized,
§fn mut_from_prefix(bytes: &mut [u8]) -> Option<&mut Self>where\n Self: Sized + AsBytes,
fn mut_from_prefix(bytes: &mut [u8]) -> Option<&mut Self>where\n Self: Sized + AsBytes,
§fn mut_from_suffix(bytes: &mut [u8]) -> Option<&mut Self>where\n Self: Sized + AsBytes,
fn mut_from_suffix(bytes: &mut [u8]) -> Option<&mut Self>where\n Self: Sized + AsBytes,
§fn slice_from(bytes: &[u8]) -> Option<&[Self]>where\n Self: Sized,
fn slice_from(bytes: &[u8]) -> Option<&[Self]>where\n Self: Sized,
§fn slice_from_prefix(bytes: &[u8], count: usize) -> Option<(&[Self], &[u8])>where\n Self: Sized,
fn slice_from_prefix(bytes: &[u8], count: usize) -> Option<(&[Self], &[u8])>where\n Self: Sized,
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,
fn slice_from_suffix(bytes: &[u8], count: usize) -> Option<(&[u8], &[Self])>where\n Self: Sized,
bytes
as a &[Self]
with length\nequal to count
without copying. Read more§fn mut_slice_from(bytes: &mut [u8]) -> Option<&mut [Self]>where\n Self: Sized + AsBytes,
fn mut_slice_from(bytes: &mut [u8]) -> Option<&mut [Self]>where\n Self: Sized + AsBytes,
§fn mut_slice_from_prefix(\n bytes: &mut [u8],\n count: usize,\n) -> Option<(&mut [Self], &mut [u8])>where\n Self: Sized + AsBytes,
fn mut_slice_from_prefix(\n bytes: &mut [u8],\n count: usize,\n) -> Option<(&mut [Self], &mut [u8])>where\n Self: Sized + AsBytes,
bytes
as a &mut [Self]
with length\nequal to count
without copying. Read more§fn mut_slice_from_suffix(\n bytes: &mut [u8],\n count: usize,\n) -> Option<(&mut [u8], &mut [Self])>where\n Self: Sized + AsBytes,
fn mut_slice_from_suffix(\n bytes: &mut [u8],\n count: usize,\n) -> Option<(&mut [u8], &mut [Self])>where\n Self: Sized + AsBytes,
bytes
as a &mut [Self]
with length\nequal to count
without copying. Read more§fn read_from_prefix(bytes: &[u8]) -> Option<Self>where\n Self: Sized,
fn read_from_prefix(bytes: &[u8]) -> Option<Self>where\n Self: Sized,
1.0.0 · Source§impl<T, const N: usize> Hash for [T; N]where\n T: Hash,
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.
use 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));
§impl<T, const N: usize> IntoBytes for [T; N]where\n T: IntoBytes,
impl<T, const N: usize> IntoBytes for [T; N]where\n T: IntoBytes,
§fn as_mut_bytes(&mut self) -> &mut [u8] ⓘwhere\n Self: FromBytes,
fn as_mut_bytes(&mut self) -> &mut [u8] ⓘwhere\n Self: FromBytes,
§fn write_to(&self, dst: &mut [u8]) -> Result<(), SizeError<&Self, &mut [u8]>>where\n Self: Immutable,
fn write_to(&self, dst: &mut [u8]) -> Result<(), SizeError<&Self, &mut [u8]>>where\n Self: Immutable,
1.53.0 · Source§impl<T, const N: usize> IntoIterator for [T; N]
impl<T, const N: usize> IntoIterator for [T; N]
Source§fn into_iter(self) -> <[T; N] as IntoIterator>::IntoIter
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).
\nThe array cannot be used after calling this unless T
implements\nCopy
, so the whole array is copied.
Arrays have special behavior when calling .into_iter()
prior to the\n2021 edition – see the array Editions section for more information.
§impl<const N: usize> IntoResponse for [u8; N]
impl<const N: usize> IntoResponse for [u8; N]
§fn into_response(self) -> Response<Body>
fn into_response(self) -> Response<Body>
§impl<Fut, const N: usize> Join for [Fut; N]where\n Fut: IntoFuture,
impl<Fut, const N: usize> Join for [Fut; N]where\n Fut: IntoFuture,
§type Output = [<Fut as IntoFuture>::Output; N]
type Output = [<Fut as IntoFuture>::Output; N]
§type Future = Join<<Fut as IntoFuture>::IntoFuture, N>
type Future = Join<<Fut as IntoFuture>::IntoFuture, N>
Future
implementation returned by this method.§impl<T, const N: usize> KnownLayout for [T; N]
impl<T, const N: usize> KnownLayout for [T; N]
§type PointerMetadata = ()
type PointerMetadata = ()
Self
. Read more§impl<T, const N: usize> MaxSize for [T; N]where\n T: MaxSize,
impl<T, const N: usize> MaxSize for [T; N]where\n T: MaxSize,
§const POSTCARD_MAX_SIZE: usize = _
const POSTCARD_MAX_SIZE: usize = _
1.0.0 · Source§impl<T, const N: usize> Ord for [T; N]where\n T: Ord,
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,
fn max(self, other: Self) -> Selfwhere\n Self: Sized,
1.0.0 · Source§impl<T, const N: usize> PartialOrd for [T; N]where\n T: PartialOrd,
impl<T, const N: usize> PartialOrd for [T; N]where\n T: PartialOrd,
Implements comparison of arrays lexicographically.
\n§impl<Fut, const N: usize> Race for [Fut; N]where\n Fut: IntoFuture,
impl<Fut, const N: usize> Race for [Fut; N]where\n Fut: IntoFuture,
§type Output = <Fut as IntoFuture>::Output
type Output = <Fut as IntoFuture>::Output
§type Future = Race<<Fut as IntoFuture>::IntoFuture, N>
type Future = Race<<Fut as IntoFuture>::IntoFuture, N>
§impl<Fut, T, E, const N: usize> RaceOk for [Fut; N]where\n Fut: IntoFuture<Output = Result<T, E>>,
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>
type Future = RaceOk<<Fut as IntoFuture>::IntoFuture, T, E, N>
Source§impl<T> Serialize for [T; 32]where\n T: Serialize,
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,
fn serialize<S>(\n &self,\n serializer: S,\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where\n S: Serializer,
1.51.0 · Source§impl<T, const N: usize> SlicePattern for [T; N]
impl<T, const N: usize> SlicePattern for [T; N]
1.34.0 · Source§impl<T, const N: usize> TryFrom<&[T]> for [T; N]where\n T: Copy,
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]
.\nSucceeds if slice.len() == N
.
let 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));
1.59.0 · Source§impl<T, const N: usize> TryFrom<&mut [T]> for [T; N]where\n T: Copy,
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
.
let 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));
§impl<T, A, const N: usize> TryFrom<Vec<T, A>> for [T; N]where\n A: Allocator,
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>>
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.
§Examples
\nassert_eq!(vec![1, 2, 3].try_into(), Ok([1, 2, 3]));\nassert_eq!(<Vec<i32>>::new().try_into(), Ok([]));
If the length doesn’t match, the input comes back in Err
:
let 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]));
If you’re fine with just getting a prefix of the Vec<T>
,\nyou can call .truncate(N)
first.
let 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');
1.48.0 · Source§impl<T, A, const N: usize> TryFrom<Vec<T, A>> for [T; N]where\n A: Allocator,
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>>
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.
§Examples
\nassert_eq!(vec![1, 2, 3].try_into(), Ok([1, 2, 3]));\nassert_eq!(<Vec<i32>>::new().try_into(), Ok([]));
If the length doesn’t match, the input comes back in Err
:
let 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]));
If you’re fine with just getting a prefix of the Vec<T>
,\nyou can call .truncate(N)
first.
let 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');
§impl<T, const N: usize> TryFromBytes for [T; N]where\n T: TryFromBytes,
impl<T, const N: usize> TryFromBytes for [T; N]where\n T: TryFromBytes,
§fn try_ref_from_bytes(\n source: &[u8],\n) -> Result<&Self, ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>where\n Self: KnownLayout + Immutable,
fn try_ref_from_bytes(\n source: &[u8],\n) -> Result<&Self, ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>where\n Self: KnownLayout + Immutable,
§fn try_ref_from_prefix(\n source: &[u8],\n) -> Result<(&Self, &[u8]), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>where\n Self: KnownLayout + Immutable,
fn try_ref_from_prefix(\n source: &[u8],\n) -> Result<(&Self, &[u8]), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>where\n Self: KnownLayout + Immutable,
§fn try_ref_from_suffix(\n source: &[u8],\n) -> Result<(&[u8], &Self), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>where\n Self: KnownLayout + Immutable,
fn try_ref_from_suffix(\n source: &[u8],\n) -> Result<(&[u8], &Self), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>where\n Self: KnownLayout + Immutable,
§fn try_mut_from_bytes(\n bytes: &mut [u8],\n) -> Result<&mut Self, ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>where\n Self: KnownLayout + IntoBytes,
fn try_mut_from_bytes(\n bytes: &mut [u8],\n) -> Result<&mut Self, ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>where\n Self: KnownLayout + IntoBytes,
§fn try_mut_from_prefix(\n source: &mut [u8],\n) -> Result<(&mut Self, &mut [u8]), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>where\n Self: KnownLayout + IntoBytes,
fn try_mut_from_prefix(\n source: &mut [u8],\n) -> Result<(&mut Self, &mut [u8]), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>where\n Self: KnownLayout + IntoBytes,
§fn try_mut_from_suffix(\n source: &mut [u8],\n) -> Result<(&mut [u8], &mut Self), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>where\n Self: KnownLayout + IntoBytes,
fn try_mut_from_suffix(\n source: &mut [u8],\n) -> Result<(&mut [u8], &mut Self), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>where\n Self: KnownLayout + IntoBytes,
§fn try_ref_from_bytes_with_elems(\n source: &[u8],\n count: usize,\n) -> Result<&Self, ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>where\n Self: KnownLayout<PointerMetadata = usize> + Immutable,
fn try_ref_from_bytes_with_elems(\n source: &[u8],\n count: usize,\n) -> Result<&Self, ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>where\n Self: KnownLayout<PointerMetadata = usize> + Immutable,
§fn try_ref_from_prefix_with_elems(\n source: &[u8],\n count: usize,\n) -> Result<(&Self, &[u8]), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>where\n Self: KnownLayout<PointerMetadata = usize> + Immutable,
fn try_ref_from_prefix_with_elems(\n source: &[u8],\n count: usize,\n) -> Result<(&Self, &[u8]), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>where\n Self: KnownLayout<PointerMetadata = usize> + Immutable,
source
as a &Self
with\na DST length equal to count
. Read more§fn try_ref_from_suffix_with_elems(\n source: &[u8],\n count: usize,\n) -> Result<(&[u8], &Self), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>where\n Self: KnownLayout<PointerMetadata = usize> + Immutable,
fn try_ref_from_suffix_with_elems(\n source: &[u8],\n count: usize,\n) -> Result<(&[u8], &Self), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>where\n Self: KnownLayout<PointerMetadata = usize> + Immutable,
source
as a &Self
with\na DST length equal to count
. Read more§fn try_mut_from_bytes_with_elems(\n source: &mut [u8],\n count: usize,\n) -> Result<&mut Self, ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>where\n Self: KnownLayout<PointerMetadata = usize> + IntoBytes,
fn try_mut_from_bytes_with_elems(\n source: &mut [u8],\n count: usize,\n) -> Result<&mut Self, ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>where\n Self: KnownLayout<PointerMetadata = usize> + IntoBytes,
§fn try_mut_from_prefix_with_elems(\n source: &mut [u8],\n count: usize,\n) -> Result<(&mut Self, &mut [u8]), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>where\n Self: KnownLayout<PointerMetadata = usize> + IntoBytes,
fn try_mut_from_prefix_with_elems(\n source: &mut [u8],\n count: usize,\n) -> Result<(&mut Self, &mut [u8]), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>where\n Self: KnownLayout<PointerMetadata = usize> + IntoBytes,
source
as a &mut Self
\nwith a DST length equal to count
. Read more§fn try_mut_from_suffix_with_elems(\n source: &mut [u8],\n count: usize,\n) -> Result<(&mut [u8], &mut Self), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>where\n Self: KnownLayout<PointerMetadata = usize> + IntoBytes,
fn try_mut_from_suffix_with_elems(\n source: &mut [u8],\n count: usize,\n) -> Result<(&mut [u8], &mut Self), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>where\n Self: KnownLayout<PointerMetadata = usize> + IntoBytes,
source
as a &mut Self
\nwith a DST length equal to count
. Read more§fn try_read_from_bytes(\n source: &[u8],\n) -> Result<Self, ConvertError<Infallible, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>where\n Self: Sized,
fn try_read_from_bytes(\n source: &[u8],\n) -> Result<Self, ConvertError<Infallible, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>where\n Self: Sized,
§fn try_read_from_prefix(\n source: &[u8],\n) -> Result<(Self, &[u8]), ConvertError<Infallible, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>where\n Self: Sized,
fn try_read_from_prefix(\n source: &[u8],\n) -> Result<(Self, &[u8]), ConvertError<Infallible, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>where\n Self: Sized,
§fn try_read_from_suffix(\n source: &[u8],\n) -> Result<(&[u8], Self), ConvertError<Infallible, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>where\n Self: Sized,
fn try_read_from_suffix(\n source: &[u8],\n) -> Result<(&[u8], Self), ConvertError<Infallible, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>where\n Self: Sized,
§impl<Fut, T, E, const N: usize> TryJoin for [Fut; N]where\n Fut: IntoFuture<Output = Result<T, E>>,
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>
type Future = TryJoin<<Fut as IntoFuture>::IntoFuture, T, E, N>
§impl<T, const N: usize> ULE for [T; N]where\n T: ULE,
impl<T, const N: usize> ULE for [T; N]where\n T: ULE,
§fn validate_byte_slice(bytes: &[u8]) -> Result<(), ZeroVecError>
fn validate_byte_slice(bytes: &[u8]) -> Result<(), ZeroVecError>
&[u8]
. Read more§fn parse_byte_slice(bytes: &[u8]) -> Result<&[Self], ZeroVecError>
fn parse_byte_slice(bytes: &[u8]) -> Result<&[Self], ZeroVecError>
§unsafe fn from_byte_slice_unchecked(bytes: &[u8]) -> &[Self]
unsafe fn from_byte_slice_unchecked(bytes: &[u8]) -> &[Self]
&[u8]
, and return it as &[Self]
with the same lifetime, assuming\nthat this byte slice has previously been run through [Self::parse_byte_slice()
] with\nsuccess. Read more§fn as_byte_slice(slice: &[Self]) -> &[u8] ⓘ
fn as_byte_slice(slice: &[Self]) -> &[u8] ⓘ
§impl<const N: usize, T> Value for [T; N]where\n T: Value,
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
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 ’atype AsBytes<'a> = Vec<u8>\nwhere\n [T; N]: 'a
§fn fixed_width() -> Option<usize>
fn fixed_width() -> Option<usize>
§fn from_bytes<'a>(data: &'a [u8]) -> [<T as Value>::SelfType<'a>; N]where\n [T; N]: 'a,
fn from_bytes<'a>(data: &'a [u8]) -> [<T as Value>::SelfType<'a>; N]where\n [T; N]: 'a,
§impl<'a, T, const N: usize> Yokeable<'a> for [T; N]where\n T: 'static + for<'b> Yokeable<'b>,
impl<'a, T, const N: usize> Yokeable<'a> for [T; N]where\n T: 'static + for<'b> Yokeable<'b>,
§type Output = [<T as Yokeable<'a>>::Output; N]
type Output = [<T as Yokeable<'a>>::Output; N]
Self
with the 'static
replaced with 'a
, i.e. Self<'a>
§fn transform_owned(self) -> <[T; N] as Yokeable<'a>>::Output
fn transform_owned(self) -> <[T; N] as Yokeable<'a>>::Output
§unsafe fn make(from: <[T; N] as Yokeable<'a>>::Output) -> [T; N]
unsafe fn make(from: <[T; N] as Yokeable<'a>>::Output) -> [T; N]
Self<'a>
’s lifetime. Read more§fn transform_mut<F>(&'a mut self, f: F)
fn transform_mut<F>(&'a mut self, f: F)
self
between &'a mut Self<'static>
and &'a mut Self<'a>
,\nand pass it to f
. Read more§impl<'a, T, const N: usize> ZeroMapKV<'a> for [T; N]where\n T: AsULE + 'static,
impl<'a, T, const N: usize> ZeroMapKV<'a> for [T; N]where\n T: AsULE + 'static,
§impl<Z, const N: usize> Zeroize for [Z; N]where\n Z: Zeroize,
impl<Z, const N: usize> Zeroize for [Z; N]where\n Z: Zeroize,
Impl [Zeroize
] on arrays of types that impl [Zeroize
].
impl<T, const N: usize> ConstParamTy_ for [T; N]where\n T: ConstParamTy_,
impl<T, const N: usize> Copy for [T; N]where\n T: Copy,
impl<T, const N: usize> Eq for [T; N]where\n T: Eq,
impl<T, const N: usize> EqULE for [T; N]where\n T: EqULE,
impl<T, const N: usize> Immutable for [T; N]where\n T: Immutable,
impl<T, const N: usize> StructuralPartialEq for [T; N]
impl<T, const N: usize> Unaligned for [T; N]where\n T: Unaligned,
impl<const N: usize, T> Unaligned for [T; N]where\n T: Unaligned,
impl<T, const N: usize> UnsizedConstParamTy for [T; N]where\n T: UnsizedConstParamTy,
impl<Z, const N: usize> ZeroizeOnDrop for [Z; N]where\n Z: ZeroizeOnDrop,
Impl [ZeroizeOnDrop
] on arrays of types that impl [ZeroizeOnDrop
].