pub struct TransferEndpoint { /* private fields */ }Expand description
Immutable execution endpoint used to identify a transfer route.
An endpoint combines the logical runtime engine with the storage class that the engine exposes. Equality, ordering, and hashing are based on both values, so two engines that expose the same storage class remain distinct route endpoints.
§Examples
use tenferro_runtime::{EngineId, StorageClass, TransferEndpoint};
let endpoint = TransferEndpoint::new(
EngineId::new("tenferro.cpu")?,
StorageClass::new("tenferro.storage.host")?,
);
assert_eq!(endpoint.engine_id().as_str(), "tenferro.cpu");
assert_eq!(endpoint.storage_class().as_str(), "tenferro.storage.host");Implementations§
Source§impl TransferEndpoint
impl TransferEndpoint
Sourcepub fn new(engine_id: EngineId, storage_class: StorageClass) -> Self
pub fn new(engine_id: EngineId, storage_class: StorageClass) -> Self
Construct an endpoint from an engine and one of its storage classes.
The runtime validates that the engine is registered and supports the storage class when a transfer-provider candidate is frozen.
§Examples
use tenferro_runtime::{EngineId, StorageClass, TransferEndpoint};
let endpoint = TransferEndpoint::new(
EngineId::new("tenferro.cpu")?,
StorageClass::new("tenferro.storage.host")?,
);
assert_eq!(endpoint.engine_id().as_str(), "tenferro.cpu");Sourcepub fn engine_id(&self) -> &EngineId
pub fn engine_id(&self) -> &EngineId
Return the logical engine that owns this endpoint.
§Examples
use tenferro_runtime::{EngineId, StorageClass, TransferEndpoint};
let engine = EngineId::new("tenferro.cpu")?;
let endpoint = TransferEndpoint::new(
engine.clone(),
StorageClass::new("tenferro.storage.host")?,
);
assert_eq!(endpoint.engine_id(), &engine);Sourcepub fn storage_class(&self) -> &StorageClass
pub fn storage_class(&self) -> &StorageClass
Return the storage class exposed at this endpoint.
§Examples
use tenferro_runtime::{EngineId, StorageClass, TransferEndpoint};
let storage = StorageClass::new("tenferro.storage.host")?;
let endpoint = TransferEndpoint::new(EngineId::new("tenferro.cpu")?, storage.clone());
assert_eq!(endpoint.storage_class(), &storage);Trait Implementations§
Source§impl Clone for TransferEndpoint
impl Clone for TransferEndpoint
Source§fn clone(&self) -> TransferEndpoint
fn clone(&self) -> TransferEndpoint
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TransferEndpoint
impl Debug for TransferEndpoint
Source§impl Hash for TransferEndpoint
impl Hash for TransferEndpoint
Source§impl Ord for TransferEndpoint
impl Ord for TransferEndpoint
Source§fn cmp(&self, other: &TransferEndpoint) -> Ordering
fn cmp(&self, other: &TransferEndpoint) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for TransferEndpoint
impl PartialEq for TransferEndpoint
Source§fn eq(&self, other: &TransferEndpoint) -> bool
fn eq(&self, other: &TransferEndpoint) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl PartialOrd for TransferEndpoint
impl PartialOrd for TransferEndpoint
impl Eq for TransferEndpoint
impl StructuralPartialEq for TransferEndpoint
Auto Trait Implementations§
impl Freeze for TransferEndpoint
impl RefUnwindSafe for TransferEndpoint
impl Send for TransferEndpoint
impl Sync for TransferEndpoint
impl Unpin for TransferEndpoint
impl UnsafeUnpin for TransferEndpoint
impl UnwindSafe for TransferEndpoint
Blanket Implementations§
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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>
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 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>
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