pub struct OpenRequest<'a> { /* private fields */ }
Expand description
An open request.
Implementations§
Source§impl<'a> OpenRequest<'a>
impl<'a> OpenRequest<'a>
Sourcepub fn new(
scope: ExecutionScope,
request_flags: impl Into<RequestFlags>,
path: Path,
object_request: ObjectRequestRef<'a>,
) -> Self
pub fn new( scope: ExecutionScope, request_flags: impl Into<RequestFlags>, path: Path, object_request: ObjectRequestRef<'a>, ) -> Self
Creates a new open request.
Sourcepub fn prepend_path(&mut self, prefix: &Path)
pub fn prepend_path(&mut self, prefix: &Path)
Prepends prefix
to the path.
Sourcepub async fn wait_till_ready(&self) -> bool
pub async fn wait_till_ready(&self) -> bool
Waits until the request has a request waiting in its channel. Returns immediately if this
request requires sending an initial event such as OnOpen or OnRepresentation. Returns
true
if the channel is readable (rather than just clased).
Sourcepub fn requires_event(&self) -> bool
pub fn requires_event(&self) -> bool
Returns true
if the request requires the server to send an event (e.g. either OnOpen or
OnRepresentation). If true
, wait_till_ready
will return immediately. If false
, the
caller might choose to call wait_till_ready
if other conditions are satisfied (checking
for an empty path is usually a good idea since it is hard to know where a non-empty path
might end up being terminated).
Sourcepub fn open_service(self, service: Arc<impl ServiceLike>) -> Result<(), Status>
pub fn open_service(self, service: Arc<impl ServiceLike>) -> Result<(), Status>
Opens a service.
Sourcepub fn open_remote(
self,
remote: Arc<impl RemoteLike + Send + Sync + 'static>,
) -> Result<(), Status>
pub fn open_remote( self, remote: Arc<impl RemoteLike + Send + Sync + 'static>, ) -> Result<(), Status>
Forwards the request to a remote.
Sourcepub fn spawn(self, entry: Arc<impl DirectoryEntryAsync>)
pub fn spawn(self, entry: Arc<impl DirectoryEntryAsync>)
Spawns a task to handle the request. entry
must implement DirectoryEntryAsync.
Sourcepub fn scope(&self) -> &ExecutionScope
pub fn scope(&self) -> &ExecutionScope
Returns the execution scope for this request.
Sourcepub fn set_scope(&mut self, scope: ExecutionScope)
pub fn set_scope(&mut self, scope: ExecutionScope)
Replaces the scope in this request. This is the right thing to do if any subsequently spawned tasks should be in a different scope to the task that received this open request.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for OpenRequest<'a>
impl<'a> !RefUnwindSafe for OpenRequest<'a>
impl<'a> Send for OpenRequest<'a>
impl<'a> Sync for OpenRequest<'a>
impl<'a> Unpin for OpenRequest<'a>
impl<'a> !UnwindSafe for OpenRequest<'a>
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, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
Source§impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
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