pub struct SimpleViewSet { /* private fields */ }Expand description
Simple ViewSet for testing without middleware
Implementations§
Trait Implementations§
Source§impl Clone for SimpleViewSet
impl Clone for SimpleViewSet
Source§fn clone(&self) -> SimpleViewSet
fn clone(&self) -> SimpleViewSet
Returns a duplicate of the value. Read more
1.0.0 · 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 SimpleViewSet
impl Debug for SimpleViewSet
Source§impl ViewSet for SimpleViewSet
impl ViewSet for SimpleViewSet
Source§fn get_basename(&self) -> &str
fn get_basename(&self) -> &str
Get the basename for URL routing
Source§fn dispatch<'life0, 'async_trait>(
&'life0 self,
_request: Request,
_action: Action,
) -> Pin<Box<dyn Future<Output = Result<Response>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn dispatch<'life0, 'async_trait>(
&'life0 self,
_request: Request,
_action: Action,
) -> Pin<Box<dyn Future<Output = Result<Response>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Dispatch request to appropriate action
Source§fn get_lookup_field(&self) -> &str
fn get_lookup_field(&self) -> &str
Get the lookup field for detail routes
Defaults to “id” if not overridden
Source§fn get_extra_actions(&self) -> Vec<ActionMetadata>
fn get_extra_actions(&self) -> Vec<ActionMetadata>
Dispatch request with dependency injection context Read more
Source§fn get_extra_action_url_map(&self) -> HashMap<String, String>
fn get_extra_action_url_map(&self) -> HashMap<String, String>
Get URL map for extra actions
Returns empty map for uninitialized ViewSets
Source§fn get_current_base_url(&self) -> Option<String>
fn get_current_base_url(&self) -> Option<String>
Get current base URL (only available after initialization)
Source§fn reverse_action(
&self,
_action_name: &str,
_args: &[&str],
) -> Result<String, Error>
fn reverse_action( &self, _action_name: &str, _args: &[&str], ) -> Result<String, Error>
Reverse an action name to a URL
Source§fn get_middleware(&self) -> Option<Arc<dyn ViewSetMiddleware>>
fn get_middleware(&self) -> Option<Arc<dyn ViewSetMiddleware>>
Get middleware for this ViewSet
Returns None if no middleware is configured
Source§fn requires_login(&self) -> bool
fn requires_login(&self) -> bool
Check if login is required for this ViewSet
Source§fn get_required_permissions(&self) -> Vec<String>
fn get_required_permissions(&self) -> Vec<String>
Get required permissions for this ViewSet
Auto Trait Implementations§
impl Freeze for SimpleViewSet
impl RefUnwindSafe for SimpleViewSet
impl Send for SimpleViewSet
impl Sync for SimpleViewSet
impl Unpin for SimpleViewSet
impl UnsafeUnpin for SimpleViewSet
impl UnwindSafe for SimpleViewSet
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,
Source§impl<V> InjectableViewSet for Vwhere
V: ViewSet,
impl<V> InjectableViewSet for Vwhere
V: ViewSet,
Source§fn resolve<'life0, 'life1, 'async_trait, T>(
&'life0 self,
request: &'life1 Request,
) -> Pin<Box<dyn Future<Output = Result<T, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
T: Injectable + Clone + Send + Sync + 'static + 'async_trait,
Self: Sync + 'async_trait,
fn resolve<'life0, 'life1, 'async_trait, T>(
&'life0 self,
request: &'life1 Request,
) -> Pin<Box<dyn Future<Output = Result<T, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
T: Injectable + Clone + Send + Sync + 'static + 'async_trait,
Self: Sync + 'async_trait,
Resolve a dependency from the request’s DI context with caching Read more
Source§fn resolve_uncached<'life0, 'life1, 'async_trait, T>(
&'life0 self,
request: &'life1 Request,
) -> Pin<Box<dyn Future<Output = Result<T, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
T: Injectable + Clone + Send + Sync + 'static + 'async_trait,
Self: Sync + 'async_trait,
fn resolve_uncached<'life0, 'life1, 'async_trait, T>(
&'life0 self,
request: &'life1 Request,
) -> Pin<Box<dyn Future<Output = Result<T, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
T: Injectable + Clone + Send + Sync + 'static + 'async_trait,
Self: Sync + 'async_trait,
Resolve a dependency from the request’s DI context without caching Read more
Source§fn try_resolve<'life0, 'life1, 'async_trait, T>(
&'life0 self,
request: &'life1 Request,
) -> Pin<Box<dyn Future<Output = Option<T>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
T: Injectable + Clone + Send + Sync + 'static + 'async_trait,
Self: Sync + 'async_trait,
fn try_resolve<'life0, 'life1, 'async_trait, T>(
&'life0 self,
request: &'life1 Request,
) -> Pin<Box<dyn Future<Output = Option<T>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
T: Injectable + Clone + Send + Sync + 'static + 'async_trait,
Self: Sync + 'async_trait,
Try to resolve a dependency, returning None if DI context is not available Read more
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>
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