mirror of
https://github.com/ntex-rs/ntex.git
synced 2025-04-03 04:47:39 +03:00
Remove Deref for Container<T> (#212)
This commit is contained in:
parent
108e2ac20a
commit
50528b11ff
5 changed files with 35 additions and 37 deletions
|
@ -1,5 +1,9 @@
|
|||
# Changes
|
||||
|
||||
## [1.2.0-beta.2] - 2023-06-19
|
||||
|
||||
* Remove Deref for Container<T>
|
||||
|
||||
## [1.2.0-beta.1] - 2023-06-19
|
||||
|
||||
* Rename Ctx to ServiceCtx
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "ntex-service"
|
||||
version = "1.2.0-beta.1"
|
||||
version = "1.2.0-beta.2"
|
||||
authors = ["ntex contributors <team@ntex.rs>"]
|
||||
description = "ntex service"
|
||||
keywords = ["network", "framework", "async", "futures"]
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
use std::{
|
||||
cell::UnsafeCell, future::Future, marker, ops, pin::Pin, rc::Rc, task, task::Poll,
|
||||
};
|
||||
use std::{cell::UnsafeCell, future::Future, marker, pin::Pin, rc::Rc, task, task::Poll};
|
||||
|
||||
use crate::{Service, ServiceFactory};
|
||||
|
||||
|
@ -73,6 +71,11 @@ impl<S> Container<S> {
|
|||
}
|
||||
}
|
||||
|
||||
/// Return reference to inner type
|
||||
pub fn get_ref(&self) -> &S {
|
||||
self.svc.as_ref()
|
||||
}
|
||||
|
||||
#[inline]
|
||||
/// Returns `Ready` when the service is able to process requests.
|
||||
pub fn poll_ready<R>(&self, cx: &mut task::Context<'_>) -> Poll<Result<(), S::Error>>
|
||||
|
@ -142,15 +145,6 @@ impl<S> From<S> for Container<S> {
|
|||
}
|
||||
}
|
||||
|
||||
impl<S> ops::Deref for Container<S> {
|
||||
type Target = S;
|
||||
|
||||
#[inline]
|
||||
fn deref(&self) -> &S {
|
||||
self.svc.as_ref()
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, S: ?Sized> ServiceCtx<'a, S> {
|
||||
pub(crate) fn new(waiters: &'a Waiters) -> Self {
|
||||
Self {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue