@@ -58,6 +58,7 @@ use crate::{
58
58
prelude:: * ,
59
59
translate:: * ,
60
60
types:: { Pointee , Pointer , Type } ,
61
+ GStr ,
61
62
} ;
62
63
63
64
// rustdoc-stripper-ignore-next
@@ -537,6 +538,33 @@ impl Value {
537
538
unsafe { Value :: from_type_unchecked ( T :: Type :: static_type ( ) ) }
538
539
}
539
540
541
+ // rustdoc-stripper-ignore-next
542
+ /// Creates a new `String`-typed `Value` from a `'static` string.
543
+ #[ inline]
544
+ #[ doc( alias = "g_value_set_static_string" ) ]
545
+ pub fn from_static_str ( s : & ' static GStr ) -> Self {
546
+ unsafe {
547
+ let mut v = Self :: from_type_unchecked ( Type :: STRING ) ;
548
+ gobject_ffi:: g_value_set_static_string ( v. to_glib_none_mut ( ) . 0 , s. as_ptr ( ) ) ;
549
+ v
550
+ }
551
+ }
552
+
553
+ #[ cfg( feature = "v2_66" ) ]
554
+ #[ cfg_attr( docsrs, doc( cfg( feature = "v2_66" ) ) ) ]
555
+ // rustdoc-stripper-ignore-next
556
+ /// Creates a new `String`-typed `Value` from a `'static` string that is also assumed to be
557
+ /// interned.
558
+ #[ inline]
559
+ #[ doc( alias = "g_value_set_interned_string" ) ]
560
+ pub fn from_interned_str ( s : & ' static GStr ) -> Self {
561
+ unsafe {
562
+ let mut v = Self :: from_type_unchecked ( Type :: STRING ) ;
563
+ gobject_ffi:: g_value_set_interned_string ( v. to_glib_none_mut ( ) . 0 , s. as_ptr ( ) ) ;
564
+ v
565
+ }
566
+ }
567
+
540
568
// rustdoc-stripper-ignore-next
541
569
/// Tries to get a value of type `T`.
542
570
///
0 commit comments