pub struct Widget {
pub flags: i32,
pub first: Option<Box<thingy>>,
pub u: WidgetImpl,
}Fields§
§flags: i32flags (see below).
first: Option<Box<thingy>>`first’ thingy that names this widget.
u: WidgetImplTagged equivalent of the C anonymous union (zle.h:194-202).
Implementations§
Source§impl widget
impl widget
Sourcepub fn internal(name: &str, func: fn(&[String]) -> i32, flags: i32) -> widget
pub fn internal(name: &str, func: fn(&[String]) -> i32, flags: i32) -> widget
Build a widget that points at a Rust function pointer with the
supplied ZLE flags. Equivalent to the WIDGET_INT branch of
zalloc(sizeof(*w)) + w->u.fn = ... in addzlefunction() at
Src/Zle/zle_thingy.c:281.
Sourcepub fn builtin(name: &str) -> widget
pub fn builtin(name: &str) -> widget
Resolve a built-in widget name to its canonical fn pointer
via zle_bindings::iwidget_lookup. Mirrors the dispatch C
achieves at Src/Zle/zle_bindings.c:55-60 through the
generated widgets[] static table; the Rust port uses a
name → fn-pointer match keyed off the same iwidgets.list
canonical names. Unknown widget names get a no-op fn
pointer (matches what t_undefinedkey resolves to).
Sourcepub fn user_defined(name: &str, func_name: &str) -> widget
pub fn user_defined(name: &str, func_name: &str) -> widget
Build a widget that wraps a user-defined shell function.
Equivalent to bin_zle_new() from Src/Zle/zle_thingy.c:584.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for widget
impl RefUnwindSafe for widget
impl Send for widget
impl Sync for widget
impl Unpin for widget
impl UnsafeUnpin for widget
impl UnwindSafe for widget
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
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 moreSource§impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
fn into_sample(self) -> T
Source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.Source§impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
Source§fn to_owned_obj(&self, data: FontData<'_>) -> U
fn to_owned_obj(&self, data: FontData<'_>) -> U
T, using the provided data to resolve any offsets.