Struct gdnative::prelude::nativescript::PropertyBuilder [−][src]
Builder type used to register a property on a NativeClass
.
Implementations
impl<'a, C, T, S, G> PropertyBuilder<'a, C, T, S, G> where
C: NativeClass,
T: Export,
G: RawGetter<C, T>,
S: RawSetter<C, T>,
[src]
C: NativeClass,
T: Export,
G: RawGetter<C, T>,
S: RawSetter<C, T>,
pub fn done(self)
[src]
Register the property built with this builder.
pub fn with_setter<NS>(
self,
setter: NS
) -> PropertyBuilder<'a, C, T, Setter<Mut, NS>, G> where
Setter<Mut, NS>: RawSetter<C, T>,
[src]
self,
setter: NS
) -> PropertyBuilder<'a, C, T, Setter<Mut, NS>, G> where
Setter<Mut, NS>: RawSetter<C, T>,
Provides a setter function with the signature fn(&mut C, owner: C::Base, value: T)
where C
is the NativeClass
type being registered and T
is the type of the property.
pub fn with_shr_setter<NS>(
self,
setter: NS
) -> PropertyBuilder<'a, C, T, Setter<Shr, NS>, G> where
Setter<Shr, NS>: RawSetter<C, T>,
[src]
self,
setter: NS
) -> PropertyBuilder<'a, C, T, Setter<Shr, NS>, G> where
Setter<Shr, NS>: RawSetter<C, T>,
Provides a setter function with the signature fn(&C, owner: C::Base, value: T)
where C
is the NativeClass
type being registered and T
is the type of the property.
pub fn with_getter<NG>(
self,
getter: NG
) -> PropertyBuilder<'a, C, T, S, Getter<Shr, Owned, NG>> where
Getter<Shr, Owned, NG>: RawGetter<C, T>,
[src]
self,
getter: NG
) -> PropertyBuilder<'a, C, T, S, Getter<Shr, Owned, NG>> where
Getter<Shr, Owned, NG>: RawGetter<C, T>,
Provides a getter function with the signature fn(&C, owner: C::Base) -> T
,
where C
is the NativeClass
type being registered and T
is the type of the property.
pub fn with_ref_getter<NG>(
self,
getter: NG
) -> PropertyBuilder<'a, C, T, S, Getter<Shr, Ref, NG>> where
Getter<Shr, Ref, NG>: RawGetter<C, T>,
[src]
self,
getter: NG
) -> PropertyBuilder<'a, C, T, S, Getter<Shr, Ref, NG>> where
Getter<Shr, Ref, NG>: RawGetter<C, T>,
Provides a getter function with the signature fn(&C, owner: C::Base) -> &T
,
where C
is the NativeClass
type being registered and T
is the type of the property.
pub fn with_mut_getter<NG>(
self,
getter: NG
) -> PropertyBuilder<'a, C, T, S, Getter<Mut, Owned, NG>> where
Getter<Mut, Owned, NG>: RawGetter<C, T>,
[src]
self,
getter: NG
) -> PropertyBuilder<'a, C, T, S, Getter<Mut, Owned, NG>> where
Getter<Mut, Owned, NG>: RawGetter<C, T>,
Provides a getter function with the signature fn(&mut C, owner: C::Base) -> T
,
where C
is the NativeClass
type being registered and T
is the type of the property.
pub fn with_mut_ref_getter<NG>(
self,
getter: NG
) -> PropertyBuilder<'a, C, T, S, Getter<Mut, Ref, NG>> where
Getter<Mut, Ref, NG>: RawGetter<C, T>,
[src]
self,
getter: NG
) -> PropertyBuilder<'a, C, T, S, Getter<Mut, Ref, NG>> where
Getter<Mut, Ref, NG>: RawGetter<C, T>,
Provides a getter function with the signature fn(&mut C, owner: C::Base) -> &T
,
where C
is the NativeClass
type being registered and T
is the type of the property.
pub fn with_default(self, default: T) -> PropertyBuilder<'a, C, T, S, G>
[src]
Sets a default value for the property as a hint to the editor. The setter may or may not be actually called with this value.
pub fn with_hint(
self,
hint: <T as Export>::Hint
) -> PropertyBuilder<'a, C, T, S, G>
[src]
self,
hint: <T as Export>::Hint
) -> PropertyBuilder<'a, C, T, S, G>
Sets an editor hint.
pub fn with_usage(self, usage: Usage) -> PropertyBuilder<'a, C, T, S, G>
[src]
Sets a property usage.
Trait Implementations
impl<'a, C, T, S, G> Debug for PropertyBuilder<'a, C, T, S, G> where
C: Debug,
T: Export + Debug,
G: Debug,
S: Debug,
<T as Export>::Hint: Debug,
[src]
C: Debug,
T: Export + Debug,
G: Debug,
S: Debug,
<T as Export>::Hint: Debug,
Auto Trait Implementations
impl<'a, C, T, S, G> RefUnwindSafe for PropertyBuilder<'a, C, T, S, G> where
C: RefUnwindSafe,
G: RefUnwindSafe,
S: RefUnwindSafe,
T: RefUnwindSafe,
<T as Export>::Hint: RefUnwindSafe,
[src]
C: RefUnwindSafe,
G: RefUnwindSafe,
S: RefUnwindSafe,
T: RefUnwindSafe,
<T as Export>::Hint: RefUnwindSafe,
impl<'a, C, T, S = InvalidSetter<'a>, G = InvalidGetter<'a>> !Send for PropertyBuilder<'a, C, T, S, G>
[src]
impl<'a, C, T, S = InvalidSetter<'a>, G = InvalidGetter<'a>> !Sync for PropertyBuilder<'a, C, T, S, G>
[src]
impl<'a, C, T, S, G> Unpin for PropertyBuilder<'a, C, T, S, G> where
G: Unpin,
S: Unpin,
T: Unpin,
<T as Export>::Hint: Unpin,
[src]
G: Unpin,
S: Unpin,
T: Unpin,
<T as Export>::Hint: Unpin,
impl<'a, C, T, S, G> UnwindSafe for PropertyBuilder<'a, C, T, S, G> where
C: RefUnwindSafe,
G: UnwindSafe,
S: UnwindSafe,
T: UnwindSafe,
<T as Export>::Hint: UnwindSafe,
[src]
C: RefUnwindSafe,
G: UnwindSafe,
S: UnwindSafe,
T: UnwindSafe,
<T as Export>::Hint: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,