Skip to main content

RuntimeResource

Struct RuntimeResource 

Source
pub struct RuntimeResource {
Show 34 fields pub slug: String, pub title: String, pub singular: String, pub per_page: i64, pub fields: Vec<FieldDef>, pub columns: Vec<ColumnDef>, pub data: Arc<dyn RuntimeData>, pub navigation_label: Option<String>, pub navigation_group: Option<String>, pub navigation_sort: Option<i32>, pub navigation_parent_item: Option<String>, pub navigation_parent_items: Vec<String>, pub should_register_navigation: bool, pub navigation_icon: Option<String>, pub navigation_create_item: bool, pub navigation_create_label: Option<String>, pub conditions: FieldConditions, pub form_layout: FormLayout, pub tabs: Vec<Tab>, pub default_active_tab: Option<String>, pub column_badges: ColumnBadges, pub tab_counts_follow_search: bool, pub hide_empty_tabs: bool, pub row_actions: Vec<RowAction>, pub bulk_actions: Vec<BulkAction>, pub hide_default_delete_when: Option<ListFilter>, pub repeaters: Repeaters, pub read_only: Option<FormRule>, pub read_only_notice: Option<FormNotice>, pub record_route_key_name: Option<String>, pub redirect_after_create: Option<RedirectAfter>, pub redirect_after_update: Option<RedirectAfter>, pub abilities: BTreeMap<ResourceAction, String>, pub access_ability: Option<String>,
}
Expand description

A resource defined by data. Build it with new and the field and column methods, then add it to the panel with register_runtime.

Fields§

§slug: String

URL segment: "books" serves the resource at /admin/books. Lowercase letters, digits, - and _ only.

§title: String

Heading and navigation label: "Books".

§singular: String

The name of one record, for headings such as “New Book”.

§per_page: i64

Rows per page on the list view. The default is 20, as for a static resource.

§fields: Vec<FieldDef>

Form fields, in display order.

§columns: Vec<ColumnDef>

Table columns, in display order. Each column’s key is a field name.

§data: Arc<dyn RuntimeData>

Where the rows live.

§navigation_label: Option<String>

The label of the navigation entry, as Filament’s $navigationLabel. None, the default, is the title.

§navigation_group: Option<String>

The navigation group the resource is listed under, as Filament’s $navigationGroup. See IgniteResource::NAVIGATION_GROUP.

§navigation_sort: Option<i32>

The resource’s place in the navigation, as Filament’s $navigationSort: lower first. See IgniteResource::NAVIGATION_SORT.

§navigation_parent_item: Option<String>

The navigation entry the resource is listed under, as Filament’s $navigationParentItem: the parent’s label or slug. See IgniteResource::NAVIGATION_PARENT_ITEM.

§navigation_parent_items: Vec<String>

More navigation entries the resource is listed under, by label or slug. See IgniteResource::NAVIGATION_PARENT_ITEMS.

§should_register_navigation: bool

Whether the resource has a navigation entry, as Filament’s $shouldRegisterNavigation. The default is true. See IgniteResource::SHOULD_REGISTER_NAVIGATION.

§navigation_icon: Option<String>

The name of the navigation entry’s icon, such as post, as Filament’s $navigationIcon. See IgniteResource::NAVIGATION_ICON.

§navigation_create_item: bool

Whether the navigation entry lists a link to the create page. The default is true. See IgniteResource::NAVIGATION_CREATE_ITEM.

§navigation_create_label: Option<String>

The label of the create link. None, the default, is "Add new".

§conditions: FieldConditions

The conditions that show or hide the form’s fields, and the live fields, as Filament’s visible(), hidden() and live(). See FieldConditions.

§form_layout: FormLayout

The layout of the create and edit forms, as Filament’s layout components. See FormLayout. The default has none: the form renders as one card of fields.

§tabs: Vec<Tab>

The tabs of the list page, in display order, as Filament’s getTabs(). See IgniteResource::tabs. The default is none.

§default_active_tab: Option<String>

The key of the tab shown when the list has no tab parameter, as Filament’s getDefaultActiveTab(). None, the default, is the first tab.

§column_badges: ColumnBadges

The list columns shown as coloured badges, as Filament’s badge() and color(). See ColumnBadges. The default is none.

§tab_counts_follow_search: bool

Whether each tab’s count is for the current search. The default is false: a tab counts all its rows. See IgniteResource::tab_counts_follow_search.

§hide_empty_tabs: bool

Whether a tab whose count is 0 is left out, except the default tab and the tab shown. The default is true. See IgniteResource::hide_empty_tabs.

§row_actions: Vec<RowAction>

The actions on each row of the list page, in display order, as Filament’s recordActions(). See RowAction. The default is none.

§bulk_actions: Vec<BulkAction>

The actions on the records ticked in the list, as Filament’s toolbarActions(). See BulkAction. The default is none: the list has no checkboxes.

§hide_default_delete_when: Option<ListFilter>

The records whose built-in Delete button is hidden (and whose delete the panel refuses). See IgniteResource::hide_default_delete_when. The default is none.

§repeaters: Repeaters

The settings of the form’s repeaters and flexible content fields, by path, as Filament’s minItems(), maxItems() and itemLabel(). See Repeaters. The default has none: every repeater has the default settings.

§read_only: Option<FormRule>

The records the signed-in user may only view. See read_only_when. The default is none.

§read_only_notice: Option<FormNotice>

The line the form of a read-only record shows. See read_only_notice.

§record_route_key_name: Option<String>

The row key that addresses a record in the panel’s URLs, as Filament’s $recordRouteKeyName. None, the default, is the numeric id. See record_route_key_name.

§redirect_after_create: Option<RedirectAfter>

Where a successful create goes. None, the default, is the list page, as before 0.6.8. See redirect_after_create.

§redirect_after_update: Option<RedirectAfter>

Where a successful update goes. None, the default, is the list page, as before 0.6.8. See redirect_after_update.

§abilities: BTreeMap<ResourceAction, String>

The ability each action on the resource needs, when it is not <slug>.<action>. See ability. The default is none: every action needs its default.

§access_ability: Option<String>

The ability every action on the resource needs besides its own, if any. See access_ability.

Implementations§

Source§

impl RuntimeResource

Source

pub fn new( slug: impl Into<String>, title: impl Into<String>, singular: impl Into<String>, data: impl RuntimeData, ) -> Self

A resource at slug with no fields or columns yet, whose rows come from data.

Source

pub fn field(self, field: FieldDef) -> Self

Adds a form field after the others.

Source

pub fn column(self, column: ColumnDef) -> Self

Adds a list column after the others.

Source

pub fn per_page(self, per_page: i64) -> Self

Sets the rows per page of the list view.

Source

pub fn navigation_label(self, label: impl Into<String>) -> Self

Sets the label of the navigation entry, as Filament’s navigationLabel.

Source

pub fn navigation_group(self, group: impl Into<String>) -> Self

Lists the resource under the navigation group group, as Filament’s navigationGroup.

Source

pub fn navigation_sort(self, sort: i32) -> Self

Sets the resource’s place in the navigation, as Filament’s navigationSort: lower first.

Source

pub fn navigation_parent_item(self, parent: impl Into<String>) -> Self

Lists the resource under the navigation entry parent (its label or slug), as Filament’s navigationParentItem. See IgniteResource::NAVIGATION_PARENT_ITEM.

Source

pub fn navigation_parent_items<I>(self, parents: I) -> Self
where I: IntoIterator, I::Item: Into<String>,

Lists the resource under each of the navigation entries parents (labels or slugs) that the sidebar shows, as a taxonomy’s screen under every post type it is attached to. See IgniteResource::NAVIGATION_PARENT_ITEMS.

Source

pub fn should_register_navigation(self, listed: bool) -> Self

Whether the resource has a navigation entry, as Filament’s shouldRegisterNavigation. See IgniteResource::SHOULD_REGISTER_NAVIGATION.

Source

pub fn navigation_icon(self, name: impl Into<String>) -> Self

Sets the name of the navigation entry’s icon, as Filament’s navigationIcon: a name such as "post" or a custom post type’s own, which the admin theme maps to its icon. See IgniteResource::NAVIGATION_ICON.

Source

pub fn navigation_create_item(self, listed: bool) -> Self

Whether the navigation entry lists a link to the create page, under the entry, in its group. See IgniteResource::NAVIGATION_CREATE_ITEM.

Source

pub fn navigation_create_label(self, label: impl Into<String>) -> Self

Sets the label of the create link, such as "Add New Post". See IgniteResource::NAVIGATION_CREATE_LABEL.

Source

pub fn visible( self, field: impl Into<String>, rule: impl Fn(&FormContext<'_>) -> bool + Send + Sync + 'static, ) -> Self

Shows the field field only when rule holds, as Filament’s ->visible(). See FieldConditions::visible.

Source

pub fn hidden( self, field: impl Into<String>, rule: impl Fn(&FormContext<'_>) -> bool + Send + Sync + 'static, ) -> Self

Hides the field field when rule holds, as Filament’s ->hidden(). See FieldConditions::hidden.

Source

pub fn visible_on( self, field: impl Into<String>, operations: &[Operation], ) -> Self

Shows the field field only on the forms of operations, as Filament’s ->visibleOn().

Source

pub fn hidden_on( self, field: impl Into<String>, operations: &[Operation], ) -> Self

Hides the field field on the forms of operations, as Filament’s ->hiddenOn().

Source

pub fn live(self, field: impl Into<String>) -> Self

Makes the field field live, as Filament’s ->live(): a change to it in the browser shows the form’s fields again for the new value. See FieldConditions::live.

Source

pub fn default_value( self, field: impl Into<String>, value: impl Into<Value>, ) -> Self

Gives the field field the default value value on the create form, as Filament’s ->default(...); the edit form shows the stored value. See FieldConditions::default_value.

Source

pub fn default_with( self, field: impl Into<String>, rule: impl Fn(&FormContext<'_>) -> Value + Send + Sync + 'static, ) -> Self

Gives the field field a default computed from the create form’s state, as Filament’s ->default(fn (Get $get) => ...). See FieldConditions::default_with.

Source

pub fn slug_from( self, field: impl Into<String>, source: impl Into<String>, ) -> Self

Fills the field field with the slug of the field source until the user edits it, as Filament’s slug pattern. See FieldConditions::slug_from.

Source

pub fn slug_locked_when( self, field: impl Into<String>, rule: impl Fn(&FormContext<'_>) -> bool + Send + Sync + 'static, ) -> Self

Stops the slug field field from following its source on the edit form of a record with a stored slug, when rule holds, such as once the record is published. See FieldConditions::slug_locked_when.

Source

pub fn form_layout(self, layout: FormLayout) -> Self

Sets the layout of the create and edit forms: columns, sections and groups, as Filament’s layout components. See FormLayout.

Source

pub fn tab(self, tab: Tab) -> Self

Adds a tab to the list page after the others, as a Tab in Filament’s getTabs(). The RuntimeData list is given the active tab’s conditions in ListQuery::filter: apply them with ListFilter::apply or ListFilter::matches.

Source

pub fn default_active_tab(self, key: impl Into<String>) -> Self

Sets the tab shown when the list has no tab parameter, by its key, as Filament’s getDefaultActiveTab(). Without it, the first tab is shown.

Whether each tab’s count is for the current search. The default, false, counts all of a tab’s rows. See IgniteResource::tab_counts_follow_search.

Source

pub fn hide_empty_tabs(self, hide: bool) -> Self

Whether a tab whose count is 0 is left out, except the default tab and the tab shown. The default is true; false renders every tab. See IgniteResource::hide_empty_tabs.

Source

pub fn row_action(self, action: RowAction) -> Self

Adds an action on each row of the list, after the others, as an action in Filament’s recordActions(). See RowAction.

Source

pub fn bulk_action(self, action: BulkAction) -> Self

Adds an action on the records ticked in the list, as Filament’s BulkAction::make() in toolbarActions(). See BulkAction.

Source

pub fn hide_default_delete_when(self, filter: ListFilter) -> Self

Hides the built-in Delete button on the records that meet filter, and refuses their delete, such as ListFilter::new().where_eq("status", "trash") for a post in the trash. See IgniteResource::hide_default_delete_when.

Source

pub fn repeater( self, path: impl Into<String>, settings: RepeaterSettings, ) -> Self

Sets the settings of the repeater or flexible content field at path, such as "members", or "groups.rules" for the repeater rules inside each row of groups: its fewest and most rows, its row label and its buttons, as Filament’s Repeater methods. See RepeaterSettings.

Source

pub fn ability(self, action: ResourceAction, name: impl Into<String>) -> Self

Names the ability that allows action on the resource, in place of <slug>.<action>, as a Filament resource policy’s method checks the permission it chooses: such as ability(ResourceAction::Update, "edit_books") for a post type whose capability type is book, as WordPress maps edit_post to edit_books. The ability gates the resource as a whole (its list and navigation entry for ViewAny, its forms and saves for Create and Update, its delete for Delete); a Policy still decides each record. The panel registers the ability as a permission on the next signed-in request after the resource is registered (or at once with ignite_panel::register_runtime_permissions), so the Roles screen lists it without a restart. Several actions may share one ability.

Source

pub fn access_ability(self, name: impl Into<String>) -> Self

Requires the ability name for every action on the resource, besides each action’s own, as Filament’s canAccess() and WordPress’s manage_options for the settings screens: a user without it does not see the navigation entry and gets 403 on every route of the resource.

Source

pub fn record_route_key_name(self, key: impl Into<String>) -> Self

Addresses each record in the panel’s URLs by the row key key instead of the numeric id, as Filament’s $recordRouteKeyName: such as "key", so a post type’s edit form is at /admin/post-types/book/edit. The rows the list gives must have the key, as text or a number, and the data finds, updates and deletes them by it (RuntimeData::find_by_key_for, try_update_by_key_for and delete_by_key_for). A key that the form sets is usually locked after the first save with disabled_on, as WordPress keeps a post type’s key.

Source

pub fn redirect_after_create(self, redirect: RedirectAfter) -> Self

Where a successful create goes, as Filament’s getRedirectUrl() on the Create page and the panel’s resourceCreatePageRedirect(): RedirectAfter::Edit, Filament’s default, opens the new record’s edit page (the list, for a user who may not edit it), and RedirectAfter::List the list page. Without this call a create goes to the list, as in 0.6.7. A dashboard form widget comes back to the dashboard either way.

Source

pub fn redirect_after_update(self, redirect: RedirectAfter) -> Self

Where a successful update goes, as Filament’s getRedirectUrl() on the Edit page and the panel’s resourceEditPageRedirect(): RedirectAfter::Edit, Filament’s default, stays on the record’s edit page with the flash message, and RedirectAfter::List goes to the list page. Without this call an update goes to the list, as in 0.6.7.

Source

pub fn disabled( self, field: impl Into<String>, rule: impl Fn(&FormContext<'_>) -> bool + Send + Sync + 'static, ) -> Self

Shows the field field but does not let the user change it when rule holds, as Filament’s ->disabled(). A disabled field is not saved. See FieldConditions::disabled.

Source

pub fn disabled_on( self, field: impl Into<String>, operations: &[Operation], ) -> Self

Disables the field field on the forms of operations, as Filament’s ->disabledOn('edit'). See FieldConditions::disabled_on.

Source

pub fn read_only_when( self, rule: impl Fn(&FormContext<'_>) -> bool + Send + Sync + 'static, ) -> Self

Makes the records for which rule holds read-only for the signed-in user, as Filament’s View page, a disabled form with the record’s data: their edit form shows the values with every input disabled and no Save, its heading says “View”, the list’s button says “View”, and their save (and the form’s live URL) answers 403 Forbidden. rule is given the edit form’s FormContext: the record, the user and the stored values. Such as a post type defined in code, which the admin screens may show but not change:

ⓘ
.read_only_when(|form| form.record().and_then(|r| r.get("origin")) != Some(&json!("admin")))
Source

pub fn read_only_notice( self, notice: impl Fn(&FormContext<'_>) -> Option<String> + Send + Sync + 'static, ) -> Self

The line the form of a read-only record shows above its fields, such as “This post type is defined in code by the theme. Change it there.”, or none.

Source

pub fn badge(self, column: impl Into<String>) -> Self

Shows the column column as a badge in the primary colour, as Filament’s ->badge(). See ColumnBadges::badge.

Source

pub fn badge_color( self, column: impl Into<String>, color: impl Fn(&str) -> BadgeColor + Send + Sync + 'static, ) -> Self

Shows the column column as a badge whose colour color picks from the cell’s state, as Filament’s ->badge()->color(fn (string $state) => ...). See ColumnBadges::badge_color.

Source

pub fn badge_inside( self, column: impl Into<String>, target: impl Into<String>, ) -> Self

Shows the badge of the column column inside the cell of the column target, instead of in a column of its own. See ColumnBadges::badge_inside.

Source

pub fn badge_on_tabs<S: Into<String>>( self, column: impl Into<String>, tabs: impl IntoIterator<Item = S>, ) -> Self

Shows the badge of the column column only on the list’s tabs tabs, by key. See ColumnBadges::badge_on_tabs.

Trait Implementations§

Source§

impl Clone for RuntimeResource

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for RuntimeResource

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl !RefUnwindSafe for RuntimeResource

§

impl !UnwindSafe for RuntimeResource

§

impl Forget for RuntimeResource

§

impl Freeze for RuntimeResource

§

impl Move for RuntimeResource

§

impl Send for RuntimeResource
where RawVecInner: Send, Arc<dyn RuntimeData>: Send, RawTable<(String, Arc<dyn Fn(&FormContext<'_>) -> bool + Sync + Send>)>: Send, NodeRef<Owned, String, SetValZST, LeafOrInternal>: Send, BoxRaw<(String, SetValZST)>: Send, RawTable<(String, String)>: Send, RawTable<(String, Arc<dyn Fn(&FormContext<'_>) -> Value + Sync + Send>)>: Send, NodeRef<Owned, String, Value, LeafOrInternal>: Send, BoxRaw<(String, Value)>: Send, NodeRef<Owned, String, Badge, LeafOrInternal>: Send, BoxRaw<(String, Badge)>: Send, Arc<dyn for<'a> Fn(&'a Database, &'a ActingUser, i64, &'a Map<String, Value>) -> Pin<Box<dyn Future<Output = Result<Result<(), String>, Error>> + Send + 'a>> + Sync + Send>: Send, Arc<dyn Fn(&Map<String, Value>) -> bool + Sync + Send>: Send, NodeRef<Owned, String, RepeaterSettings, LeafOrInternal>: Send, BoxRaw<(String, RepeaterSettings)>: Send, Arc<dyn Fn(&FormContext<'_>) -> bool + Sync + Send>: Send, Arc<dyn Fn(&FormContext<'_>) -> Option<String> + Sync + Send>: Send, NodeRef<Owned, ResourceAction, String, LeafOrInternal>: Send, BoxRaw<(ResourceAction, String)>: Send,

§

impl Sync for RuntimeResource
where RawVecInner: Sync, Arc<dyn RuntimeData>: Sync, RawTable<(String, Arc<dyn Fn(&FormContext<'_>) -> bool + Sync + Send>)>: Sync, NodeRef<Owned, String, SetValZST, LeafOrInternal>: Sync, BoxRaw<(String, SetValZST)>: Sync, RawTable<(String, String)>: Sync, RawTable<(String, Arc<dyn Fn(&FormContext<'_>) -> Value + Sync + Send>)>: Sync, NodeRef<Owned, String, Value, LeafOrInternal>: Sync, BoxRaw<(String, Value)>: Sync, NodeRef<Owned, String, Badge, LeafOrInternal>: Sync, BoxRaw<(String, Badge)>: Sync, Arc<dyn for<'a> Fn(&'a Database, &'a ActingUser, i64, &'a Map<String, Value>) -> Pin<Box<dyn Future<Output = Result<Result<(), String>, Error>> + Send + 'a>> + Sync + Send>: Sync, Arc<dyn Fn(&Map<String, Value>) -> bool + Sync + Send>: Sync, NodeRef<Owned, String, RepeaterSettings, LeafOrInternal>: Sync, BoxRaw<(String, RepeaterSettings)>: Sync, Arc<dyn Fn(&FormContext<'_>) -> bool + Sync + Send>: Sync, Arc<dyn Fn(&FormContext<'_>) -> Option<String> + Sync + Send>: Sync, NodeRef<Owned, ResourceAction, String, LeafOrInternal>: Sync, BoxRaw<(ResourceAction, String)>: Sync,

§

impl Unpin for RuntimeResource
where *const u8 is !null: Unpin, Arc<dyn RuntimeData>: Unpin, Arc<dyn Fn(&FormContext<'_>) -> bool + Sync + Send>: Unpin, *const LeafNode<String, SetValZST> is !null: Unpin, Box<(String, SetValZST)>: Unpin, Arc<dyn Fn(&FormContext<'_>) -> Value + Sync + Send>: Unpin, *const LeafNode<String, Value> is !null: Unpin, Box<(String, Value)>: Unpin, *const LeafNode<String, Badge> is !null: Unpin, Box<(String, Badge)>: Unpin, Arc<dyn for<'a> Fn(&'a Database, &'a ActingUser, i64, &'a Map<String, Value>) -> Pin<Box<dyn Future<Output = Result<Result<(), String>, Error>> + Send + 'a>> + Sync + Send>: Unpin, Arc<dyn Fn(&Map<String, Value>) -> bool + Sync + Send>: Unpin, *const LeafNode<String, RepeaterSettings> is !null: Unpin, Box<(String, RepeaterSettings)>: Unpin, Arc<dyn Fn(&FormContext<'_>) -> Option<String> + Sync + Send>: Unpin, *const LeafNode<ResourceAction, String> is !null: Unpin, Box<(ResourceAction, String)>: Unpin,

§

impl UnsafeUnpin for RuntimeResource
where *const u8 is !null: UnsafeUnpin, PhantomData<u8>: UnsafeUnpin, PhantomData<FieldDef>: UnsafeUnpin, PhantomData<ColumnDef>: UnsafeUnpin, *const ArcInner<dyn RuntimeData> is !null: UnsafeUnpin, PhantomData<ArcInner<dyn RuntimeData>>: UnsafeUnpin, PhantomData<String>: UnsafeUnpin, PhantomData<(String, Arc<dyn Fn(&FormContext<'_>) -> bool + Sync + Send>)>: UnsafeUnpin, *const LeafNode<String, SetValZST> is !null: UnsafeUnpin, PhantomData<(Owned, LeafOrInternal)>: UnsafeUnpin, PhantomData<Box<(String, SetValZST)>>: UnsafeUnpin, PhantomData<(String, String)>: UnsafeUnpin, PhantomData<(String, Arc<dyn Fn(&FormContext<'_>) -> Value + Sync + Send>)>: UnsafeUnpin, PhantomData<Component>: UnsafeUnpin, PhantomData<Tab>: UnsafeUnpin, *const LeafNode<String, Badge> is !null: UnsafeUnpin, PhantomData<Box<(String, Badge)>>: UnsafeUnpin, PhantomData<RowAction>: UnsafeUnpin, PhantomData<BulkAction>: UnsafeUnpin, PhantomData<FilterCondition>: UnsafeUnpin, *const LeafNode<String, RepeaterSettings> is !null: UnsafeUnpin, PhantomData<Box<(String, RepeaterSettings)>>: UnsafeUnpin, *const ArcInner<dyn Fn(&FormContext<'_>) -> bool + Sync + Send> is !null: UnsafeUnpin, PhantomData<ArcInner<dyn Fn(&FormContext<'_>) -> bool + Sync + Send>>: UnsafeUnpin, *const ArcInner<dyn Fn(&FormContext<'_>) -> Option<String> + Sync + Send> is !null: UnsafeUnpin, PhantomData<ArcInner<dyn Fn(&FormContext<'_>) -> Option<String> + Sync + Send>>: UnsafeUnpin, *const LeafNode<ResourceAction, String> is !null: UnsafeUnpin, PhantomData<Box<(ResourceAction, String)>>: UnsafeUnpin,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more