pub struct MockPathInfoService {
PathInfoService_expectations: MockPathInfoService_PathInfoService,
}Expand description
The base trait all PathInfo services need to implement.
Fields§
§PathInfoService_expectations: MockPathInfoService_PathInfoServiceImplementations§
Source§impl MockPathInfoService
impl MockPathInfoService
Sourcepub fn checkpoint(&mut self)
pub fn checkpoint(&mut self)
Validate that all current expectations for all methods have been satisfied, and discard them.
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new mock object with no expectations.
This method will not be generated if the real struct
already has a new method. However, it will be
generated if the struct implements a trait with a new
method. The trait’s new method can still be called
like <MockX as TraitY>::new
Source§impl MockPathInfoService
impl MockPathInfoService
Sourcepub fn expect_get(&mut self) -> &mut Expectation
pub fn expect_get(&mut self) -> &mut Expectation
Create an Expectation for mocking the get method
Sourcepub fn expect_has(&mut self) -> &mut Expectation
pub fn expect_has(&mut self) -> &mut Expectation
Create an Expectation for mocking the has method
Sourcepub fn expect_put(&mut self) -> &mut Expectation
pub fn expect_put(&mut self) -> &mut Expectation
Create an Expectation for mocking the put method
Sourcepub fn expect_list(&mut self) -> &mut Expectation
pub fn expect_list(&mut self) -> &mut Expectation
Create an Expectation for mocking the list method
Sourcepub fn expect_nar_calculation_service(&mut self) -> &mut Expectation
pub fn expect_nar_calculation_service(&mut self) -> &mut Expectation
Create an Expectation for mocking the nar_calculation_service method
Trait Implementations§
Source§impl Debug for MockPathInfoService
impl Debug for MockPathInfoService
Source§impl Default for MockPathInfoService
impl Default for MockPathInfoService
Source§impl PathInfoService for MockPathInfoService
The base trait all PathInfo services need to implement.
impl PathInfoService for MockPathInfoService
The base trait all PathInfo services need to implement.
Source§fn get<'life0, 'async_trait>(
&'life0 self,
digest: [u8; 20],
) -> Pin<Box<dyn Future<Output = Result<Option<PathInfo>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get<'life0, 'async_trait>(
&'life0 self,
digest: [u8; 20],
) -> Pin<Box<dyn Future<Output = Result<Option<PathInfo>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Retrieve a PathInfo by the output digest.
Source§fn has<'life0, 'async_trait>(
&'life0 self,
digest: [u8; 20],
) -> Pin<Box<dyn Future<Output = Result<bool, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn has<'life0, 'async_trait>(
&'life0 self,
digest: [u8; 20],
) -> Pin<Box<dyn Future<Output = Result<bool, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Check if a PathInfo exists. Has a naïve default impl, but store implementations may decide to implement their own.
Source§fn put<'life0, 'async_trait>(
&'life0 self,
path_info: PathInfo,
) -> Pin<Box<dyn Future<Output = Result<PathInfo, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn put<'life0, 'async_trait>(
&'life0 self,
path_info: PathInfo,
) -> Pin<Box<dyn Future<Output = Result<PathInfo, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Store a PathInfo.
Source§fn list(&self) -> BoxStream<'static, Result<PathInfo, Error>>
fn list(&self) -> BoxStream<'static, Result<PathInfo, Error>>
Iterate over all PathInfo objects in the store. Implementations can decide to disallow listing.
This returns a pinned, boxed stream. The pinning allows for it to be polled easily, and the box allows different underlying stream implementations to be returned since Rust doesn’t support this as a generic in traits yet. This is the same thing that async_trait generates, but for streams instead of futures.
Even though this function is not async, underlying implementations are assumed to be nonblocking on IO, so they MUST use spawn_blocking when doing IO. Implementations can assume to be invoked in the context of a tokio runtime.
Source§fn nar_calculation_service(&self) -> Option<Arc<dyn NarCalculationService>>
fn nar_calculation_service(&self) -> Option<Arc<dyn NarCalculationService>>
Returns a (more) suitable NarCalculationService. This can be used to offload NAR calculation to the remote side.
Auto Trait Implementations§
impl Freeze for MockPathInfoService
impl RefUnwindSafe for MockPathInfoService
impl Send for MockPathInfoService
impl Sync for MockPathInfoService
impl Unpin for MockPathInfoService
impl UnsafeUnpin for MockPathInfoService
impl UnwindSafe for MockPathInfoService
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].