Struct net::filemanager_thread::FileManager
source · pub struct FileManager {
embedder_proxy: EmbedderProxy,
store: Arc<FileManagerStore>,
thread_pool: Weak<CoreResourceThreadPool>,
}
Fields§
§embedder_proxy: EmbedderProxy
§store: Arc<FileManagerStore>
§thread_pool: Weak<CoreResourceThreadPool>
Implementations§
source§impl FileManager
impl FileManager
pub fn new( embedder_proxy: EmbedderProxy, pool_handle: Weak<CoreResourceThreadPool>, ) -> FileManager
pub fn read_file( &self, sender: IpcSender<FileManagerResult<ReadFileProgress>>, id: Uuid, origin: FileOrigin, )
pub fn get_token_for_file(&self, file_id: &Uuid) -> FileTokenCheck
pub fn invalidate_token(&self, token: &FileTokenCheck, file_id: &Uuid)
sourcepub fn fetch_file(
&self,
done_sender: &mut TokioSender<Data>,
cancellation_listener: Arc<Mutex<CancellationListener>>,
id: Uuid,
file_token: &FileTokenCheck,
origin: FileOrigin,
response: &mut Response,
range: RangeRequestBounds,
) -> Result<(), BlobURLStoreError>
pub fn fetch_file( &self, done_sender: &mut TokioSender<Data>, cancellation_listener: Arc<Mutex<CancellationListener>>, id: Uuid, file_token: &FileTokenCheck, origin: FileOrigin, response: &mut Response, range: RangeRequestBounds, ) -> Result<(), BlobURLStoreError>
Read a file for the Fetch implementation. It gets the required headers synchronously and reads the actual content in a separate thread.
pub fn promote_memory( &self, id: Uuid, blob_buf: BlobBuf, set_valid: bool, origin: FileOrigin, )
sourcepub fn handle(&self, msg: FileManagerThreadMsg)
pub fn handle(&self, msg: FileManagerThreadMsg)
Message handler
pub fn fetch_file_in_chunks( &self, done_sender: &mut TokioSender<Data>, reader: BufReader<File>, res_body: ServoArc<Mutex<ResponseBody>>, cancellation_listener: Arc<Mutex<CancellationListener>>, range: RelativePos, )
fn fetch_blob_buf( &self, done_sender: &mut TokioSender<Data>, cancellation_listener: Arc<Mutex<CancellationListener>>, id: &Uuid, file_token: &FileTokenCheck, origin_in: &FileOrigin, range: RangeRequestBounds, response: &mut Response, ) -> Result<(), BlobURLStoreError>
Trait Implementations§
source§impl Clone for FileManager
impl Clone for FileManager
source§fn clone(&self) -> FileManager
fn clone(&self) -> FileManager
Returns a copy 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 moreAuto Trait Implementations§
impl Freeze for FileManager
impl !RefUnwindSafe for FileManager
impl Send for FileManager
impl !Sync for FileManager
impl Unpin for FileManager
impl !UnwindSafe for FileManager
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> 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 moresource§impl<T> MaybeBoxed<Box<T>> for T
impl<T> MaybeBoxed<Box<T>> for T
source§fn maybe_boxed(self) -> Box<T>
fn maybe_boxed(self) -> Box<T>
Convert
source§impl<T> MaybeBoxed<T> for T
impl<T> MaybeBoxed<T> for T
source§fn maybe_boxed(self) -> T
fn maybe_boxed(self) -> T
Convert