Struct starlark::environment::MethodsStatic
source · pub struct MethodsStatic(/* private fields */);
Expand description
Similar to GlobalsStatic
, but for methods.
Implementations§
source§impl MethodsStatic
impl MethodsStatic
sourcepub const fn new() -> Self
pub const fn new() -> Self
Create a new MethodsStatic
.
sourcepub fn methods(
&'static self,
x: impl FnOnce(&mut MethodsBuilder)
) -> Option<&'static Methods>
pub fn methods( &'static self, x: impl FnOnce(&mut MethodsBuilder) ) -> Option<&'static Methods>
Populate the globals with a builder function. Always returns Some
, but using this API
to be a better fit for StarlarkValue.get_methods
.
sourcepub fn populate(
&'static self,
x: impl FnOnce(&mut MethodsBuilder),
out: &mut MethodsBuilder
)
pub fn populate( &'static self, x: impl FnOnce(&mut MethodsBuilder), out: &mut MethodsBuilder )
Move all the globals in this GlobalsBuilder
into a new one. All variables will
only be allocated once (ensuring things like function comparison works properly).
Auto Trait Implementations§
impl !RefUnwindSafe for MethodsStatic
impl Send for MethodsStatic
impl Sync for MethodsStatic
impl Unpin for MethodsStatic
impl !UnwindSafe for MethodsStatic
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more