pub trait RemoteIdConvertProtocol:
Send
+ Sync
+ 'static {
// Required methods
fn resolve_names_to_relative_paths<'life0, 'async_trait>(
&'life0 self,
heads: Vec<Vertex>,
names: Vec<Vertex>,
) -> Pin<Box<dyn Future<Output = Result<Vec<(AncestorPath, Vec<Vertex>)>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn resolve_relative_paths_to_names<'life0, 'async_trait>(
&'life0 self,
paths: Vec<AncestorPath>,
) -> Pin<Box<dyn Future<Output = Result<Vec<(AncestorPath, Vec<Vertex>)>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
// Provided method
fn is_local(&self) -> bool { ... }
}Expand description
Abstraction of network protocols.
Required Methods§
Sourcefn resolve_names_to_relative_paths<'life0, 'async_trait>(
&'life0 self,
heads: Vec<Vertex>,
names: Vec<Vertex>,
) -> Pin<Box<dyn Future<Output = Result<Vec<(AncestorPath, Vec<Vertex>)>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn resolve_names_to_relative_paths<'life0, 'async_trait>(
&'life0 self,
heads: Vec<Vertex>,
names: Vec<Vertex>,
) -> Pin<Box<dyn Future<Output = Result<Vec<(AncestorPath, Vec<Vertex>)>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Ask the server to convert names to “x~n” relative paths.
If a “name” cannot be resolved using “x~n” form in “::heads”, aka. the “heads” are known to the server, and the server can calculate “::heads”, and knows all names (commit hashes) in “::heads”. And the server confirms “name” is outside “::heads” (either because “name” is unknown to the server’s IdMap, or because “name” is known in the server’s IdMap, but the matching Id is outside “::heads”), this method should skip it in the resulting list (instead of returning an error).
Sourcefn resolve_relative_paths_to_names<'life0, 'async_trait>(
&'life0 self,
paths: Vec<AncestorPath>,
) -> Pin<Box<dyn Future<Output = Result<Vec<(AncestorPath, Vec<Vertex>)>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn resolve_relative_paths_to_names<'life0, 'async_trait>(
&'life0 self,
paths: Vec<AncestorPath>,
) -> Pin<Box<dyn Future<Output = Result<Vec<(AncestorPath, Vec<Vertex>)>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Ask the server to convert “x~n” relative paths back to commit hashes.
Unlike resolve_names_to_relative_paths, failures are not expected. They usually indicate rare events like master moving backwards.
Provided Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".