{"record":{"id":"e06ccdb699ac81af","repo":"bevyengine/bevy","slug":"the-reader-returned-by-the-current-assetreader","errorCode":null,"errorMessage":"The `Reader` returned by the current `AssetReader` does not support `AsyncSeek` behavior.","messagePattern":"The `Reader` returned by the current `AssetReader` does not support `AsyncSeek` behavior\\.","errorType":"exception","errorClass":"ReaderNotSeekableError","httpStatus":null,"severity":"error","filePath":"crates/bevy_asset/src/io/mod.rs","lineNumber":156,"sourceCode":"    ///         &mut fallback_reader\n    ///     }\n    /// };\n    /// reader.seek(SeekFrom::Start(10)).await.unwrap();\n    /// # };\n    /// ```\n    fn seekable(&mut self) -> Result<&mut dyn SeekableReader, ReaderNotSeekableError>;\n}\n\n/// A [`Reader`] that also has [`AsyncSeek`] functionality.\n/// See [`Reader::seekable`] for details.\npub trait SeekableReader: Reader + AsyncSeek {}\n\nimpl<T: Reader + AsyncSeek> SeekableReader for T {}\n\n/// Error returned by [`Reader::seekable`] when the reader implementation does not support [`AsyncSeek`] behavior.\n#[derive(Error, Debug, Copy, Clone)]\n#[error(\n    \"The `Reader` returned by the current `AssetReader` does not support `AsyncSeek` behavior.\"\n)]\npub struct ReaderNotSeekableError;\n\nimpl Reader for Box<dyn Reader + '_> {\n    fn read_to_end<'a>(\n        &'a mut self,\n        buf: &'a mut Vec<u8>,\n    ) -> StackFuture<'a, std::io::Result<usize>, STACK_FUTURE_SIZE> {\n        (**self).read_to_end(buf)\n    }\n\n    fn seekable(&mut self) -> Result<&mut dyn SeekableReader, ReaderNotSeekableError> {\n        (**self).seekable()\n    }\n}\n\n/// A future that returns a value or an [`AssetReaderError`]\npub trait AssetReaderFuture:","sourceCodeStart":138,"sourceCodeEnd":174,"githubUrl":"https://github.com/bevyengine/bevy/blob/396ca727080776bd313bb892423b7d94e03b81b4/crates/bevy_asset/src/io/mod.rs#L138-L174","documentation":"ReaderNotSeekableError: Reader::seekable() was called on a reader implementation that does not support AsyncSeek (e.g. streamed HTTP readers or other forward-only sources). Seeking backwards/forwards is unavailable, so consumers requiring random access cannot use this reader.","triggerScenarios":"Thrown at crates/bevy_asset/src/io/mod.rs:156 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Buffer the whole reader first and seek over the in-memory bytes","Choose an AssetReader backend that supports seeking (file/memory sources)","Handle the error and fall back to sequential reads when seeking is unavailable"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"396ca727080776bd313bb892423b7d94e03b81b4","analyzedAt":"2026-08-20T16:12:39.808Z","contentChangedAt":"2026-08-20T16:12:39.808Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}