larksuite / rsmpeg

A Rust crate that exposes FFmpeg's power as much as possible.
https://docs.rs/rsmpeg/latest/rsmpeg/
MIT License
678 stars 41 forks source link

why not export "mod shared"? #59

Closed imxood closed 3 years ago

imxood commented 3 years ago

mod shared; in src/lib.rs why isn't it pub mod shared;

sometimes, i need use ffi function, so i need write custom safe function to call unsafe ffi function.

for example:

if there is pub mod shared; I can use rsmpeg::shared::{RetUpgrade, RsmpegPointerUpgrade};

image

ldm0 commented 3 years ago

The reason I haven't export mod shared is that I think it's not general enough to be used in other crates. These traits are not self-explained enough, which means users need to read the code carefully to understand what they do. And they aren't stable, maybe changed after times. If you really want to use them, you can copy these traits into your own project.

imxood commented 3 years ago

The reason I haven't export mod shared is that I think it's not general enough to be used in other crates. These traits are not self-explained enough, which means users need to read the code carefully to understand what they do. And they aren't stable, maybe changed after times. If you really want to use them, you can copy these traits into your own project.

这几个 upgrade 非常好用, 配合 Result ? 的用法, 和anyhow一起, 非常简单和方便的, 代码看着也很美观 导出 shared mod 是很不错的选择