File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ use std::ptr;
15
15
// #[cfg(windows)]
16
16
// #[cfg(feature = "v2_58")]
17
17
// use std::os::windows::io::AsRawHandle;
18
- use crate :: { translate:: * , GStr } ;
18
+ use crate :: { translate:: * , ChecksumType , GStr } ;
19
19
#[ cfg( not( windows) ) ]
20
20
use crate :: { Error , Pid , SpawnFlags } ;
21
21
@@ -222,6 +222,20 @@ pub fn charset() -> (bool, Option<&'static GStr>) {
222
222
}
223
223
}
224
224
225
+ #[ doc( alias = "g_compute_checksum_for_string" ) ]
226
+ pub fn compute_checksum_for_string (
227
+ checksum_type : ChecksumType ,
228
+ str : impl IntoGStr ,
229
+ ) -> Option < crate :: GString > {
230
+ str. run_with_gstr ( |str| unsafe {
231
+ from_glib_full ( ffi:: g_compute_checksum_for_string (
232
+ checksum_type. into_glib ( ) ,
233
+ str. as_ptr ( ) ,
234
+ str. len ( ) as _ ,
235
+ ) )
236
+ } )
237
+ }
238
+
225
239
#[ cfg( unix) ]
226
240
#[ doc( alias = "g_unix_open_pipe" ) ]
227
241
pub fn unix_open_pipe ( flags : i32 ) -> Result < ( RawFd , RawFd ) , Error > {
You can’t perform that action at this time.
0 commit comments