Struct vfs::directory::entry::OpenRequest
source · 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.