pub struct MjsFrame { /* private fields */ }Expand description
Implementations§
Source§impl MjsFrame
impl MjsFrame
Sourcepub fn try_add_body(&mut self) -> Result<&mut MjsBody, MjEditError>
👎Deprecated since 6.0.0: always returns Ok; use the panicking variant
pub fn try_add_body(&mut self) -> Result<&mut MjsBody, MjEditError>
always returns Ok; use the panicking variant
Fallible version of Self::add_body.
§Note
mjs_addBody allocates with C++ new, which ends the process instead of returning null, so this never returns Err. Prefer Self::add_body.
§Errors
Returns MjEditError::AllocationFailed when MuJoCo fails to allocate the element.
Sourcepub fn try_add_site(&mut self) -> Result<&mut MjsSite, MjEditError>
👎Deprecated since 6.0.0: always returns Ok; use the panicking variant
pub fn try_add_site(&mut self) -> Result<&mut MjsSite, MjEditError>
always returns Ok; use the panicking variant
Fallible version of Self::add_site.
§Note
mjs_addSite allocates with C++ new, which ends the process instead of returning null, so this never returns Err. Prefer Self::add_site.
§Errors
Returns MjEditError::AllocationFailed when MuJoCo fails to allocate the element.
Sourcepub fn try_add_joint(&mut self) -> Result<&mut MjsJoint, MjEditError>
👎Deprecated since 6.0.0: always returns Ok; use the panicking variant
pub fn try_add_joint(&mut self) -> Result<&mut MjsJoint, MjEditError>
always returns Ok; use the panicking variant
Fallible version of Self::add_joint.
§Note
mjs_addJoint allocates with C++ new, which ends the process instead of returning null, so this never returns Err. Prefer Self::add_joint.
§Errors
Returns MjEditError::AllocationFailed when MuJoCo fails to allocate the element.
Sourcepub fn try_add_geom(&mut self) -> Result<&mut MjsGeom, MjEditError>
👎Deprecated since 6.0.0: always returns Ok; use the panicking variant
pub fn try_add_geom(&mut self) -> Result<&mut MjsGeom, MjEditError>
always returns Ok; use the panicking variant
Fallible version of Self::add_geom.
§Note
mjs_addGeom allocates with C++ new, which ends the process instead of returning null, so this never returns Err. Prefer Self::add_geom.
§Errors
Returns MjEditError::AllocationFailed when MuJoCo fails to allocate the element.
Sourcepub fn add_camera(&mut self) -> &mut MjsCamera
pub fn add_camera(&mut self) -> &mut MjsCamera
Sourcepub fn try_add_camera(&mut self) -> Result<&mut MjsCamera, MjEditError>
👎Deprecated since 6.0.0: always returns Ok; use the panicking variant
pub fn try_add_camera(&mut self) -> Result<&mut MjsCamera, MjEditError>
always returns Ok; use the panicking variant
Fallible version of Self::add_camera.
§Note
mjs_addCamera allocates with C++ new, which ends the process instead of returning null, so this never returns Err. Prefer Self::add_camera.
§Errors
Returns MjEditError::AllocationFailed when MuJoCo fails to allocate the element.
Sourcepub fn try_add_light(&mut self) -> Result<&mut MjsLight, MjEditError>
👎Deprecated since 6.0.0: always returns Ok; use the panicking variant
pub fn try_add_light(&mut self) -> Result<&mut MjsLight, MjEditError>
always returns Ok; use the panicking variant
Fallible version of Self::add_light.
§Note
mjs_addLight allocates with C++ new, which ends the process instead of returning null, so this never returns Err. Prefer Self::add_light.
§Errors
Returns MjEditError::AllocationFailed when MuJoCo fails to allocate the element.
Sourcepub fn alt(&self) -> &MjsOrientation
pub fn alt(&self) -> &MjsOrientation
Return an immutable reference to alternative orientation.
Sourcepub fn alt_mut(&mut self) -> &mut MjsOrientation
pub fn alt_mut(&mut self) -> &mut MjsOrientation
Return a mutable reference to alternative orientation.
Sourcepub fn with_pos(&mut self, value: [f64; 3]) -> &mut Self
pub fn with_pos(&mut self, value: [f64; 3]) -> &mut Self
Builder method for setting frame position.
Sourcepub fn with_quat(&mut self, value: [f64; 4]) -> &mut Self
pub fn with_quat(&mut self, value: [f64; 4]) -> &mut Self
Builder method for setting frame orientation.
Sourcepub fn with_alt(&mut self, value: MjsOrientation) -> &mut Self
pub fn with_alt(&mut self, value: MjsOrientation) -> &mut Self
Builder method for setting alternative orientation.
Sourcepub fn childclass(&self) -> &str
pub fn childclass(&self) -> &str
Sourcepub fn set_childclass(&mut self, value: &str)
pub fn set_childclass(&mut self, value: &str)
Sourcepub fn with_childclass(&mut self, value: &str) -> &mut Self
pub fn with_childclass(&mut self, value: &str) -> &mut Self
Builder method for setting childclass name.
§Panics
When the value contains ‘\0’ characters, a panic occurs.
Sourcepub fn try_add_frame(&mut self) -> Result<&mut MjsFrame, MjEditError>
👎Deprecated since 6.0.0: always returns Ok; use add_frame
pub fn try_add_frame(&mut self) -> Result<&mut MjsFrame, MjEditError>
always returns Ok; use add_frame
Fallible version of Self::add_frame.
§Note
MuJoCo ends the process when the allocation fails, so this never returns Err.
§Errors
Returns MjEditError::AllocationFailed when MuJoCo fails to allocate
the frame, instead of panicking.
Trait Implementations§
Source§impl SpecItem for MjsFrame
impl SpecItem for MjsFrame
Source§fn element_pointer(&self) -> *const mjsElement
fn element_pointer(&self) -> *const mjsElement
mjsElement that MuJoCo keeps behind the item. Read moreSource§fn element_mut_pointer(&mut self) -> *mut mjsElement
fn element_mut_pointer(&mut self) -> *mut mjsElement
SpecItem::element_pointer, but with a mutable borrow and a mutable pointer.Source§fn default(&self) -> Option<&MjsDefault>
fn default(&self) -> Option<&MjsDefault>
None when the element carries no default class name. Read moreSource§fn id(&self) -> Option<usize>
fn id(&self) -> Option<usize>
None when it has none yet (before
compilation, for example).Source§fn set_default(&mut self, class_name: &str) -> Result<(), MjEditError>
fn set_default(&mut self, class_name: &str) -> Result<(), MjEditError>
Source§fn with_default(&mut self, class_name: &str) -> Result<&mut Self, MjEditError>
fn with_default(&mut self, class_name: &str) -> Result<&mut Self, MjEditError>
Source§impl SpecObject for MjsFrame
impl SpecObject for MjsFrame
Source§const OBJ_TYPE: MjtObj = MjtObj::mjOBJ_FRAME
const OBJ_TYPE: MjtObj = MjtObj::mjOBJ_FRAME
mjtObj discriminant passed to mjs_firstElement / mjs_firstChild.Source§unsafe fn from_element_as_ptr_mut(element: *mut mjsElement) -> *mut Self
unsafe fn from_element_as_ptr_mut(element: *mut mjsElement) -> *mut Self
Auto Trait Implementations§
impl !Send for MjsFrame
impl !Sync for MjsFrame
impl !Unpin for MjsFrame
impl Freeze for MjsFrame
impl RefUnwindSafe for MjsFrame
impl UnsafeUnpin for MjsFrame
impl UnwindSafe for MjsFrame
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more