File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -289,6 +289,39 @@ impl GStr {
289289 }
290290 }
291291 pub const NONE : Option < & ' static GStr > = None ;
292+
293+ // rustdoc-stripper-ignore-next
294+ /// Interns the string and returns the canonical representation.
295+ #[ inline]
296+ #[ doc( alias = "g_intern_string" ) ]
297+ pub fn intern ( & self ) -> & ' static GStr {
298+ unsafe {
299+ let s = ffi:: g_intern_string ( self . to_glib_none ( ) . 0 ) ;
300+ GStr :: from_ptr ( s)
301+ }
302+ }
303+
304+ // rustdoc-stripper-ignore-next
305+ /// Interns the `'static` string and returns the canonical representation.
306+ #[ inline]
307+ #[ doc( alias = "g_intern_static_string" ) ]
308+ pub fn intern_static ( & ' static self ) -> & ' static GStr {
309+ unsafe {
310+ let s = ffi:: g_intern_static_string ( self . to_glib_none ( ) . 0 ) ;
311+ GStr :: from_ptr ( s)
312+ }
313+ }
314+
315+ // rustdoc-stripper-ignore-next
316+ /// Interns the string and returns the canonical representation.
317+ #[ inline]
318+ #[ doc( alias = "g_intern_string" ) ]
319+ pub fn intern_from_str ( s : impl AsRef < str > ) -> & ' static GStr {
320+ unsafe {
321+ let s = ffi:: g_intern_string ( s. as_ref ( ) . to_glib_none ( ) . 0 ) ;
322+ GStr :: from_ptr ( s)
323+ }
324+ }
292325}
293326
294327// rustdoc-stripper-ignore-next
You can’t perform that action at this time.
0 commit comments