Add ftruncate method to Handle struct in tokio_epoll_uring_ext.rs

Co-Authored-By: christian@neon.tech <christian@neon.tech>
This commit is contained in:
Devin AI
2025-05-08 12:26:18 +00:00
parent ae051e647a
commit 5d9422488a

View File

@@ -198,3 +198,13 @@ impl std::ops::Deref for Handle {
.expect("must be already initialized when using this")
}
}
impl Handle {
pub async fn ftruncate<F: tokio_epoll_uring::IoFd + Send>(
&self,
file: F,
len: u64,
) -> (F, Result<(), tokio_epoll_uring::Error<std::io::Error>>) {
self.deref().ftruncate(file, len).await
}
}