pub struct Fud {Show 22 fields
pub node_data: Arc<RwLock<VerifiableNodeData>>,
pub secret_key: Arc<RwLock<SecretKey>>,
pub seeders_router: DhtRouterPtr<FudNode>,
pub(crate) p2p: P2pPtr,
pub(crate) geode: Geode,
pub(crate) downloads_path: PathBuf,
pub(crate) chunk_timeout: u64,
pub pow: Arc<RwLock<FudPow>>,
pub(crate) dht: Arc<Dht<FudNode>>,
pub(crate) resources: Arc<RwLock<HashMap<Hash, Resource>>>,
pub(crate) path_tree: Tree,
pub(crate) file_selection_tree: Tree,
pub(crate) scrap_tree: Tree,
pub(crate) get_tx: Sender<(Hash, PathBuf, FileSelection)>,
pub(crate) get_rx: Receiver<(Hash, PathBuf, FileSelection)>,
pub(crate) put_tx: Sender<PathBuf>,
pub(crate) put_rx: Receiver<PathBuf>,
pub(crate) fetch_tasks: Arc<RwLock<HashMap<Hash, Arc<StoppableTask>>>>,
pub(crate) put_tasks: Arc<RwLock<HashMap<PathBuf, Arc<StoppableTask>>>>,
pub(crate) tasks: Arc<RwLock<HashMap<String, Arc<StoppableTask>>>>,
pub(crate) event_publisher: PublisherPtr<FudEvent>,
pub executor: ExecutorPtr,
}
Fields§
§node_data: Arc<RwLock<VerifiableNodeData>>
Our own VerifiableNodeData
secret_key: Arc<RwLock<SecretKey>>
Our secret key (the public key is in node_data
)
seeders_router: DhtRouterPtr<FudNode>
Key -> Seeders
p2p: P2pPtr
Pointer to the P2P network instance
geode: Geode
The Geode instance
downloads_path: PathBuf
Default download directory
chunk_timeout: u64
Chunk transfer timeout in seconds
pow: Arc<RwLock<FudPow>>
The FudPow
instance
dht: Arc<Dht<FudNode>>
The DHT instance
resources: Arc<RwLock<HashMap<Hash, Resource>>>
Resources (current status of all downloads/seeds)
path_tree: Tree
Sled tree containing “resource hash -> path on the filesystem”
file_selection_tree: Tree
Sled tree containing “resource hash -> file selection”. If the file selection is all files of the resource (or if the resource is not a directory), the resource does not store its file selection in the tree.
scrap_tree: Tree
Sled tree containing scraps which are chunks containing data the user did not want to save to files. They also contain data the user wanted otherwise we would not have downloaded the chunk at all. “chunk/scrap hash -> chunk content”
get_tx: Sender<(Hash, PathBuf, FileSelection)>
§get_rx: Receiver<(Hash, PathBuf, FileSelection)>
§put_tx: Sender<PathBuf>
§put_rx: Receiver<PathBuf>
§fetch_tasks: Arc<RwLock<HashMap<Hash, Arc<StoppableTask>>>>
Currently active downloading tasks (running the fud.fetch_resource()
method)
put_tasks: Arc<RwLock<HashMap<PathBuf, Arc<StoppableTask>>>>
Currently active put tasks (running the fud.insert_resource()
method)
tasks: Arc<RwLock<HashMap<String, Arc<StoppableTask>>>>
Currently active tasks (defined in tasks
, started with the start_task
macro)
event_publisher: PublisherPtr<FudEvent>
Used to send events to fud clients
executor: ExecutorPtr
Global multithreaded executor reference
Implementations§
Source§impl Fud
impl Fud
pub async fn new( settings: Args, p2p: P2pPtr, sled_db: &Db, event_publisher: PublisherPtr<FudEvent>, executor: ExecutorPtr, ) -> Result<Self>
pub async fn start_tasks(self: &Arc<Self>)
Sourcepub(crate) async fn init(&self) -> Result<()>
pub(crate) async fn init(&self) -> Result<()>
Bootstrap the DHT, verify our resources, add ourselves to
seeders_router
for the resources we already have, announce our files.
Sourcepub fn hash_to_path(&self, hash: &Hash) -> Result<Option<PathBuf>>
pub fn hash_to_path(&self, hash: &Hash) -> Result<Option<PathBuf>>
Get resource path from hash using the sled db
Sourcepub fn path_to_hash(&self, path: &Path) -> Result<Option<Hash>>
pub fn path_to_hash(&self, path: &Path) -> Result<Option<Hash>>
Get resource hash from path using the sled db
Sourcepub async fn verify_resources(
&self,
hashes: Option<Vec<Hash>>,
) -> Result<Vec<Resource>>
pub async fn verify_resources( &self, hashes: Option<Vec<Hash>>, ) -> Result<Vec<Resource>>
Verify if resources are complete and uncorrupted. If a resource is incomplete or corrupted, its status is changed to Incomplete. If a resource is complete, its status is changed to Seeding. Takes an optional list of resource hashes. If no hash is given (None), it verifies all resources. Returns the list of verified and uncorrupted/complete seeding resources.
Sourcepub(crate) async fn fetch_seeders(
&self,
nodes: &Vec<FudNode>,
key: &Hash,
) -> HashSet<DhtRouterItem<FudNode>>
pub(crate) async fn fetch_seeders( &self, nodes: &Vec<FudNode>, key: &Hash, ) -> HashSet<DhtRouterItem<FudNode>>
Query nodes
to find the seeders for key
Sourcepub(crate) async fn fetch_chunks(
&self,
hash: &Hash,
chunked: &mut ChunkedStorage,
seeders: &HashSet<DhtRouterItem<FudNode>>,
chunks: &HashSet<Hash>,
) -> Result<()>
pub(crate) async fn fetch_chunks( &self, hash: &Hash, chunked: &mut ChunkedStorage, seeders: &HashSet<DhtRouterItem<FudNode>>, chunks: &HashSet<Hash>, ) -> Result<()>
Fetch chunks
for chunked
(file or directory) from seeders
.
Sourcepub async fn fetch_metadata(
&self,
hash: &Hash,
nodes: &Vec<FudNode>,
path: &Path,
) -> Result<()>
pub async fn fetch_metadata( &self, hash: &Hash, nodes: &Vec<FudNode>, path: &Path, ) -> Result<()>
Fetch a single resource metadata from nodes
.
If the resource is a file smaller than a single chunk then seeder can send the
chunk directly, and we will create the file from it on path path
.
- Request seeders from those nodes
- Request the metadata from the seeders
- Insert metadata to geode using the reply
Sourcepub async fn get(
&self,
hash: &Hash,
path: &Path,
files: FileSelection,
) -> Result<()>
pub async fn get( &self, hash: &Hash, path: &Path, files: FileSelection, ) -> Result<()>
Start downloading a file or directory from the network to path
.
This creates a new task in fetch_tasks
calling fetch_resource()
.
files
is the list of files (relative paths) you want to download
(if the resource is a directory), None means you want all files.
Sourcepub async fn get_metadata(
&self,
hash: &Hash,
path: &Path,
) -> Result<(ChunkedStorage, Vec<FudNode>)>
pub async fn get_metadata( &self, hash: &Hash, path: &Path, ) -> Result<(ChunkedStorage, Vec<FudNode>)>
Try to get the chunked file or directory from geode, if we don’t have it
then it is fetched from the network using fetch_metadata()
.
Sourcepub async fn fetch_resource(
&self,
hash: &Hash,
path: &Path,
files: &FileSelection,
) -> Result<()>
pub async fn fetch_resource( &self, hash: &Hash, path: &Path, files: &FileSelection, ) -> Result<()>
Download a file or directory from the network to path
.
Called when get()
creates a new fetch task.
pub(crate) async fn write_scraps( &self, chunked: &mut ChunkedStorage, chunk_hashes: &HashSet<Hash>, ) -> Result<()>
Sourcepub async fn verify_chunks(
&self,
resource: &Resource,
chunked: &mut ChunkedStorage,
) -> Result<(u64, u64)>
pub async fn verify_chunks( &self, resource: &Resource, chunked: &mut ChunkedStorage, ) -> Result<(u64, u64)>
Iterate over chunks and find which chunks are available locally,
either in the filesystem (using geode::verify_chunks()) or in scraps.
chunk_hashes
is the list of chunk hashes we want to take into account, None
means to
take all chunks into account.
Return the scraps in a HashMap, and the size in bytes of locally available data
(downloaded and downloaded+targeted).
Sourcepub async fn insert_resource(&self, path: &PathBuf) -> Result<()>
pub async fn insert_resource(&self, path: &PathBuf) -> Result<()>
Insert a file or directory from the file system.
Called when put()
creates a new put task.
Trait Implementations§
Source§impl DhtHandler<FudNode> for Fud
impl DhtHandler<FudNode> for Fud
fn dht(&self) -> Arc<Dht<FudNode>>
Source§fn node<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = FudNode> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn node<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = FudNode> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn ping<'life0, 'async_trait>(
&'life0 self,
channel: ChannelPtr,
) -> Pin<Box<dyn Future<Output = Result<FudNode>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn ping<'life0, 'async_trait>(
&'life0 self,
channel: ChannelPtr,
) -> Pin<Box<dyn Future<Output = Result<FudNode>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn on_new_node<'life0, 'life1, 'async_trait>(
&'life0 self,
node: &'life1 FudNode,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn on_new_node<'life0, 'life1, 'async_trait>(
&'life0 self,
node: &'life1 FudNode,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn fetch_nodes<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
node: &'life1 FudNode,
key: &'life2 Hash,
) -> Pin<Box<dyn Future<Output = Result<Vec<FudNode>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn fetch_nodes<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
node: &'life1 FudNode,
key: &'life2 Hash,
) -> Pin<Box<dyn Future<Output = Result<Vec<FudNode>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
key
Source§fn announce<'life0, 'life1, 'life2, 'async_trait, M>(
&'life0 self,
key: &'life1 Hash,
message: &'life2 M,
router: Arc<RwLock<HashMap<Hash, HashSet<DhtRouterItem<N>>>>>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
N: 'async_trait,
M: 'async_trait + Message,
Self: 'async_trait,
fn announce<'life0, 'life1, 'life2, 'async_trait, M>(
&'life0 self,
key: &'life1 Hash,
message: &'life2 M,
router: Arc<RwLock<HashMap<Hash, HashSet<DhtRouterItem<N>>>>>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
N: 'async_trait,
M: 'async_trait + Message,
Self: 'async_trait,
Source§fn bootstrap<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn bootstrap<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Source§fn add_node<'life0, 'async_trait>(
&'life0 self,
node: N,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
'life0: 'async_trait,
N: 'async_trait,
Self: 'async_trait,
fn add_node<'life0, 'async_trait>(
&'life0 self,
node: N,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
'life0: 'async_trait,
N: 'async_trait,
Self: 'async_trait,
Source§fn update_node<'life0, 'life1, 'async_trait>(
&'life0 self,
node: &'life1 N,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn update_node<'life0, 'life1, 'async_trait>(
&'life0 self,
node: &'life1 N,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
add_node
Source§fn fetch_nodes_sp<'life0, 'life1, 'async_trait>(
&'life0 self,
semaphore: Arc<Semaphore>,
node: N,
key: &'life1 Hash,
) -> Pin<Box<dyn Future<Output = (N, Result<Vec<N>, Error>)> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
N: 'async_trait,
Self: 'async_trait,
fn fetch_nodes_sp<'life0, 'life1, 'async_trait>(
&'life0 self,
semaphore: Arc<Semaphore>,
node: N,
key: &'life1 Hash,
) -> Pin<Box<dyn Future<Output = (N, Result<Vec<N>, Error>)> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
N: 'async_trait,
Self: 'async_trait,
self.fetch_nodes
.
This is meant to be used in lookup_nodes
.Source§fn lookup_nodes<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 Hash,
) -> Pin<Box<dyn Future<Output = Result<Vec<N>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn lookup_nodes<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 Hash,
) -> Pin<Box<dyn Future<Output = Result<Vec<N>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
k
nodes closest to a keySource§fn get_channel<'life0, 'life1, 'async_trait>(
&'life0 self,
node: &'life1 N,
topic: Option<Hash>,
) -> Pin<Box<dyn Future<Output = Result<Arc<Channel>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn get_channel<'life0, 'life1, 'async_trait>(
&'life0 self,
node: &'life1 N,
topic: Option<Hash>,
) -> Pin<Box<dyn Future<Output = Result<Arc<Channel>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
node
about topic
.
Don’t forget to call cleanup_channel()
once you are done with it.Source§fn cleanup_channel<'life0, 'async_trait>(
&'life0 self,
channel: Arc<Channel>,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn cleanup_channel<'life0, 'async_trait>(
&'life0 self,
channel: Arc<Channel>,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Source§fn add_to_router<'life0, 'life1, 'async_trait>(
&'life0 self,
router: Arc<RwLock<HashMap<Hash, HashSet<DhtRouterItem<N>>>>>,
key: &'life1 Hash,
router_items: Vec<DhtRouterItem<N>>,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
N: 'async_trait,
Self: 'async_trait,
fn add_to_router<'life0, 'life1, 'async_trait>(
&'life0 self,
router: Arc<RwLock<HashMap<Hash, HashSet<DhtRouterItem<N>>>>>,
key: &'life1 Hash,
router_items: Vec<DhtRouterItem<N>>,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
N: 'async_trait,
Self: 'async_trait,
Auto Trait Implementations§
impl Freeze for Fud
impl !RefUnwindSafe for Fud
impl Send for Fud
impl Sync for Fud
impl !Unpin for Fud
impl !UnwindSafe for Fud
Blanket Implementations§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Conv for T
impl<T> Conv for T
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
, which can then be
downcast
into Box<dyn ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
, which can then be further
downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.§impl<T> DowncastSend for T
impl<T> DowncastSend for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> FmtForward for T
impl<T> FmtForward for T
§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self
to use its Binary
implementation when Debug
-formatted.§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self
to use its Display
implementation when
Debug
-formatted.§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self
to use its LowerExp
implementation when
Debug
-formatted.§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self
to use its LowerHex
implementation when
Debug
-formatted.§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self
to use its Octal
implementation when Debug
-formatted.§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self
to use its Pointer
implementation when
Debug
-formatted.§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self
to use its UpperExp
implementation when
Debug
-formatted.§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self
to use its UpperHex
implementation when
Debug
-formatted.§fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2where
T: SharedNiching<N1, N2>,
N1: Niching<T>,
N2: Niching<T>,
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2where
T: SharedNiching<N1, N2>,
N1: Niching<T>,
N2: Niching<T>,
§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self
and passes that borrow into the pipe function. Read more§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self
and passes that borrow into the pipe function. Read more§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self
, then passes self.as_ref()
into the pipe function.§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self
, then passes self.as_mut()
into the pipe
function.§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self
, then passes self.deref()
into the pipe function.§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> Pointee for T
impl<T> Pointee for T
§impl<T> Tap for T
impl<T> Tap for T
§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B>
of a value. Read more§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B>
of a value. Read more§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R>
view of a value. Read more§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R>
view of a value. Read more§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target
of a value. Read more§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target
of a value. Read more§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap()
only in debug builds, and is erased in release builds.§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut()
only in debug builds, and is erased in release
builds.§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow()
only in debug builds, and is erased in release
builds.§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut()
only in debug builds, and is erased in release
builds.§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref()
only in debug builds, and is erased in release
builds.§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut()
only in debug builds, and is erased in release
builds.§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref()
only in debug builds, and is erased in release
builds.