Struct Fud

Source
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>>§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

Source

pub async fn new( settings: Args, p2p: P2pPtr, sled_db: &Db, event_publisher: PublisherPtr<FudEvent>, executor: ExecutorPtr, ) -> Result<Self>

Source

pub async fn start_tasks(self: &Arc<Self>)

Source

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.

Source

pub fn hash_to_path(&self, hash: &Hash) -> Result<Option<PathBuf>>

Get resource path from hash using the sled db

Source

pub fn path_to_hash(&self, path: &Path) -> Result<Option<Hash>>

Get resource hash from path using the sled db

Source

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.

Source

pub(crate) async fn fetch_seeders( &self, nodes: &Vec<FudNode>, key: &Hash, ) -> HashSet<DhtRouterItem<FudNode>>

Query nodes to find the seeders for key

Source

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.

Source

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.

  1. Request seeders from those nodes
  2. Request the metadata from the seeders
  3. Insert metadata to geode using the reply
Source

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.

Source

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().

Source

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.

Source

pub(crate) async fn write_scraps( &self, chunked: &mut ChunkedStorage, chunk_hashes: &HashSet<Hash>, ) -> Result<()>

Source

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).

Source

pub async fn put(&self, path: &Path) -> Result<()>

Add a resource from the file system.

Source

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.

Source

pub async fn remove(&self, hash: &Hash)

Removes:

  • a resource
  • its metadata in geode
  • its path in the sled path tree
  • its file selection in the sled file selection tree
  • and any related scrap in the sled scrap tree,

then sends a ResourceRemoved fud event.

Source

pub async fn stop(&self)

Stop all tasks.

Trait Implementations§

Source§

impl DhtHandler<FudNode> for Fud

Source§

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,

Get our own node
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,

Send a DHT ping request
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,

Triggered when we find a new node
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,

Send FIND NODES request to a peer to get nodes close to 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,

Announce message for a key, and add ourselves to router
Source§

fn bootstrap<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Lookup our own node id to bootstrap our DHT
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,

Add a node in the correct bucket
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,

Move a node to the tail in its bucket, to show that it is the most recently seen in the bucket. If the node is not in a bucket it will be added using 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,

Wait to acquire a semaphore, then run 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,

Find k nodes closest to a key
Source§

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,

Get a channel (existing or create a new one) to 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,

Decrement the channel usage count, if it becomes 0 then set the topic to None, so that this channel is available for another task
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,

Add nodes as a provider for a key

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§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> ArchivePointee for T

§

type ArchivedMetadata = ()

The archived version of the pointer metadata for this type.
§

fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata

Converts some archived metadata to the pointer metadata for itself.
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
§

impl<T> Conv for T

§

fn conv<T>(self) -> T
where Self: Into<T>,

Converts self into T using Into<T>. Read more
§

impl<T> Downcast for T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

Converts 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>

Converts 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)

Converts &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)

Converts &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
where T: Any + Send,

§

fn into_any_send(self: Box<T>) -> Box<dyn Any + Send>

Converts Box<Trait> (where Trait: DowncastSend) to Box<dyn Any + Send>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

§

fn into_any_sync(self: Box<T>) -> Box<dyn Any + Sync + Send>

Converts Box<Trait> (where Trait: DowncastSync) to Box<dyn Any + Send + Sync>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

Converts Arc<Trait> (where Trait: DowncastSync) to Arc<Any>, which can then be downcast into Arc<ConcreteType> where ConcreteType implements Trait.
§

impl<T> FmtForward for T

§

fn fmt_binary(self) -> FmtBinary<Self>
where Self: Binary,

Causes self to use its Binary implementation when Debug-formatted.
§

fn fmt_display(self) -> FmtDisplay<Self>
where Self: Display,

Causes self to use its Display implementation when Debug-formatted.
§

fn fmt_lower_exp(self) -> FmtLowerExp<Self>
where Self: LowerExp,

Causes self to use its LowerExp implementation when Debug-formatted.
§

fn fmt_lower_hex(self) -> FmtLowerHex<Self>
where Self: LowerHex,

Causes self to use its LowerHex implementation when Debug-formatted.
§

fn fmt_octal(self) -> FmtOctal<Self>
where Self: Octal,

Causes self to use its Octal implementation when Debug-formatted.
§

fn fmt_pointer(self) -> FmtPointer<Self>
where Self: Pointer,

Causes self to use its Pointer implementation when Debug-formatted.
§

fn fmt_upper_exp(self) -> FmtUpperExp<Self>
where Self: UpperExp,

Causes self to use its UpperExp implementation when Debug-formatted.
§

fn fmt_upper_hex(self) -> FmtUpperHex<Self>
where Self: UpperHex,

Causes self to use its UpperHex implementation when Debug-formatted.
§

fn fmt_list(self) -> FmtList<Self>
where &'a Self: for<'a> IntoIterator,

Formats each item in a sequence. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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

§

fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>

Returns the layout of the type.
§

impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
where T: SharedNiching<N1, N2>, N1: Niching<T>, N2: Niching<T>,

§

unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool

Returns whether the given value has been niched. Read more
§

fn resolve_niched(out: Place<NichedOption<T, N1>>)

Writes data to out indicating that a T is niched.
§

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

§

fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> R
where Self: Sized,

Pipes by value. This is generally the method you want to use. Read more
§

fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> R
where R: 'a,

Borrows 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) -> R
where R: 'a,

Mutably borrows 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
where Self: Borrow<B>, B: 'a + ?Sized, R: 'a,

Borrows self, then passes self.borrow() into the pipe function. Read more
§

fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
where Self: BorrowMut<B>, B: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.borrow_mut() into the pipe function. Read more
§

fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
where Self: AsRef<U>, U: 'a + ?Sized, R: 'a,

Borrows 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
where Self: AsMut<U>, U: 'a + ?Sized, R: 'a,

Mutably borrows 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
where Self: Deref<Target = T>, T: 'a + ?Sized, R: 'a,

Borrows self, then passes self.deref() into the pipe function.
§

fn pipe_deref_mut<'a, T, R>( &'a mut self, func: impl FnOnce(&'a mut T) -> R, ) -> R
where Self: DerefMut<Target = T> + Deref, T: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.deref_mut() into the pipe function.
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Metadata = ()

The metadata type for pointers and references to this type.
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
§

impl<T> Tap for T

§

fn tap(self, func: impl FnOnce(&Self)) -> Self

Immutable access to a value. Read more
§

fn tap_mut(self, func: impl FnOnce(&mut Self)) -> Self

Mutable access to a value. Read more
§

fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
where Self: Borrow<B>, B: ?Sized,

Immutable access to the Borrow<B> of a value. Read more
§

fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
where Self: BorrowMut<B>, B: ?Sized,

Mutable access to the BorrowMut<B> of a value. Read more
§

fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
where Self: AsRef<R>, R: ?Sized,

Immutable access to the AsRef<R> view of a value. Read more
§

fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
where Self: AsMut<R>, R: ?Sized,

Mutable access to the AsMut<R> view of a value. Read more
§

fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
where Self: Deref<Target = T>, T: ?Sized,

Immutable access to the Deref::Target of a value. Read more
§

fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
where Self: DerefMut<Target = T> + Deref, T: ?Sized,

Mutable access to the Deref::Target of a value. Read more
§

fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self

Calls .tap() only in debug builds, and is erased in release builds.
§

fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self

Calls .tap_mut() only in debug builds, and is erased in release builds.
§

fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
where Self: Borrow<B>, B: ?Sized,

Calls .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
where Self: BorrowMut<B>, B: ?Sized,

Calls .tap_borrow_mut() only in debug builds, and is erased in release builds.
§

fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
where Self: AsRef<R>, R: ?Sized,

Calls .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
where Self: AsMut<R>, R: ?Sized,

Calls .tap_ref_mut() only in debug builds, and is erased in release builds.
§

fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
where Self: Deref<Target = T>, T: ?Sized,

Calls .tap_deref() only in debug builds, and is erased in release builds.
§

fn tap_deref_mut_dbg<T>(self, func: impl FnOnce(&mut T)) -> Self
where Self: DerefMut<Target = T> + Deref, T: ?Sized,

Calls .tap_deref_mut() only in debug builds, and is erased in release builds.
§

impl<T> TryConv for T

§

fn try_conv<T>(self) -> Result<T, Self::Error>
where Self: TryInto<T>,

Attempts to convert self into T using TryInto<T>. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

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

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> Upcastable for T
where T: Any + Send + Sync + 'static,

§

fn upcast_any_ref(&self) -> &(dyn Any + 'static)

upcast ref
§

fn upcast_any_mut(&mut self) -> &mut (dyn Any + 'static)

upcast mut ref
§

fn upcast_any_box(self: Box<T>) -> Box<dyn Any>

upcast boxed dyn
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

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

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

fn with_current_subscriber(self) -> WithDispatch<Self>

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

impl<T> ErasedDestructor for T
where T: 'static,