diff --git a/snapshots/master/demos/android/energy-monitor.apk b/snapshots/master/demos/android/energy-monitor.apk index cb746d460..f53ea527a 100644 Binary files a/snapshots/master/demos/android/energy-monitor.apk and b/snapshots/master/demos/android/energy-monitor.apk differ diff --git a/snapshots/master/demos/carousel/pkg/carousel_bg.wasm b/snapshots/master/demos/carousel/pkg/carousel_bg.wasm index 0635382c0..f44eafb63 100644 Binary files a/snapshots/master/demos/carousel/pkg/carousel_bg.wasm and b/snapshots/master/demos/carousel/pkg/carousel_bg.wasm differ diff --git a/snapshots/master/demos/energy-monitor/pkg/energy_monitor.js b/snapshots/master/demos/energy-monitor/pkg/energy_monitor.js index 2fb342ba5..e631beced 100644 --- a/snapshots/master/demos/energy-monitor/pkg/energy_monitor.js +++ b/snapshots/master/demos/energy-monitor/pkg/energy_monitor.js @@ -1665,64 +1665,64 @@ function __wbg_get_imports() { const ret = wasm.memory; return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper7955 = function(arg0, arg1, arg2) { - const ret = makeClosure(arg0, arg1, 3584, __wbg_adapter_26); + imports.wbg.__wbindgen_closure_wrapper7956 = function(arg0, arg1, arg2) { + const ret = makeClosure(arg0, arg1, 3585, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper7957 = function(arg0, arg1, arg2) { - const ret = makeClosure(arg0, arg1, 3584, __wbg_adapter_26); + imports.wbg.__wbindgen_closure_wrapper7958 = function(arg0, arg1, arg2) { + const ret = makeClosure(arg0, arg1, 3585, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper7959 = function(arg0, arg1, arg2) { - const ret = makeClosure(arg0, arg1, 3584, __wbg_adapter_26); + imports.wbg.__wbindgen_closure_wrapper7960 = function(arg0, arg1, arg2) { + const ret = makeClosure(arg0, arg1, 3585, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper7961 = function(arg0, arg1, arg2) { - const ret = makeClosure(arg0, arg1, 3584, __wbg_adapter_26); + imports.wbg.__wbindgen_closure_wrapper7962 = function(arg0, arg1, arg2) { + const ret = makeClosure(arg0, arg1, 3585, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper7963 = function(arg0, arg1, arg2) { - const ret = makeClosure(arg0, arg1, 3584, __wbg_adapter_26); + imports.wbg.__wbindgen_closure_wrapper7964 = function(arg0, arg1, arg2) { + const ret = makeClosure(arg0, arg1, 3585, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper9248 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 4039, __wbg_adapter_37); + imports.wbg.__wbindgen_closure_wrapper9249 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 4040, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper9250 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 4039, __wbg_adapter_40); + imports.wbg.__wbindgen_closure_wrapper9251 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 4040, __wbg_adapter_40); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper9252 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 4039, __wbg_adapter_37); + imports.wbg.__wbindgen_closure_wrapper9253 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 4040, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper9256 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 4039, __wbg_adapter_37); + imports.wbg.__wbindgen_closure_wrapper9257 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 4040, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper9265 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 4039, __wbg_adapter_37); + imports.wbg.__wbindgen_closure_wrapper9266 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 4040, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper9269 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 4039, __wbg_adapter_37); + imports.wbg.__wbindgen_closure_wrapper9270 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 4040, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper9272 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 4039, __wbg_adapter_37); + imports.wbg.__wbindgen_closure_wrapper9273 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 4040, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper9274 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 4039, __wbg_adapter_37); + imports.wbg.__wbindgen_closure_wrapper9275 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 4040, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper9282 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 4039, __wbg_adapter_55); + imports.wbg.__wbindgen_closure_wrapper9283 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 4040, __wbg_adapter_55); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper9977 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 4129, __wbg_adapter_58); + imports.wbg.__wbindgen_closure_wrapper9978 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 4130, __wbg_adapter_58); return addHeapObject(ret); }; diff --git a/snapshots/master/demos/energy-monitor/pkg/energy_monitor_bg.wasm b/snapshots/master/demos/energy-monitor/pkg/energy_monitor_bg.wasm index 8517f9cd7..9925c8239 100644 Binary files a/snapshots/master/demos/energy-monitor/pkg/energy_monitor_bg.wasm and b/snapshots/master/demos/energy-monitor/pkg/energy_monitor_bg.wasm differ diff --git a/snapshots/master/demos/gallery/pkg/cosmic/gallery_bg.wasm b/snapshots/master/demos/gallery/pkg/cosmic/gallery_bg.wasm index 61f000801..c98be841a 100644 Binary files a/snapshots/master/demos/gallery/pkg/cosmic/gallery_bg.wasm and b/snapshots/master/demos/gallery/pkg/cosmic/gallery_bg.wasm differ diff --git a/snapshots/master/demos/gallery/pkg/cupertino/gallery_bg.wasm b/snapshots/master/demos/gallery/pkg/cupertino/gallery_bg.wasm index e32413834..9d79198d4 100644 Binary files a/snapshots/master/demos/gallery/pkg/cupertino/gallery_bg.wasm and b/snapshots/master/demos/gallery/pkg/cupertino/gallery_bg.wasm differ diff --git a/snapshots/master/demos/gallery/pkg/fluent/gallery_bg.wasm b/snapshots/master/demos/gallery/pkg/fluent/gallery_bg.wasm index 36d68018c..7fae05355 100644 Binary files a/snapshots/master/demos/gallery/pkg/fluent/gallery_bg.wasm and b/snapshots/master/demos/gallery/pkg/fluent/gallery_bg.wasm differ diff --git a/snapshots/master/demos/gallery/pkg/material/gallery_bg.wasm b/snapshots/master/demos/gallery/pkg/material/gallery_bg.wasm index 715880804..54e81b0f2 100644 Binary files a/snapshots/master/demos/gallery/pkg/material/gallery_bg.wasm and b/snapshots/master/demos/gallery/pkg/material/gallery_bg.wasm differ diff --git a/snapshots/master/demos/imagefilter/pkg/imagefilter_bg.wasm b/snapshots/master/demos/imagefilter/pkg/imagefilter_bg.wasm index 155cd0481..788238de4 100644 Binary files a/snapshots/master/demos/imagefilter/pkg/imagefilter_bg.wasm and b/snapshots/master/demos/imagefilter/pkg/imagefilter_bg.wasm differ diff --git a/snapshots/master/demos/memory/pkg/memory_bg.wasm b/snapshots/master/demos/memory/pkg/memory_bg.wasm index f299f7c6e..bc60b53cd 100644 Binary files a/snapshots/master/demos/memory/pkg/memory_bg.wasm and b/snapshots/master/demos/memory/pkg/memory_bg.wasm differ diff --git a/snapshots/master/demos/plotter/pkg/plotter_bg.wasm b/snapshots/master/demos/plotter/pkg/plotter_bg.wasm index 574b14dc2..c1ad4e7d1 100644 Binary files a/snapshots/master/demos/plotter/pkg/plotter_bg.wasm and b/snapshots/master/demos/plotter/pkg/plotter_bg.wasm differ diff --git a/snapshots/master/demos/printerdemo/pkg/printerdemo_lib_bg.wasm b/snapshots/master/demos/printerdemo/pkg/printerdemo_lib_bg.wasm index 7aa713055..5eb089f0d 100644 Binary files a/snapshots/master/demos/printerdemo/pkg/printerdemo_lib_bg.wasm and b/snapshots/master/demos/printerdemo/pkg/printerdemo_lib_bg.wasm differ diff --git a/snapshots/master/demos/printerdemo_old/pkg/printerdemo_old_bg.wasm b/snapshots/master/demos/printerdemo_old/pkg/printerdemo_old_bg.wasm index 5db549358..063aa5fe3 100644 Binary files a/snapshots/master/demos/printerdemo_old/pkg/printerdemo_old_bg.wasm and b/snapshots/master/demos/printerdemo_old/pkg/printerdemo_old_bg.wasm differ diff --git a/snapshots/master/demos/slide_puzzle/pkg/slide_puzzle_bg.wasm b/snapshots/master/demos/slide_puzzle/pkg/slide_puzzle_bg.wasm index a3bb063f2..8be478de5 100644 Binary files a/snapshots/master/demos/slide_puzzle/pkg/slide_puzzle_bg.wasm and b/snapshots/master/demos/slide_puzzle/pkg/slide_puzzle_bg.wasm differ diff --git a/snapshots/master/demos/todo/pkg/todo_lib_bg.wasm b/snapshots/master/demos/todo/pkg/todo_lib_bg.wasm index 8d1eb251d..a823e9ef4 100644 Binary files a/snapshots/master/demos/todo/pkg/todo_lib_bg.wasm and b/snapshots/master/demos/todo/pkg/todo_lib_bg.wasm differ diff --git a/snapshots/master/demos/weather-demo/pkg/rusty_weather_lib_bg.wasm b/snapshots/master/demos/weather-demo/pkg/rusty_weather_lib_bg.wasm index 33666936b..c479dd005 100644 Binary files a/snapshots/master/demos/weather-demo/pkg/rusty_weather_lib_bg.wasm and b/snapshots/master/demos/weather-demo/pkg/rusty_weather_lib_bg.wasm differ diff --git a/snapshots/master/docs/node/classes/ArrayModel.html b/snapshots/master/docs/node/classes/ArrayModel.html index 975e3add8..2255a0173 100644 --- a/snapshots/master/docs/node/classes/ArrayModel.html +++ b/snapshots/master/docs/node/classes/ArrayModel.html @@ -1,6 +1,6 @@ ArrayModel | slint-ui

Class ArrayModel<T>

ArrayModel wraps a JavaScript array for use in .slint views. The underlying array can be modified with the [[ArrayModel.push]] and [[ArrayModel.remove]] methods.

-

Type Parameters

  • T

Hierarchy (view full)

Constructors

Type Parameters

  • T

Hierarchy (view full)

Constructors

Accessors

Methods

[iterator] entries @@ -16,32 +16,32 @@ setRowData values

Constructors

Accessors

  • get length(): number
  • Returns the number of entries in the array model.

    -

    Returns number

Methods

  • Returns an iterable of key, value pairs for every entry in the array.

    -

    Returns IterableIterator<[number, T]>

  • Notifies the view that the complete data must be reload.

    -

    Returns void

Accessors

  • get length(): number
  • Returns the number of entries in the array model.

    +

    Returns number

Methods

  • Returns an iterable of key, value pairs for every entry in the array.

    +

    Returns IterableIterator<[number, T]>

  • Notifies the view that the complete data must be reload.

    +

    Returns void

  • Notifies the view that multiple rows are added to the model.

    Parameters

    • row: number

      index of the first added row.

    • count: number

      the number of added items.

      -

    Returns void

  • Notifies the view that the data of the current row is changed.

    +

Returns void

  • Notifies the view that the data of the current row is changed.

    Parameters

    • row: number

      index of the changed row.

      -

    Returns void

  • Notifies the view that multiple rows are removed to the model.

    +

Returns void

Returns void

Returns void

Returns void

\ No newline at end of file +

Returns void

\ No newline at end of file diff --git a/snapshots/master/docs/node/classes/CompileError.html b/snapshots/master/docs/node/classes/CompileError.html index 49303f56b..d17beb084 100644 --- a/snapshots/master/docs/node/classes/CompileError.html +++ b/snapshots/master/docs/node/classes/CompileError.html @@ -1,5 +1,5 @@ CompileError | slint-ui

Class CompileError

Represents an errors that can be emitted by the compiler.

-

Hierarchy

  • Error
    • CompileError

Constructors

Hierarchy

  • Error
    • CompileError

Constructors

Properties

cause? diagnostics message @@ -11,8 +11,8 @@

Constructors

  • Creates a new CompileError.

    Parameters

    • message: string

      human-readable description of the error.

    • diagnostics: Diagnostic[]

      represent a list of diagnostic items emitted while compiling .slint code.

      -

    Returns CompileError

Properties

cause?: unknown
diagnostics: Diagnostic[]

List of Diagnostic items emitted while compiling .slint code.

-
message: string
name: string
stack?: string
prepareStackTrace?: ((err, stackTraces) => any)

Optional override for formatting stack traces

+

Returns CompileError

Properties

cause?: unknown
diagnostics: Diagnostic[]

List of Diagnostic items emitted while compiling .slint code.

+
message: string
name: string
stack?: string
prepareStackTrace?: ((err, stackTraces) => any)

Optional override for formatting stack traces

Type declaration

    • (err, stackTraces): any
    • Parameters

      • err: Error
      • stackTraces: CallSite[]

      Returns any

stackTraceLimit: number

Methods

  • Create .stack property on a target object

    Parameters

    • targetObject: object
    • Optional constructorOpt: Function

    Returns void

\ No newline at end of file diff --git a/snapshots/master/docs/node/classes/Model.html b/snapshots/master/docs/node/classes/Model.html index 31dc2eacd..8bdcdbcee 100644 --- a/snapshots/master/docs/node/classes/Model.html +++ b/snapshots/master/docs/node/classes/Model.html @@ -6,7 +6,7 @@

Example

As an example let's see the implementation of ArrayModel

export class ArrayModel<T> extends Model<T> {
private a: Array<T>

constructor(arr: Array<T>) {
super();
this.a = arr;
}

rowCount() {
return this.a.length;
}

rowData(row: number) {
return this.a[row];
}

setRowData(row: number, data: T) {
this.a[row] = data;
this.notifyRowDataChanged(row);
}

push(...values: T[]) {
let size = this.a.length;
Array.prototype.push.apply(this.a, values);
this.notifyRowAdded(size, arguments.length);
}

remove(index: number, size: number) {
let r = this.a.splice(index, size);
this.notifyRowRemoved(index, size);
}

get length(): number {
return this.a.length;
}

values(): IterableIterator<T> {
return this.a.values();
}

entries(): IterableIterator<[number, T]> {
return this.a.entries()
}
}
-

Hierarchy (view full)

Implements

Constructors

Hierarchy (view full)

Implements

  • Iterable<T>

Constructors

Methods

  • Returns Iterator<T, any, undefined>

  • Notifies the view that the complete data must be reload.

    -

    Returns void

  • Notifies the view that multiple rows are added to the model.

    +

Constructors

Methods

Returns void

Returns void

Returns void

\ No newline at end of file +

Returns void

\ No newline at end of file diff --git a/snapshots/master/docs/node/functions/loadFile.html b/snapshots/master/docs/node/functions/loadFile.html index 74ed16b80..ec26f0209 100644 --- a/snapshots/master/docs/node/functions/loadFile.html +++ b/snapshots/master/docs/node/functions/loadFile.html @@ -15,4 +15,4 @@ These instances offer properties and event handlers, adhering to the ComponentHandle interface. For further information on the available properties, refer to Instantiating A Component.

Throws

CompileError if errors occur during compilation.

-
\ No newline at end of file +
\ No newline at end of file diff --git a/snapshots/master/docs/node/functions/loadSource.html b/snapshots/master/docs/node/functions/loadSource.html index 7fe5fe7ac..d7dd1dbd7 100644 --- a/snapshots/master/docs/node/functions/loadSource.html +++ b/snapshots/master/docs/node/functions/loadSource.html @@ -13,4 +13,4 @@ These instances offer properties and event handlers, adhering to the ComponentHandle interface. For further information on the available properties, refer to Instantiating A Component.

Throws

CompileError if errors occur during compilation.

-
\ No newline at end of file +
\ No newline at end of file diff --git a/snapshots/master/docs/node/functions/quitEventLoop.html b/snapshots/master/docs/node/functions/quitEventLoop.html index 95205e1fb..a6677aaa3 100644 --- a/snapshots/master/docs/node/functions/quitEventLoop.html +++ b/snapshots/master/docs/node/functions/quitEventLoop.html @@ -1,3 +1,3 @@ quitEventLoop | slint-ui

Function quitEventLoop

  • Stops a spinning event loop. This function returns immediately, and the promise returned from run_event_loop() will resolve in a later tick of the nodejs event loop.

    -

    Returns void

\ No newline at end of file +

Returns void

\ No newline at end of file diff --git a/snapshots/master/docs/node/functions/runEventLoop.html b/snapshots/master/docs/node/functions/runEventLoop.html index ed1a5f845..2910ce235 100644 --- a/snapshots/master/docs/node/functions/runEventLoop.html +++ b/snapshots/master/docs/node/functions/runEventLoop.html @@ -2,4 +2,4 @@

If the event loop is already running, then this function returns the same promise as from the earlier invocation.

Parameters

Returns Promise<unknown>

\ No newline at end of file +

Returns Promise<unknown>

\ No newline at end of file diff --git a/snapshots/master/docs/node/interfaces/ComponentHandle.html b/snapshots/master/docs/node/interfaces/ComponentHandle.html index eae873e37..2ad586e84 100644 --- a/snapshots/master/docs/node/interfaces/ComponentHandle.html +++ b/snapshots/master/docs/node/interfaces/ComponentHandle.html @@ -1,16 +1,16 @@ ComponentHandle | slint-ui

Interface ComponentHandle

This interface describes the public API of a Slint component that is common to all instances. Use this to show() the window on the screen, access the window and subsequent window properties, or start the Slint event loop with run().

-
interface ComponentHandle {
    get window(): Window;
    hide(): any;
    run(): Promise<unknown>;
    show(): any;
}

Accessors

interface ComponentHandle {
    get window(): Window;
    hide(): any;
    run(): Promise<unknown>;
    show(): any;
}

Accessors

Methods

Accessors

  • get window(): Window
  • Returns the Window associated with this component instance. The window API can be used to control different aspects of the integration into the windowing system, such as the position on the screen.

    -

    Returns Window

Methods

  • Hides the component's window, so that it is not visible anymore.

    -

    Returns any

  • Shows the window and runs the event loop. The returned promise is resolved when the event loop +

    Returns Window

Methods

  • Hides the component's window, so that it is not visible anymore.

    +

    Returns any

  • Shows the window and runs the event loop. The returned promise is resolved when the event loop is terminated, for example when the last window was closed, or quitEventLoop was called.

    This function is a convenience for calling show, followed by runEventLoop, and hide when the event loop's promise is resolved.

    -

    Returns Promise<unknown>

  • Shows the component's window on the screen.

    -

    Returns any

\ No newline at end of file +

Returns Promise<unknown>

\ No newline at end of file diff --git a/snapshots/master/docs/node/interfaces/ImageData.html b/snapshots/master/docs/node/interfaces/ImageData.html index 01e67a2bb..ef6b5a041 100644 --- a/snapshots/master/docs/node/interfaces/ImageData.html +++ b/snapshots/master/docs/node/interfaces/ImageData.html @@ -1,12 +1,12 @@ ImageData | slint-ui

Interface ImageData

An image data type that can be displayed by the Image element.

This interface is inspired by the web ImageData interface.

-
interface ImageData {
    path?: string;
    get data(): Uint8Array;
    get height(): number;
    get width(): number;
}

Properties

interface ImageData {
    path?: string;
    get data(): Uint8Array;
    get height(): number;
    get width(): number;
}

Properties

Accessors

Properties

path?: string

Returns the path of the image, if it was loaded from disk. Otherwise the property is undefined.

-

Accessors

  • get data(): Uint8Array
  • Returns the image as buffer.

    -

    Returns Uint8Array

  • get height(): number
  • Returns the height of the image in pixels.

    -

    Returns number

  • get width(): number
  • Returns the width of the image in pixels.

    -

    Returns number

\ No newline at end of file +

Accessors

\ No newline at end of file diff --git a/snapshots/master/docs/node/interfaces/LoadFileOptions.html b/snapshots/master/docs/node/interfaces/LoadFileOptions.html index 511626dc0..1aa8a0523 100644 --- a/snapshots/master/docs/node/interfaces/LoadFileOptions.html +++ b/snapshots/master/docs/node/interfaces/LoadFileOptions.html @@ -1,10 +1,10 @@ LoadFileOptions | slint-ui

Interface LoadFileOptions

LoadFileOptions are used to defines different optional parameters that can be used to configure the compiler.

-
interface LoadFileOptions {
    includePaths?: string[];
    libraryPaths?: Record<string, string>;
    quiet?: boolean;
    style?: string;
}

Properties

interface LoadFileOptions {
    includePaths?: string[];
    libraryPaths?: Record<string, string>;
    quiet?: boolean;
    style?: string;
}

Properties

includePaths?: string[]

Sets the include paths used for looking up .slint imports to the specified vector of paths.

-
libraryPaths?: Record<string, string>

Sets library paths used for looking up @library imports to the specified map of library names to paths.

-
quiet?: boolean

If set to true warnings from the compiler will not be printed to the console.

-
style?: string

Sets the widget style the compiler is currently using when compiling .slint files.

-
\ No newline at end of file +
libraryPaths?: Record<string, string>

Sets library paths used for looking up @library imports to the specified map of library names to paths.

+
quiet?: boolean

If set to true warnings from the compiler will not be printed to the console.

+
style?: string

Sets the widget style the compiler is currently using when compiling .slint files.

+
\ No newline at end of file diff --git a/snapshots/master/docs/node/interfaces/Point.html b/snapshots/master/docs/node/interfaces/Point.html index 6e8ee1762..7b83cdbea 100644 --- a/snapshots/master/docs/node/interfaces/Point.html +++ b/snapshots/master/docs/node/interfaces/Point.html @@ -1,6 +1,6 @@ Point | slint-ui

Interface Point

Represents a two-dimensional point.

-
interface Point {
    x: number;
    y: number;
}

Properties

x +
interface Point {
    x: number;
    y: number;
}

Properties

x y

Properties

x: number

Defines the x coordinate of the point.

-
y: number

Defines the y coordinate of the point.

-
\ No newline at end of file +
y: number

Defines the y coordinate of the point.

+
\ No newline at end of file diff --git a/snapshots/master/docs/node/interfaces/Size.html b/snapshots/master/docs/node/interfaces/Size.html index 724258e23..1afb4556d 100644 --- a/snapshots/master/docs/node/interfaces/Size.html +++ b/snapshots/master/docs/node/interfaces/Size.html @@ -1,6 +1,6 @@ Size | slint-ui

Interface Size

Represents a two-dimensional size.

-
interface Size {
    height: number;
    width: number;
}

Properties

interface Size {
    height: number;
    width: number;
}

Properties

Properties

height: number

Defines the height length of the size.

-
width: number

Defines the width length of the size.

-
\ No newline at end of file +
width: number

Defines the width length of the size.

+
\ No newline at end of file diff --git a/snapshots/master/docs/node/interfaces/Window.html b/snapshots/master/docs/node/interfaces/Window.html index d90d5dbbc..b4adaab98 100644 --- a/snapshots/master/docs/node/interfaces/Window.html +++ b/snapshots/master/docs/node/interfaces/Window.html @@ -1,7 +1,7 @@ Window | slint-ui

Interface Window

This type represents a window towards the windowing system, that's used to render the scene of a component. It provides API to control windowing system specific aspects such as the position on the screen.

-
interface Window {
    fullscreen: boolean;
    logicalPosition: Point;
    logicalSize: Size;
    maximized: boolean;
    minimized: boolean;
    physicalPosition: Point;
    physicalSize: Size;
    get visible(): boolean;
    hide(): void;
    requestRedraw(): void;
    show(): void;
}

Properties

interface Window {
    fullscreen: boolean;
    logicalPosition: Point;
    logicalSize: Size;
    maximized: boolean;
    minimized: boolean;
    physicalPosition: Point;
    physicalSize: Size;
    get visible(): boolean;
    hide(): void;
    requestRedraw(): void;
    show(): void;
}

Properties

fullscreen: boolean

Gets or sets the window's fullscreen state *

-
logicalPosition: Point

Gets or sets the logical position of the window on the screen.

-
logicalSize: Size

Gets or sets the logical size of the window on the screen,

-
maximized: boolean

Gets or sets the window's maximized state *

-
minimized: boolean

Gets or sets teh window's minimized state *

-
physicalPosition: Point

Gets or sets the physical position of the window on the screen.

-
physicalSize: Size

Gets or sets the physical size of the window on the screen,

-

Accessors

  • get visible(): boolean
  • Returns the visibility state of the window. This function can return false even if you previously called show() +

logicalPosition: Point

Gets or sets the logical position of the window on the screen.

+
logicalSize: Size

Gets or sets the logical size of the window on the screen,

+
maximized: boolean

Gets or sets the window's maximized state *

+
minimized: boolean

Gets or sets teh window's minimized state *

+
physicalPosition: Point

Gets or sets the physical position of the window on the screen.

+
physicalSize: Size

Gets or sets the physical size of the window on the screen,

+

Accessors

  • get visible(): boolean
  • Returns the visibility state of the window. This function can return false even if you previously called show() on it, for example if the user minimized the window.

    -

    Returns boolean

Methods

  • Hides the window, so that it is not visible anymore.

    -

    Returns void

  • Issues a request to the windowing system to re-render the contents of the window.

    -

    Returns void

  • Shows the window on the screen. An additional strong reference on the +

    Returns boolean

Methods

  • Hides the window, so that it is not visible anymore.

    +

    Returns void

  • Issues a request to the windowing system to re-render the contents of the window.

    +

    Returns void

  • Shows the window on the screen. An additional strong reference on the associated component is maintained while the window is visible.

    -

    Returns void

\ No newline at end of file +

Returns void

\ No newline at end of file diff --git a/snapshots/master/docs/rust/help.html b/snapshots/master/docs/rust/help.html index 7c4d9d140..26d21d2ec 100644 --- a/snapshots/master/docs/rust/help.html +++ b/snapshots/master/docs/rust/help.html @@ -1,4 +1,4 @@ -Help

Rustdoc help

Back
\ No newline at end of file +

Rustdoc help

Back
\ No newline at end of file diff --git a/snapshots/master/docs/rust/i_slint_backend_android_activity/all.html b/snapshots/master/docs/rust/i_slint_backend_android_activity/all.html index 62f09b3f1..e210cdeb8 100644 --- a/snapshots/master/docs/rust/i_slint_backend_android_activity/all.html +++ b/snapshots/master/docs/rust/i_slint_backend_android_activity/all.html @@ -1,4 +1,4 @@ -List of all items in this crate

Rustdoc settings

Back
\ No newline at end of file +

Rustdoc settings

Back
\ No newline at end of file diff --git a/snapshots/master/docs/rust/slint/all.html b/snapshots/master/docs/rust/slint/all.html index 6966f0ba4..91f40cc96 100644 --- a/snapshots/master/docs/rust/slint/all.html +++ b/snapshots/master/docs/rust/slint/all.html @@ -1,4 +1,4 @@ -List of all items in this crate

Enum slint::PlatformError

#[non_exhaustive]
pub enum PlatformError { +

Enum slint::PlatformError

#[non_exhaustive]
pub enum PlatformError { NoPlatform, NoEventLoopProvider, SetPlatformError(SetPlatformError), Other(String), - OtherError(Box<dyn Error + Sync + Send>), + OtherError(Box<dyn Error + Send + Sync>), }
Expand description

The platform encountered a fatal error.

This error typically indicates an issue with initialization or connecting to the windowing system.

This can be constructed from a String:

@@ -140,8 +140,8 @@ is not implemented for the current platform.

§

SetPlatformError(SetPlatformError)

There is already a platform set from another thread.

§

Other(String)

Another platform-specific error occurred

-
§

OtherError(Box<dyn Error + Sync + Send>)

Another platform-specific error occurred.

-

Trait Implementations§

§

impl Debug for PlatformError

§

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

Formats the value using the given formatter. Read more
§

impl Display for PlatformError

§

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

Formats the value using the given formatter. Read more
§

impl Error for PlatformError

§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
§

impl From<&str> for PlatformError

§

fn from(value: &str) -> PlatformError

Converts to this type from the input type.
§

impl From<Box<dyn Error + Sync + Send>> for PlatformError

§

fn from(error: Box<dyn Error + Sync + Send>) -> PlatformError

Converts to this type from the input type.
§

impl From<String> for PlatformError

§

fn from(value: String) -> PlatformError

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where +
§

OtherError(Box<dyn Error + Send + Sync>)

Another platform-specific error occurred.

+

Trait Implementations§

§

impl Debug for PlatformError

§

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

Formats the value using the given formatter. Read more
§

impl Display for PlatformError

§

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

Formats the value using the given formatter. Read more
§

impl Error for PlatformError

§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
§

impl From<&str> for PlatformError

§

fn from(value: &str) -> PlatformError

Converts to this type from the input type.
§

impl From<Box<dyn Error + Send + Sync>> for PlatformError

§

fn from(error: Box<dyn Error + Send + Sync>) -> PlatformError

Converts to this type from the input type.
§

impl From<String> for PlatformError

§

fn from(value: String) -> PlatformError

Converts to this type from the input type.

Auto Trait Implementations§

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
§

impl<T> Downcast for T
where @@ -150,7 +150,7 @@ further downcast into Rc<ConcreteType> where ConcreteType implements Trait.

§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
§

impl<T> DowncastSync for T
where - T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be + T: Any + Send + Sync,
§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

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

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

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an @@ -166,8 +166,8 @@ if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
§

impl<T> ToSmolStr for T
where - T: Display + ?Sized,

§

fn to_smolstr(&self) -> SmolStr

source§

impl<T> ToString for T
where - T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where + T: Display + ?Sized,

§

fn to_smolstr(&self) -> SmolStr

source§

impl<T> ToString for T
where + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

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

§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

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

§

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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where diff --git a/snapshots/master/docs/rust/slint/enum.RenderingState.html b/snapshots/master/docs/rust/slint/enum.RenderingState.html index 0e7ef0b01..1ce00e07c 100644 --- a/snapshots/master/docs/rust/slint/enum.RenderingState.html +++ b/snapshots/master/docs/rust/slint/enum.RenderingState.html @@ -1,4 +1,4 @@ -RenderingState in slint - Rust

Enum slint::platform::PlatformError

#[non_exhaustive]
pub enum PlatformError { +

Enum slint::platform::PlatformError

#[non_exhaustive]
pub enum PlatformError { NoPlatform, NoEventLoopProvider, SetPlatformError(SetPlatformError), Other(String), - OtherError(Box<dyn Error + Sync + Send>), + OtherError(Box<dyn Error + Send + Sync>), }
Expand description

The platform encountered a fatal error.

This error typically indicates an issue with initialization or connecting to the windowing system.

This can be constructed from a String:

@@ -140,8 +140,8 @@ is not implemented for the current platform.

§

SetPlatformError(SetPlatformError)

There is already a platform set from another thread.

§

Other(String)

Another platform-specific error occurred

-
§

OtherError(Box<dyn Error + Sync + Send>)

Another platform-specific error occurred.

-

Trait Implementations§

§

impl Debug for PlatformError

§

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

Formats the value using the given formatter. Read more
§

impl Display for PlatformError

§

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

Formats the value using the given formatter. Read more
§

impl Error for PlatformError

§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
§

impl From<&str> for PlatformError

§

fn from(value: &str) -> PlatformError

Converts to this type from the input type.
§

impl From<Box<dyn Error + Sync + Send>> for PlatformError

§

fn from(error: Box<dyn Error + Sync + Send>) -> PlatformError

Converts to this type from the input type.
§

impl From<String> for PlatformError

§

fn from(value: String) -> PlatformError

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where +
§

OtherError(Box<dyn Error + Send + Sync>)

Another platform-specific error occurred.

+

Trait Implementations§

§

impl Debug for PlatformError

§

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

Formats the value using the given formatter. Read more
§

impl Display for PlatformError

§

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

Formats the value using the given formatter. Read more
§

impl Error for PlatformError

§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
§

impl From<&str> for PlatformError

§

fn from(value: &str) -> PlatformError

Converts to this type from the input type.
§

impl From<Box<dyn Error + Send + Sync>> for PlatformError

§

fn from(error: Box<dyn Error + Send + Sync>) -> PlatformError

Converts to this type from the input type.
§

impl From<String> for PlatformError

§

fn from(value: String) -> PlatformError

Converts to this type from the input type.

Auto Trait Implementations§

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
§

impl<T> Downcast for T
where @@ -150,7 +150,7 @@ further downcast into Rc<ConcreteType> where ConcreteType implements Trait.

§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.

§

impl<T> DowncastSync for T
where - T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be + T: Any + Send + Sync,
§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

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

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

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an @@ -166,8 +166,8 @@ if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
§

impl<T> ToSmolStr for T
where - T: Display + ?Sized,

§

fn to_smolstr(&self) -> SmolStr

source§

impl<T> ToString for T
where - T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where + T: Display + ?Sized,

§

fn to_smolstr(&self) -> SmolStr

source§

impl<T> ToString for T
where + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

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

§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

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

§

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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where diff --git a/snapshots/master/docs/rust/slint/platform/enum.PointerEventButton.html b/snapshots/master/docs/rust/slint/platform/enum.PointerEventButton.html index 005155c38..31b257378 100644 --- a/snapshots/master/docs/rust/slint/platform/enum.PointerEventButton.html +++ b/snapshots/master/docs/rust/slint/platform/enum.PointerEventButton.html @@ -1,4 +1,4 @@ -PointerEventButton in slint::platform - Rust

Trait slint::platform::femtovg_renderer::OpenGLInterface

pub unsafe trait OpenGLInterface {
     // Required methods
-    fn ensure_current(&self) -> Result<(), Box<dyn Error + Sync + Send>>;
-    fn swap_buffers(&self) -> Result<(), Box<dyn Error + Sync + Send>>;
+    fn ensure_current(&self) -> Result<(), Box<dyn Error + Send + Sync>>;
+    fn swap_buffers(&self) -> Result<(), Box<dyn Error + Send + Sync>>;
     fn resize(
         &self,
         width: NonZero<u32>,
         height: NonZero<u32>,
-    ) -> Result<(), Box<dyn Error + Sync + Send>>;
+    ) -> Result<(), Box<dyn Error + Send + Sync>>;
     fn get_proc_address(&self, name: &CStr) -> *const c_void;
 }
Expand description

This trait describes the interface GPU accelerated renderers in Slint require to render with OpenGL.

It serves the purpose to ensure that the OpenGL context is current before running any OpenGL @@ -136,15 +136,15 @@

§Safety

This trait is unsafe because an implementation of get_proc_address could return dangling pointers. In practice an implementation of this trait should just forward to the EGL/WGL/CGL C library that implements EGL/CGL/WGL.

-

Required Methods§

fn ensure_current(&self) -> Result<(), Box<dyn Error + Sync + Send>>

Ensures that the OpenGL context is current when returning from this function.

-

fn swap_buffers(&self) -> Result<(), Box<dyn Error + Sync + Send>>

This function is called by the renderers when all OpenGL commands have been issued and +

Required Methods§

fn ensure_current(&self) -> Result<(), Box<dyn Error + Send + Sync>>

Ensures that the OpenGL context is current when returning from this function.

+

fn swap_buffers(&self) -> Result<(), Box<dyn Error + Send + Sync>>

This function is called by the renderers when all OpenGL commands have been issued and the back buffer is reading for on-screen presentation. Typically implementations forward this to platform specific APIs such as eglSwapBuffers.

fn resize( &self, width: NonZero<u32>, height: NonZero<u32>, -) -> Result<(), Box<dyn Error + Sync + Send>>

This function is called by the renderers when the surface needs to be resized, typically +) -> Result<(), Box<dyn Error + Send + Sync>>

This function is called by the renderers when the surface needs to be resized, typically in response to the windowing system notifying of a change in the window system. For most implementations this is a no-op, with the exception for wayland for example.

fn get_proc_address(&self, name: &CStr) -> *const c_void

Returns the address of the OpenGL function specified by name, or a null pointer if the diff --git a/snapshots/master/docs/rust/slint/platform/fn.duration_until_next_timer_update.html b/snapshots/master/docs/rust/slint/platform/fn.duration_until_next_timer_update.html index 7ebb01c26..3dbaea301 100644 --- a/snapshots/master/docs/rust/slint/platform/fn.duration_until_next_timer_update.html +++ b/snapshots/master/docs/rust/slint/platform/fn.duration_until_next_timer_update.html @@ -1,4 +1,4 @@ -duration_until_next_timer_update in slint::platform - Rust

Struct slint::SharedString

#[repr(C)]
pub struct SharedString { /* private fields */ }
Expand description

A string type used by the Slint run-time.

+

Struct slint::SharedString

#[repr(C)]
pub struct SharedString { /* private fields */ }
Expand description

A string type used by the Slint run-time.

SharedString uses implicit data sharing to make it efficient to pass around copies. When cloning, a reference to the data is cloned, not the data itself. The data itself is only copied when modifying it, for example using push_str. This is also called copy-on-write.

@@ -138,7 +138,7 @@ hello.push_str("World"); hello.push_str("!"); assert_eq!(hello, "Hello, World!");
-

Methods from Deref<Target = str>§

1.0.0 · source

pub fn len(&self) -> usize

Returns the length of self.

+

Methods from Deref<Target = str>§

1.0.0 · source

pub fn len(&self) -> usize

Returns the length of self.

This length is in bytes, not chars or graphemes. In other words, it might not be what a human considers the length of the string.

§Examples
@@ -147,14 +147,14 @@
§Examples
assert_eq!("ƒoo".len(), 4); // fancy f! assert_eq!("ƒoo".chars().count(), 3);
-
1.0.0 · source

pub fn is_empty(&self) -> bool

Returns true if self has a length of zero bytes.

+
1.0.0 · source

pub fn is_empty(&self) -> bool

Returns true if self has a length of zero bytes.

§Examples
let s = "";
 assert!(s.is_empty());
 
 let s = "not empty";
 assert!(!s.is_empty());
-
1.9.0 · source

pub fn is_char_boundary(&self, index: usize) -> bool

Checks that index-th byte is the first byte in a UTF-8 code point +

1.9.0 · source

pub fn is_char_boundary(&self, index: usize) -> bool

Checks that index-th byte is the first byte in a UTF-8 code point sequence or the end of the string.

The start and end of the string (when index == self.len()) are considered to be boundaries.

@@ -171,7 +171,7 @@
§Examples
// third byte of `老` assert!(!s.is_char_boundary(8));
-
source

pub fn floor_char_boundary(&self, index: usize) -> usize

🔬This is a nightly-only experimental API. (round_char_boundary)

Finds the closest x not exceeding index where is_char_boundary(x) is true.

+
source

pub fn floor_char_boundary(&self, index: usize) -> usize

🔬This is a nightly-only experimental API. (round_char_boundary)

Finds the closest x not exceeding index where is_char_boundary(x) is true.

This method can help you truncate a string so that it’s still valid UTF-8, but doesn’t exceed a given number of bytes. Note that this is done purely at the character level and can still visually split graphemes, even though the underlying characters aren’t @@ -186,7 +186,7 @@

§Examples
let closest = s.floor_char_boundary(13); assert_eq!(closest, 10); assert_eq!(&s[..closest], "❤️🧡");
-
source

pub fn ceil_char_boundary(&self, index: usize) -> usize

🔬This is a nightly-only experimental API. (round_char_boundary)

Finds the closest x not below index where is_char_boundary(x) is true.

+
source

pub fn ceil_char_boundary(&self, index: usize) -> usize

🔬This is a nightly-only experimental API. (round_char_boundary)

Finds the closest x not below index where is_char_boundary(x) is true.

If index is greater than the length of the string, this returns the length of the string.

This method is the natural complement to floor_char_boundary. See that method for more details.

@@ -199,12 +199,12 @@
§Examples
let closest = s.ceil_char_boundary(13); assert_eq!(closest, 14); assert_eq!(&s[..closest], "❤️🧡💛");
-
1.0.0 · source

pub fn as_bytes(&self) -> &[u8]

Converts a string slice to a byte slice. To convert the byte slice back +

1.0.0 · source

pub fn as_bytes(&self) -> &[u8]

Converts a string slice to a byte slice. To convert the byte slice back into a string slice, use the from_utf8 function.

§Examples
let bytes = "bors".as_bytes();
 assert_eq!(b"bors", bytes);
-
1.0.0 · source

pub fn as_ptr(&self) -> *const u8

Converts a string slice to a raw pointer.

+
1.0.0 · source

pub fn as_ptr(&self) -> *const u8

Converts a string slice to a raw pointer.

As string slices are a slice of bytes, the raw pointer points to a u8. This pointer will be pointing to the first byte of the string slice.

@@ -213,7 +213,7 @@
§Examples
§Examples
let s = "Hello";
 let ptr = s.as_ptr();
-
1.20.0 · source

pub fn get<I>(&self, i: I) -> Option<&<I as SliceIndex<str>>::Output>
where +

1.20.0 · source

pub fn get<I>(&self, i: I) -> Option<&<I as SliceIndex<str>>::Output>
where I: SliceIndex<str>,

Returns a subslice of str.

This is the non-panicking alternative to indexing the str. Returns None whenever equivalent indexing operation would panic.

@@ -228,7 +228,7 @@
§Examples
// out of bounds assert!(v.get(..42).is_none());
-
1.20.0 · source

pub unsafe fn get_unchecked<I>(&self, i: I) -> &<I as SliceIndex<str>>::Output
where +

1.20.0 · source

pub unsafe fn get_unchecked<I>(&self, i: I) -> &<I as SliceIndex<str>>::Output
where I: SliceIndex<str>,

Returns an unchecked subslice of str.

This is the unchecked alternative to indexing the str.

§Safety
@@ -248,7 +248,7 @@
§Examples
assert_eq!("∈", v.get_unchecked(4..7)); assert_eq!("🌏", v.get_unchecked(7..11)); }
-
1.0.0 · source

pub unsafe fn slice_unchecked(&self, begin: usize, end: usize) -> &str

👎Deprecated since 1.29.0: use get_unchecked(begin..end) instead

Creates a string slice from another string slice, bypassing safety +

1.0.0 · source

pub unsafe fn slice_unchecked(&self, begin: usize, end: usize) -> &str

👎Deprecated since 1.29.0: use get_unchecked(begin..end) instead

Creates a string slice from another string slice, bypassing safety checks.

This is generally not recommended, use with caution! For a safe alternative see str and Index.

@@ -276,7 +276,7 @@
§Examples
unsafe { assert_eq!("world", s.slice_unchecked(7, 12)); }
-
1.4.0 · source

pub fn split_at(&self, mid: usize) -> (&str, &str)

Divide one string slice into two at an index.

+
1.4.0 · source

pub fn split_at(&self, mid: usize) -> (&str, &str)

Divide one string slice into two at an index.

The argument, mid, should be a byte offset from the start of the string. It must also be on the boundary of a UTF-8 code point.

The two slices returned go from the start of the string slice to mid, @@ -294,7 +294,7 @@

§Examplesassert_eq!("Per", first); assert_eq!(" Martin-Löf", last);
-
1.80.0 · source

pub fn split_at_checked(&self, mid: usize) -> Option<(&str, &str)>

Divide one string slice into two at an index.

+
1.80.0 · source

pub fn split_at_checked(&self, mid: usize) -> Option<(&str, &str)>

Divide one string slice into two at an index.

The argument, mid, should be a valid byte offset from the start of the string. It must also be on the boundary of a UTF-8 code point. The method returns None if that’s not the case.

@@ -311,7 +311,7 @@
§Examplesassert_eq!(None, s.split_at_checked(13)); // Inside “ö” assert_eq!(None, s.split_at_checked(16)); // Beyond the string length
-
1.0.0 · source

pub fn chars(&self) -> Chars<'_>

Returns an iterator over the chars of a string slice.

+
1.0.0 · source

pub fn chars(&self) -> Chars<'_>

Returns an iterator over the chars of a string slice.

As a string slice consists of valid UTF-8, we can iterate through a string slice by char. This method returns such an iterator.

It’s important to remember that char represents a Unicode Scalar @@ -347,7 +347,7 @@

§Examplesassert_eq!(Some('\u{0306}'), chars.next()); assert_eq!(None, chars.next());
-
1.0.0 · source

pub fn char_indices(&self) -> CharIndices<'_>

Returns an iterator over the chars of a string slice, and their +

1.0.0 · source

pub fn char_indices(&self) -> CharIndices<'_>

Returns an iterator over the chars of a string slice, and their positions.

As a string slice consists of valid UTF-8, we can iterate through a string slice by char. This method returns an iterator of both @@ -387,7 +387,7 @@

§Examplesassert_eq!(Some((4, 's')), char_indices.next()); assert_eq!(None, char_indices.next());
-
1.0.0 · source

pub fn bytes(&self) -> Bytes<'_>

An iterator over the bytes of a string slice.

+
1.0.0 · source

pub fn bytes(&self) -> Bytes<'_>

An iterator over the bytes of a string slice.

As a string slice consists of a sequence of bytes, we can iterate through a string slice by byte. This method returns such an iterator.

§Examples
@@ -399,7 +399,7 @@
§Examplesassert_eq!(Some(b's'), bytes.next()); assert_eq!(None, bytes.next());
-
1.1.0 · source

pub fn split_whitespace(&self) -> SplitWhitespace<'_>

Splits a string slice by whitespace.

+
1.1.0 · source

pub fn split_whitespace(&self) -> SplitWhitespace<'_>

Splits a string slice by whitespace.

The iterator returned will return string slices that are sub-slices of the original string slice, separated by any amount of whitespace.

‘Whitespace’ is defined according to the terms of the Unicode Derived @@ -429,7 +429,7 @@

§Examples
assert_eq!("".split_whitespace().next(), None);
 assert_eq!("   ".split_whitespace().next(), None);
-
1.34.0 · source

pub fn split_ascii_whitespace(&self) -> SplitAsciiWhitespace<'_>

Splits a string slice by ASCII whitespace.

+
1.34.0 · source

pub fn split_ascii_whitespace(&self) -> SplitAsciiWhitespace<'_>

Splits a string slice by ASCII whitespace.

The iterator returned will return string slices that are sub-slices of the original string slice, separated by any amount of ASCII whitespace.

To split by Unicode Whitespace instead, use split_whitespace.

@@ -457,7 +457,7 @@
§Examples
assert_eq!("".split_ascii_whitespace().next(), None);
 assert_eq!("   ".split_ascii_whitespace().next(), None);
-
1.0.0 · source

pub fn lines(&self) -> Lines<'_>

An iterator over the lines of a string, as string slices.

+
1.0.0 · source

pub fn lines(&self) -> Lines<'_>

An iterator over the lines of a string, as string slices.

Lines are split at line endings that are either newlines (\n) or sequences of a carriage return followed by a line feed (\r\n).

Line terminators are not included in the lines returned by the iterator.

@@ -491,8 +491,8 @@
§Examplesassert_eq!(Some("baz"), lines.next()); assert_eq!(None, lines.next());
-
1.0.0 · source

pub fn lines_any(&self) -> LinesAny<'_>

👎Deprecated since 1.4.0: use lines() instead now

An iterator over the lines of a string.

-
1.8.0 · source

pub fn encode_utf16(&self) -> EncodeUtf16<'_>

Returns an iterator of u16 over the string encoded as UTF-16.

+
1.0.0 · source

pub fn lines_any(&self) -> LinesAny<'_>

👎Deprecated since 1.4.0: use lines() instead now

An iterator over the lines of a string.

+
1.8.0 · source

pub fn encode_utf16(&self) -> EncodeUtf16<'_>

Returns an iterator of u16 over the string encoded as UTF-16.

§Examples
let text = "Zażółć gęślą jaźń";
 
@@ -500,8 +500,8 @@ 
§Exampleslet utf16_len = text.encode_utf16().count(); assert!(utf16_len <= utf8_len);
-
1.0.0 · source

pub fn contains<'a, P>(&'a self, pat: P) -> bool
where - P: Pattern<'a>,

Returns true if the given pattern matches a sub-slice of +

1.0.0 · source

pub fn contains<P>(&self, pat: P) -> bool
where + P: Pattern,

Returns true if the given pattern matches a sub-slice of this string slice.

Returns false if it does not.

The pattern can be a &str, char, a slice of chars, or a @@ -511,8 +511,8 @@

§Examplesassert!(bananas.contains("nana")); assert!(!bananas.contains("apples"));
-
1.0.0 · source

pub fn starts_with<'a, P>(&'a self, pat: P) -> bool
where - P: Pattern<'a>,

Returns true if the given pattern matches a prefix of this +

1.0.0 · source

pub fn starts_with<P>(&self, pat: P) -> bool
where + P: Pattern,

Returns true if the given pattern matches a prefix of this string slice.

Returns false if it does not.

The pattern can be a &str, in which case this function will return true if @@ -532,9 +532,9 @@

§Examples// Note that both of these assert successfully. assert!(bananas.starts_with(&['b', 'a', 'n', 'a'])); assert!(bananas.starts_with(&['a', 'b', 'c', 'd']));
-
1.0.0 · source

pub fn ends_with<'a, P>(&'a self, pat: P) -> bool
where - P: Pattern<'a>, - <P as Pattern<'a>>::Searcher: ReverseSearcher<'a>,

Returns true if the given pattern matches a suffix of this +

1.0.0 · source

pub fn ends_with<P>(&self, pat: P) -> bool
where + P: Pattern, + <P as Pattern>::Searcher<'a>: for<'a> ReverseSearcher<'a>,

Returns true if the given pattern matches a suffix of this string slice.

Returns false if it does not.

The pattern can be a &str, char, a slice of chars, or a @@ -544,8 +544,8 @@

§Examplesassert!(bananas.ends_with("anas")); assert!(!bananas.ends_with("nana"));
-
1.0.0 · source

pub fn find<'a, P>(&'a self, pat: P) -> Option<usize>
where - P: Pattern<'a>,

Returns the byte index of the first character of this string slice that +

1.0.0 · source

pub fn find<P>(&self, pat: P) -> Option<usize>
where + P: Pattern,

Returns the byte index of the first character of this string slice that matches the pattern.

Returns None if the pattern doesn’t match.

The pattern can be a &str, char, a slice of chars, or a @@ -572,9 +572,9 @@

§Exampleslet x: &[_] = &['1', '2']; assert_eq!(s.find(x), None);
-
1.0.0 · source

pub fn rfind<'a, P>(&'a self, pat: P) -> Option<usize>
where - P: Pattern<'a>, - <P as Pattern<'a>>::Searcher: ReverseSearcher<'a>,

Returns the byte index for the first character of the last match of the pattern in +

1.0.0 · source

pub fn rfind<P>(&self, pat: P) -> Option<usize>
where + P: Pattern, + <P as Pattern>::Searcher<'a>: for<'a> ReverseSearcher<'a>,

Returns the byte index for the first character of the last match of the pattern in this string slice.

Returns None if the pattern doesn’t match.

The pattern can be a &str, char, a slice of chars, or a @@ -599,8 +599,8 @@

§Exampleslet x: &[_] = &['1', '2']; assert_eq!(s.rfind(x), None);
-
1.0.0 · source

pub fn split<'a, P>(&'a self, pat: P) -> Split<'a, P>
where - P: Pattern<'a>,

An iterator over substrings of this string slice, separated by +

1.0.0 · source

pub fn split<P>(&self, pat: P) -> Split<'_, P>
where + P: Pattern,

An iterator over substrings of this string slice, separated by characters matched by a pattern.

The pattern can be a &str, char, a slice of chars, or a function or closure that determines if a character matches.

@@ -673,8 +673,8 @@
§Examples
assert_eq!(d, &["a", "b", "c"]);

Use split_whitespace for this behavior.

-
1.51.0 · source

pub fn split_inclusive<'a, P>(&'a self, pat: P) -> SplitInclusive<'a, P>
where - P: Pattern<'a>,

An iterator over substrings of this string slice, separated by +

1.51.0 · source

pub fn split_inclusive<P>(&self, pat: P) -> SplitInclusive<'_, P>
where + P: Pattern,

An iterator over substrings of this string slice, separated by characters matched by a pattern. Differs from the iterator produced by split in that split_inclusive leaves the matched part as the terminator of the substring.

@@ -691,9 +691,9 @@
§Examples
let v: Vec<&str> = "Mary had a little lamb\nlittle lamb\nlittle lamb.\n"
     .split_inclusive('\n').collect();
 assert_eq!(v, ["Mary had a little lamb\n", "little lamb\n", "little lamb.\n"]);
-
1.0.0 · source

pub fn rsplit<'a, P>(&'a self, pat: P) -> RSplit<'a, P>
where - P: Pattern<'a>, - <P as Pattern<'a>>::Searcher: ReverseSearcher<'a>,

An iterator over substrings of the given string slice, separated by +

1.0.0 · source

pub fn rsplit<P>(&self, pat: P) -> RSplit<'_, P>
where + P: Pattern, + <P as Pattern>::Searcher<'a>: for<'a> ReverseSearcher<'a>,

An iterator over substrings of the given string slice, separated by characters matched by a pattern and yielded in reverse order.

The pattern can be a &str, char, a slice of chars, or a function or closure that determines if a character matches.

@@ -720,8 +720,8 @@
§Examples
let v: Vec<&str> = "abc1defXghi".rsplit(|c| c == '1' || c == 'X').collect();
 assert_eq!(v, ["ghi", "def", "abc"]);
-
1.0.0 · source

pub fn split_terminator<'a, P>(&'a self, pat: P) -> SplitTerminator<'a, P>
where - P: Pattern<'a>,

An iterator over substrings of the given string slice, separated by +

1.0.0 · source

pub fn split_terminator<P>(&self, pat: P) -> SplitTerminator<'_, P>
where + P: Pattern,

An iterator over substrings of the given string slice, separated by characters matched by a pattern.

The pattern can be a &str, char, a slice of chars, or a function or closure that determines if a character matches.

@@ -744,9 +744,9 @@
§Exampleslet v: Vec<&str> = "A.B:C.D".split_terminator(&['.', ':'][..]).collect(); assert_eq!(v, ["A", "B", "C", "D"]);
-
1.0.0 · source

pub fn rsplit_terminator<'a, P>(&'a self, pat: P) -> RSplitTerminator<'a, P>
where - P: Pattern<'a>, - <P as Pattern<'a>>::Searcher: ReverseSearcher<'a>,

An iterator over substrings of self, separated by characters +

1.0.0 · source

pub fn rsplit_terminator<P>(&self, pat: P) -> RSplitTerminator<'_, P>
where + P: Pattern, + <P as Pattern>::Searcher<'a>: for<'a> ReverseSearcher<'a>,

An iterator over substrings of self, separated by characters matched by a pattern and yielded in reverse order.

The pattern can be a &str, char, a slice of chars, or a function or closure that determines if a character matches.

@@ -769,8 +769,8 @@
§Exampleslet v: Vec<&str> = "A.B:C.D".rsplit_terminator(&['.', ':'][..]).collect(); assert_eq!(v, ["D", "C", "B", "A"]);
-
1.0.0 · source

pub fn splitn<'a, P>(&'a self, n: usize, pat: P) -> SplitN<'a, P>
where - P: Pattern<'a>,

An iterator over substrings of the given string slice, separated by a +

1.0.0 · source

pub fn splitn<P>(&self, n: usize, pat: P) -> SplitN<'_, P>
where + P: Pattern,

An iterator over substrings of the given string slice, separated by a pattern, restricted to returning at most n items.

If n substrings are returned, the last substring (the nth substring) will contain the remainder of the string.

@@ -799,9 +799,9 @@
§Examples
let v: Vec<&str> = "abc1defXghi".splitn(2, |c| c == '1' || c == 'X').collect();
 assert_eq!(v, ["abc", "defXghi"]);
-
1.0.0 · source

pub fn rsplitn<'a, P>(&'a self, n: usize, pat: P) -> RSplitN<'a, P>
where - P: Pattern<'a>, - <P as Pattern<'a>>::Searcher: ReverseSearcher<'a>,

An iterator over substrings of this string slice, separated by a +

1.0.0 · source

pub fn rsplitn<P>(&self, n: usize, pat: P) -> RSplitN<'_, P>
where + P: Pattern, + <P as Pattern>::Searcher<'a>: for<'a> ReverseSearcher<'a>,

An iterator over substrings of this string slice, separated by a pattern, starting from the end of the string, restricted to returning at most n items.

If n substrings are returned, the last substring (the nth substring) @@ -827,24 +827,24 @@

§Examples
let v: Vec<&str> = "abc1defXghi".rsplitn(2, |c| c == '1' || c == 'X').collect();
 assert_eq!(v, ["ghi", "abc1def"]);
-
1.52.0 · source

pub fn split_once<'a, P>(&'a self, delimiter: P) -> Option<(&'a str, &'a str)>
where - P: Pattern<'a>,

Splits the string on the first occurrence of the specified delimiter and +

1.52.0 · source

pub fn split_once<P>(&self, delimiter: P) -> Option<(&str, &str)>
where + P: Pattern,

Splits the string on the first occurrence of the specified delimiter and returns prefix before delimiter and suffix after delimiter.

§Examples
assert_eq!("cfg".split_once('='), None);
 assert_eq!("cfg=".split_once('='), Some(("cfg", "")));
 assert_eq!("cfg=foo".split_once('='), Some(("cfg", "foo")));
 assert_eq!("cfg=foo=bar".split_once('='), Some(("cfg", "foo=bar")));
-
1.52.0 · source

pub fn rsplit_once<'a, P>(&'a self, delimiter: P) -> Option<(&'a str, &'a str)>
where - P: Pattern<'a>, - <P as Pattern<'a>>::Searcher: ReverseSearcher<'a>,

Splits the string on the last occurrence of the specified delimiter and +

1.52.0 · source

pub fn rsplit_once<P>(&self, delimiter: P) -> Option<(&str, &str)>
where + P: Pattern, + <P as Pattern>::Searcher<'a>: for<'a> ReverseSearcher<'a>,

Splits the string on the last occurrence of the specified delimiter and returns prefix before delimiter and suffix after delimiter.

§Examples
assert_eq!("cfg".rsplit_once('='), None);
 assert_eq!("cfg=foo".rsplit_once('='), Some(("cfg", "foo")));
 assert_eq!("cfg=foo=bar".rsplit_once('='), Some(("cfg=foo", "bar")));
-
1.2.0 · source

pub fn matches<'a, P>(&'a self, pat: P) -> Matches<'a, P>
where - P: Pattern<'a>,

An iterator over the disjoint matches of a pattern within the given string +

1.2.0 · source

pub fn matches<P>(&self, pat: P) -> Matches<'_, P>
where + P: Pattern,

An iterator over the disjoint matches of a pattern within the given string slice.

The pattern can be a &str, char, a slice of chars, or a function or closure that determines if a character matches.

@@ -860,9 +860,9 @@
§Exampleslet v: Vec<&str> = "1abc2abc3".matches(char::is_numeric).collect(); assert_eq!(v, ["1", "2", "3"]);
-
1.2.0 · source

pub fn rmatches<'a, P>(&'a self, pat: P) -> RMatches<'a, P>
where - P: Pattern<'a>, - <P as Pattern<'a>>::Searcher: ReverseSearcher<'a>,

An iterator over the disjoint matches of a pattern within this string slice, +

1.2.0 · source

pub fn rmatches<P>(&self, pat: P) -> RMatches<'_, P>
where + P: Pattern, + <P as Pattern>::Searcher<'a>: for<'a> ReverseSearcher<'a>,

An iterator over the disjoint matches of a pattern within this string slice, yielded in reverse order.

The pattern can be a &str, char, a slice of chars, or a function or closure that determines if a character matches.

@@ -877,8 +877,8 @@
§Exampleslet v: Vec<&str> = "1abc2abc3".rmatches(char::is_numeric).collect(); assert_eq!(v, ["3", "2", "1"]);
-
1.5.0 · source

pub fn match_indices<'a, P>(&'a self, pat: P) -> MatchIndices<'a, P>
where - P: Pattern<'a>,

An iterator over the disjoint matches of a pattern within this string +

1.5.0 · source

pub fn match_indices<P>(&self, pat: P) -> MatchIndices<'_, P>
where + P: Pattern,

An iterator over the disjoint matches of a pattern within this string slice as well as the index that the match starts at.

For matches of pat within self that overlap, only the indices corresponding to the first match are returned.

@@ -899,9 +899,9 @@
§Exampleslet v: Vec<_> = "ababa".match_indices("aba").collect(); assert_eq!(v, [(0, "aba")]); // only the first `aba`
-
1.5.0 · source

pub fn rmatch_indices<'a, P>(&'a self, pat: P) -> RMatchIndices<'a, P>
where - P: Pattern<'a>, - <P as Pattern<'a>>::Searcher: ReverseSearcher<'a>,

An iterator over the disjoint matches of a pattern within self, +

1.5.0 · source

pub fn rmatch_indices<P>(&self, pat: P) -> RMatchIndices<'_, P>
where + P: Pattern, + <P as Pattern>::Searcher<'a>: for<'a> ReverseSearcher<'a>,

An iterator over the disjoint matches of a pattern within self, yielded in reverse order along with the index of the match.

For matches of pat within self that overlap, only the indices corresponding to the last match are returned.

@@ -921,14 +921,14 @@
§Exampleslet v: Vec<_> = "ababa".rmatch_indices("aba").collect(); assert_eq!(v, [(2, "aba")]); // only the last `aba`
-
1.0.0 · source

pub fn trim(&self) -> &str

Returns a string slice with leading and trailing whitespace removed.

+
1.0.0 · source

pub fn trim(&self) -> &str

Returns a string slice with leading and trailing whitespace removed.

‘Whitespace’ is defined according to the terms of the Unicode Derived Core Property White_Space, which includes newlines.

§Examples
let s = "\n Hello\tworld\t\n";
 
 assert_eq!("Hello\tworld", s.trim());
-
1.30.0 · source

pub fn trim_start(&self) -> &str

Returns a string slice with leading whitespace removed.

+
1.30.0 · source

pub fn trim_start(&self) -> &str

Returns a string slice with leading whitespace removed.

‘Whitespace’ is defined according to the terms of the Unicode Derived Core Property White_Space, which includes newlines.

§Text directionality
@@ -948,7 +948,7 @@
§Exampleslet s = " עברית "; assert!(Some('ע') == s.trim_start().chars().next());
-
1.30.0 · source

pub fn trim_end(&self) -> &str

Returns a string slice with trailing whitespace removed.

+
1.30.0 · source

pub fn trim_end(&self) -> &str

Returns a string slice with trailing whitespace removed.

‘Whitespace’ is defined according to the terms of the Unicode Derived Core Property White_Space, which includes newlines.

§Text directionality
@@ -968,7 +968,7 @@
§Exampleslet s = " עברית "; assert!(Some('ת') == s.trim_end().chars().rev().next());
-
1.0.0 · source

pub fn trim_left(&self) -> &str

👎Deprecated since 1.33.0: superseded by trim_start

Returns a string slice with leading whitespace removed.

+
1.0.0 · source

pub fn trim_left(&self) -> &str

👎Deprecated since 1.33.0: superseded by trim_start

Returns a string slice with leading whitespace removed.

‘Whitespace’ is defined according to the terms of the Unicode Derived Core Property White_Space.

§Text directionality
@@ -989,7 +989,7 @@
§Exampleslet s = " עברית"; assert!(Some('ע') == s.trim_left().chars().next());
-
1.0.0 · source

pub fn trim_right(&self) -> &str

👎Deprecated since 1.33.0: superseded by trim_end

Returns a string slice with trailing whitespace removed.

+
1.0.0 · source

pub fn trim_right(&self) -> &str

👎Deprecated since 1.33.0: superseded by trim_end

Returns a string slice with trailing whitespace removed.

‘Whitespace’ is defined according to the terms of the Unicode Derived Core Property White_Space.

§Text directionality
@@ -1010,9 +1010,9 @@
§Exampleslet s = "עברית "; assert!(Some('ת') == s.trim_right().chars().rev().next());
-
1.0.0 · source

pub fn trim_matches<'a, P>(&'a self, pat: P) -> &'a str
where - P: Pattern<'a>, - <P as Pattern<'a>>::Searcher: DoubleEndedSearcher<'a>,

Returns a string slice with all prefixes and suffixes that match a +

1.0.0 · source

pub fn trim_matches<P>(&self, pat: P) -> &str
where + P: Pattern, + <P as Pattern>::Searcher<'a>: for<'a> DoubleEndedSearcher<'a>,

Returns a string slice with all prefixes and suffixes that match a pattern repeatedly removed.

The pattern can be a char, a slice of chars, or a function or closure that determines if a character matches.

@@ -1027,8 +1027,8 @@
§ExamplesA more complex pattern, using a closure:

assert_eq!("1foo1barXX".trim_matches(|c| c == '1' || c == 'X'), "foo1bar");
-
1.30.0 · source

pub fn trim_start_matches<'a, P>(&'a self, pat: P) -> &'a str
where - P: Pattern<'a>,

Returns a string slice with all prefixes that match a pattern +

1.30.0 · source

pub fn trim_start_matches<P>(&self, pat: P) -> &str
where + P: Pattern,

Returns a string slice with all prefixes that match a pattern repeatedly removed.

The pattern can be a &str, char, a slice of chars, or a function or closure that determines if a character matches.

@@ -1043,8 +1043,8 @@
§Exampleslet x: &[_] = &['1', '2']; assert_eq!("12foo1bar12".trim_start_matches(x), "foo1bar12");
-
1.45.0 · source

pub fn strip_prefix<'a, P>(&'a self, prefix: P) -> Option<&'a str>
where - P: Pattern<'a>,

Returns a string slice with the prefix removed.

+
1.45.0 · source

pub fn strip_prefix<P>(&self, prefix: P) -> Option<&str>
where + P: Pattern,

Returns a string slice with the prefix removed.

If the string starts with the pattern prefix, returns the substring after the prefix, wrapped in Some. Unlike trim_start_matches, this method removes the prefix exactly once.

If the string does not start with prefix, returns None.

@@ -1054,9 +1054,9 @@
§Examples
assert_eq!("foo:bar".strip_prefix("foo:"), Some("bar"));
 assert_eq!("foo:bar".strip_prefix("bar"), None);
 assert_eq!("foofoo".strip_prefix("foo"), Some("foo"));
-
1.45.0 · source

pub fn strip_suffix<'a, P>(&'a self, suffix: P) -> Option<&'a str>
where - P: Pattern<'a>, - <P as Pattern<'a>>::Searcher: ReverseSearcher<'a>,

Returns a string slice with the suffix removed.

+
1.45.0 · source

pub fn strip_suffix<P>(&self, suffix: P) -> Option<&str>
where + P: Pattern, + <P as Pattern>::Searcher<'a>: for<'a> ReverseSearcher<'a>,

Returns a string slice with the suffix removed.

If the string ends with the pattern suffix, returns the substring before the suffix, wrapped in Some. Unlike trim_end_matches, this method removes the suffix exactly once.

If the string does not end with suffix, returns None.

@@ -1066,9 +1066,9 @@
§Examples
assert_eq!("bar:foo".strip_suffix(":foo"), Some("bar"));
 assert_eq!("bar:foo".strip_suffix("bar"), None);
 assert_eq!("foofoo".strip_suffix("foo"), Some("foo"));
-
1.30.0 · source

pub fn trim_end_matches<'a, P>(&'a self, pat: P) -> &'a str
where - P: Pattern<'a>, - <P as Pattern<'a>>::Searcher: ReverseSearcher<'a>,

Returns a string slice with all suffixes that match a pattern +

1.30.0 · source

pub fn trim_end_matches<P>(&self, pat: P) -> &str
where + P: Pattern, + <P as Pattern>::Searcher<'a>: for<'a> ReverseSearcher<'a>,

Returns a string slice with all suffixes that match a pattern repeatedly removed.

The pattern can be a &str, char, a slice of chars, or a function or closure that determines if a character matches.

@@ -1088,8 +1088,8 @@
§ExamplesA more complex pattern, using a closure:

assert_eq!("1fooX".trim_end_matches(|c| c == '1' || c == 'X'), "1foo");
-
1.0.0 · source

pub fn trim_left_matches<'a, P>(&'a self, pat: P) -> &'a str
where - P: Pattern<'a>,

👎Deprecated since 1.33.0: superseded by trim_start_matches

Returns a string slice with all prefixes that match a pattern +

1.0.0 · source

pub fn trim_left_matches<P>(&self, pat: P) -> &str
where + P: Pattern,

👎Deprecated since 1.33.0: superseded by trim_start_matches

Returns a string slice with all prefixes that match a pattern repeatedly removed.

The pattern can be a &str, char, a slice of chars, or a function or closure that determines if a character matches.

@@ -1104,9 +1104,9 @@
§Exampleslet x: &[_] = &['1', '2']; assert_eq!("12foo1bar12".trim_left_matches(x), "foo1bar12");
-
1.0.0 · source

pub fn trim_right_matches<'a, P>(&'a self, pat: P) -> &'a str
where - P: Pattern<'a>, - <P as Pattern<'a>>::Searcher: ReverseSearcher<'a>,

👎Deprecated since 1.33.0: superseded by trim_end_matches

Returns a string slice with all suffixes that match a pattern +

1.0.0 · source

pub fn trim_right_matches<P>(&self, pat: P) -> &str
where + P: Pattern, + <P as Pattern>::Searcher<'a>: for<'a> ReverseSearcher<'a>,

👎Deprecated since 1.33.0: superseded by trim_end_matches

Returns a string slice with all suffixes that match a pattern repeatedly removed.

The pattern can be a &str, char, a slice of chars, or a function or closure that determines if a character matches.

@@ -1244,12 +1244,32 @@
§ExamplesUsing to_string:

assert_eq!("❤\n!".escape_unicode().to_string(), "\\u{2764}\\u{a}\\u{21}");
-
1.0.0 · source

pub fn replace<'a, P>(&'a self, from: P, to: &str) -> String
where - P: Pattern<'a>,

Replaces all matches of a pattern with another string.

+
source

pub fn substr_range(&self, substr: &str) -> Option<Range<usize>>

🔬This is a nightly-only experimental API. (substr_range)

Returns the range that a substring points to.

+

Returns None if substr does not point within self.

+

Unlike str::find, this does not search through the string. +Instead, it uses pointer arithmetic to find where in the string +substr is derived from.

+

This is useful for extending str::split and similar methods.

+

Note that this method may return false positives (typically either +Some(0..0) or Some(self.len()..self.len())) if substr is a +zero-length str that points at the beginning or end of another, +independent, str.

+
§Examples
+
#![feature(substr_range)]
+
+let data = "a, b, b, a";
+let mut iter = data.split(", ").map(|s| data.substr_range(s).unwrap());
+
+assert_eq!(iter.next(), Some(0..1));
+assert_eq!(iter.next(), Some(3..4));
+assert_eq!(iter.next(), Some(6..7));
+assert_eq!(iter.next(), Some(9..10));
+
1.0.0 · source

pub fn replace<P>(&self, from: P, to: &str) -> String
where + P: Pattern,

Replaces all matches of a pattern with another string.

replace creates a new String, and copies the data from this string slice into it. While doing so, it attempts to find matches of a pattern. If it finds any, it replaces them with the replacement string slice.

-
§Examples
+
§Examples

Basic usage:

let s = "this is old";
@@ -1260,12 +1280,12 @@ 
§Examples
let s = "this is old";
 assert_eq!(s, s.replace("cookie monster", "little lamb"));
-
1.16.0 · source

pub fn replacen<'a, P>(&'a self, pat: P, to: &str, count: usize) -> String
where - P: Pattern<'a>,

Replaces first N matches of a pattern with another string.

+
1.16.0 · source

pub fn replacen<P>(&self, pat: P, to: &str, count: usize) -> String
where + P: Pattern,

Replaces first N matches of a pattern with another string.

replacen creates a new String, and copies the data from this string slice into it. While doing so, it attempts to find matches of a pattern. If it finds any, it replaces them with the replacement string slice at most count times.

-
§Examples
+
§Examples

Basic usage:

let s = "foo foo 123 foo";
@@ -1282,7 +1302,7 @@ 
§ExamplesSince some characters can expand into multiple characters when changing the case, this function returns a String instead of modifying the parameter in-place.

-
§Examples
+
§Examples

Basic usage:

let s = "HELLO";
@@ -1309,7 +1329,7 @@ 
§ExamplesSince some characters can expand into multiple characters when changing the case, this function returns a String instead of modifying the parameter in-place.

-
§Examples
+
§Examples

Basic usage:

let s = "hello";
@@ -1328,7 +1348,7 @@ 
§Examples
1.16.0 · source

pub fn repeat(&self, n: usize) -> String

Creates a new String by repeating a string n times.

§Panics

This function will panic if the capacity would overflow.

-
§Examples
+
§Examples

Basic usage:

assert_eq!("abc".repeat(4), String::from("abcabcabcabc"));
@@ -1343,7 +1363,7 @@
§ExamplesTo uppercase the value in-place, use make_ascii_uppercase.

To uppercase ASCII characters in addition to non-ASCII characters, use to_uppercase.

-
§Examples
+
§Examples
let s = "Grüße, Jürgen ❤";
 
 assert_eq!("GRüßE, JüRGEN ❤", s.to_ascii_uppercase());
@@ -1354,7 +1374,7 @@
§ExamplesTo lowercase the value in-place, use make_ascii_lowercase.

To lowercase ASCII characters in addition to non-ASCII characters, use to_lowercase.

-
§Examples
+
§Examples
let s = "Grüße, Jürgen ❤";
 
 assert_eq!("grüße, jürgen ❤", s.to_ascii_lowercase());
@@ -1413,8 +1433,8 @@
§ExamplesFromIterator<char>,
Encode the hex strict representing self into the result. Upper case letters are used (e.g. F9B4CA)
source§

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

§

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
§

impl<T> ToSmolStr for T
where - T: Display + ?Sized,

§

fn to_smolstr(&self) -> SmolStr

source§

impl<T> ToString for T
where - T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where + T: Display + ?Sized,

§

fn to_smolstr(&self) -> SmolStr

source§

impl<T> ToString for T
where + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

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

§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

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

§

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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where diff --git a/snapshots/master/docs/rust/slint/struct.SharedVector.html b/snapshots/master/docs/rust/slint/struct.SharedVector.html index d60958d9a..dce612978 100644 --- a/snapshots/master/docs/rust/slint/struct.SharedVector.html +++ b/snapshots/master/docs/rust/slint/struct.SharedVector.html @@ -1,4 +1,4 @@ -SharedVector in slint - Rust

Struct slint::SharedVector

#[repr(C)]
pub struct SharedVector<T> { /* private fields */ }
Expand description

SharedVector holds a reference-counted read-only copy of [T].

+

Struct slint::SharedVector

#[repr(C)]
pub struct SharedVector<T> { /* private fields */ }
Expand description

SharedVector holds a reference-counted read-only copy of [T].

Implementations§

§

impl<T> SharedVector<T>

pub fn with_capacity(capacity: usize) -> SharedVector<T>

Create a new empty array with a pre-allocated capacity in number of items

pub fn len(&self) -> usize

Number of elements in the array

pub fn is_empty(&self) -> bool

Return true if the SharedVector is empty

@@ -1114,13 +1114,71 @@
§Exampleslet idx = s.partition_point(|&x| x <= num); s.insert(idx, num); assert_eq!(s, [0, 1, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 42, 55]);
-
1.80.0 · source

pub fn as_flattened(&self) -> &[T]

Takes a &[[T; N]], and flattens it to a &[T].

+
source

pub fn elem_offset(&self, element: &T) -> Option<usize>

🔬This is a nightly-only experimental API. (substr_range)

Returns the index that an element reference points to.

+

Returns None if element does not point within the slice or if it points between elements.

+

This method is useful for extending slice iterators like slice::split.

+

Note that this uses pointer arithmetic and does not compare elements. +To find the index of an element via comparison, use +.iter().position() instead.

§Panics
+

Panics if T is zero-sized.

+
§Examples
+

Basic usage:

+ +
#![feature(substr_range)]
+
+let nums: &[u32] = &[1, 7, 1, 1];
+let num = &nums[2];
+
+assert_eq!(num, &1);
+assert_eq!(nums.elem_offset(num), Some(2));
+

Returning None with an in-between element:

+ +
#![feature(substr_range)]
+
+let arr: &[[u32; 2]] = &[[0, 1], [2, 3]];
+let flat_arr: &[u32] = arr.as_flattened();
+
+let ok_elm: &[u32; 2] = flat_arr[0..2].try_into().unwrap();
+let weird_elm: &[u32; 2] = flat_arr[1..3].try_into().unwrap();
+
+assert_eq!(ok_elm, &[0, 1]);
+assert_eq!(weird_elm, &[1, 2]);
+
+assert_eq!(arr.elem_offset(ok_elm), Some(0)); // Points to element 0
+assert_eq!(arr.elem_offset(weird_elm), None); // Points between element 0 and 1
+
source

pub fn subslice_range(&self, subslice: &[T]) -> Option<Range<usize>>

🔬This is a nightly-only experimental API. (substr_range)

Returns the range of indices that a subslice points to.

+

Returns None if subslice does not point within the slice or if it points between elements.

+

This method does not compare elements. Instead, this method finds the location in the slice that +subslice was obtained from. To find the index of a subslice via comparison, instead use +.windows().position().

+

This method is useful for extending slice iterators like slice::split.

+

Note that this may return a false positive (either Some(0..0) or Some(self.len()..self.len())) +if subslice has a length of zero and points to the beginning or end of another, separate, slice.

+
§Panics
+

Panics if T is zero-sized.

+
§Examples
+

Basic usage:

+ +
#![feature(substr_range)]
+
+let nums = &[0, 5, 10, 0, 0, 5];
+
+let mut iter = nums
+    .split(|t| *t == 0)
+    .map(|n| nums.subslice_range(n).unwrap());
+
+assert_eq!(iter.next(), Some(0..0));
+assert_eq!(iter.next(), Some(1..3));
+assert_eq!(iter.next(), Some(4..4));
+assert_eq!(iter.next(), Some(5..6));
+
1.80.0 · source

pub fn as_flattened(&self) -> &[T]

Takes a &[[T; N]], and flattens it to a &[T].

+
§Panics

This panics if the length of the resulting slice would overflow a usize.

This is only possible when flattening a slice of arrays of zero-sized types, and thus tends to be irrelevant in practice. If size_of::<T>() > 0, this will never panic.

-
§Examples
+
§Examples
assert_eq!([[1, 2, 3], [4, 5, 6]].as_flattened(), &[1, 2, 3, 4, 5, 6]);
 
 assert_eq!(
@@ -1135,7 +1193,7 @@ 
§Examplesassert!(empty_slice_of_arrays.as_flattened().is_empty());
1.79.0 · source

pub fn utf8_chunks(&self) -> Utf8Chunks<'_>

Creates an iterator over the contiguous valid UTF-8 ranges of this slice, and the non-UTF-8 fragments in between.

-
§Examples
+
§Examples

This function formats arbitrary but mostly-UTF-8 bytes into Rust source code in the form of a C-string literal (c"...").

@@ -1164,14 +1222,14 @@
§Examples
1.0.0 · source

pub fn to_vec(&self) -> Vec<T>
where T: Clone,

Copies self into a new Vec.

-
§Examples
+
§Examples
let s = [10, 40, 30];
 let x = s.to_vec();
 // Here, `s` and `x` can be modified independently.
source

pub fn to_vec_in<A>(&self, alloc: A) -> Vec<T, A>
where A: Allocator, T: Clone,

🔬This is a nightly-only experimental API. (allocator_api)

Copies self into a new Vec with an allocator.

-
§Examples
+
§Examples
#![feature(allocator_api)]
 
 use std::alloc::System;
@@ -1181,9 +1239,9 @@ 
§Examples// Here, `s` and `x` can be modified independently.
1.40.0 · source

pub fn repeat(&self, n: usize) -> Vec<T>
where T: Copy,

Creates a vector by copying a slice n times.

-
§Panics
+
§Panics

This function will panic if the capacity would overflow.

-
§Examples
+
§Examples

Basic usage:

assert_eq!([1, 2].repeat(3), vec![1, 2, 1, 2, 1, 2]);
@@ -1194,7 +1252,7 @@
§Examples
1.0.0 · source

pub fn concat<Item>(&self) -> <[T] as Concat<Item>>::Output
where [T]: Concat<Item>, Item: ?Sized,

Flattens a slice of T into a single value Self::Output.

-
§Examples
+
§Examples
assert_eq!(["hello", "world"].concat(), "helloworld");
 assert_eq!([[1, 2], [3, 4]].concat(), [1, 2, 3, 4]);
1.3.0 · source

pub fn join<Separator>( @@ -1203,7 +1261,7 @@

§Examples[T] as Join<Separator>>::Output
where [T]: Join<Separator>,

Flattens a slice of T into a single value Self::Output, placing a given separator between each.

-
§Examples
+
§Examples
assert_eq!(["hello", "world"].join(" "), "hello world");
 assert_eq!([[1, 2], [3, 4]].join(&0), [1, 2, 0, 3, 4]);
 assert_eq!([[1, 2], [3, 4]].join(&[0, 0][..]), [1, 2, 0, 0, 3, 4]);
@@ -1213,7 +1271,7 @@
§Examples[T] as Join<Separator>>::Output
where [T]: Join<Separator>,
👎Deprecated since 1.3.0: renamed to join

Flattens a slice of T into a single value Self::Output, placing a given separator between each.

-
§Examples
+
§Examples
assert_eq!(["hello", "world"].connect(" "), "hello world");
 assert_eq!([[1, 2], [3, 4]].connect(&0), [1, 2, 0, 3, 4]);
1.23.0 · source

pub fn to_ascii_uppercase(&self) -> Vec<u8>

Returns a vector containing a copy of this slice where each byte diff --git a/snapshots/master/docs/rust/slint/struct.SortModel.html b/snapshots/master/docs/rust/slint/struct.SortModel.html index 87fb87463..86223e9f2 100644 --- a/snapshots/master/docs/rust/slint/struct.SortModel.html +++ b/snapshots/master/docs/rust/slint/struct.SortModel.html @@ -1,4 +1,4 @@ -SortModel in slint - Rust

Enum slint_interpreter::PlatformError

#[non_exhaustive]
pub enum PlatformError { +

Enum slint_interpreter::PlatformError

#[non_exhaustive]
pub enum PlatformError { NoPlatform, NoEventLoopProvider, SetPlatformError(SetPlatformError), Other(String), - OtherError(Box<dyn Error + Sync + Send>), + OtherError(Box<dyn Error + Send + Sync>), }
Expand description

The platform encountered a fatal error.

This error typically indicates an issue with initialization or connecting to the windowing system.

This can be constructed from a String:

@@ -140,8 +140,8 @@ is not implemented for the current platform.

§

SetPlatformError(SetPlatformError)

There is already a platform set from another thread.

§

Other(String)

Another platform-specific error occurred

-
§

OtherError(Box<dyn Error + Sync + Send>)

Another platform-specific error occurred.

-

Trait Implementations§

§

impl Debug for PlatformError

§

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

Formats the value using the given formatter. Read more
§

impl Display for PlatformError

§

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

Formats the value using the given formatter. Read more
§

impl Error for PlatformError

§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
§

impl From<&str> for PlatformError

§

fn from(value: &str) -> PlatformError

Converts to this type from the input type.
§

impl From<Box<dyn Error + Sync + Send>> for PlatformError

§

fn from(error: Box<dyn Error + Sync + Send>) -> PlatformError

Converts to this type from the input type.
§

impl From<String> for PlatformError

§

fn from(value: String) -> PlatformError

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where +
§

OtherError(Box<dyn Error + Send + Sync>)

Another platform-specific error occurred.

+

Trait Implementations§

§

impl Debug for PlatformError

§

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

Formats the value using the given formatter. Read more
§

impl Display for PlatformError

§

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

Formats the value using the given formatter. Read more
§

impl Error for PlatformError

§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
§

impl From<&str> for PlatformError

§

fn from(value: &str) -> PlatformError

Converts to this type from the input type.
§

impl From<Box<dyn Error + Send + Sync>> for PlatformError

§

fn from(error: Box<dyn Error + Send + Sync>) -> PlatformError

Converts to this type from the input type.
§

impl From<String> for PlatformError

§

fn from(value: String) -> PlatformError

Converts to this type from the input type.

Auto Trait Implementations§

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
§

impl<T> Downcast for T
where @@ -150,7 +150,7 @@ further downcast into Rc<ConcreteType> where ConcreteType implements Trait.

§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
§

impl<T> DowncastSync for T
where - T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be + T: Any + Send + Sync,
§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

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

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

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an @@ -166,8 +166,8 @@ if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
§

impl<T> ToSmolStr for T
where - T: Display + ?Sized,

§

fn to_smolstr(&self) -> SmolStr

source§

impl<T> ToString for T
where - T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where + T: Display + ?Sized,

§

fn to_smolstr(&self) -> SmolStr

source§

impl<T> ToString for T
where + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

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

§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

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

§

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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where diff --git a/snapshots/master/docs/rust/slint_interpreter/enum.RenderingState.html b/snapshots/master/docs/rust/slint_interpreter/enum.RenderingState.html index 6470ae55c..ee802f04e 100644 --- a/snapshots/master/docs/rust/slint_interpreter/enum.RenderingState.html +++ b/snapshots/master/docs/rust/slint_interpreter/enum.RenderingState.html @@ -1,4 +1,4 @@ -RenderingState in slint_interpreter - Rust

Struct slint_interpreter::SharedString

#[repr(C)]
pub struct SharedString { /* private fields */ }
Expand description

(Re-export from corelib.) +

Struct slint_interpreter::SharedString

#[repr(C)]
pub struct SharedString { /* private fields */ }
Expand description

(Re-export from corelib.) A string type used by the Slint run-time.

SharedString uses implicit data sharing to make it efficient to pass around copies. When cloning, a reference to the data is cloned, not the data itself. The data itself is only copied @@ -139,7 +139,7 @@ hello.push_str("World"); hello.push_str("!"); assert_eq!(hello, "Hello, World!");

-

Methods from Deref<Target = str>§

1.0.0 · source

pub fn len(&self) -> usize

Returns the length of self.

+

Methods from Deref<Target = str>§

1.0.0 · source

pub fn len(&self) -> usize

Returns the length of self.

This length is in bytes, not chars or graphemes. In other words, it might not be what a human considers the length of the string.

§Examples
@@ -148,14 +148,14 @@
§Examples
assert_eq!("ƒoo".len(), 4); // fancy f! assert_eq!("ƒoo".chars().count(), 3);
-
1.0.0 · source

pub fn is_empty(&self) -> bool

Returns true if self has a length of zero bytes.

+
1.0.0 · source

pub fn is_empty(&self) -> bool

Returns true if self has a length of zero bytes.

§Examples
let s = "";
 assert!(s.is_empty());
 
 let s = "not empty";
 assert!(!s.is_empty());
-
1.9.0 · source

pub fn is_char_boundary(&self, index: usize) -> bool

Checks that index-th byte is the first byte in a UTF-8 code point +

1.9.0 · source

pub fn is_char_boundary(&self, index: usize) -> bool

Checks that index-th byte is the first byte in a UTF-8 code point sequence or the end of the string.

The start and end of the string (when index == self.len()) are considered to be boundaries.

@@ -172,7 +172,7 @@
§Examples
// third byte of `老` assert!(!s.is_char_boundary(8));
-
source

pub fn floor_char_boundary(&self, index: usize) -> usize

🔬This is a nightly-only experimental API. (round_char_boundary)

Finds the closest x not exceeding index where is_char_boundary(x) is true.

+
source

pub fn floor_char_boundary(&self, index: usize) -> usize

🔬This is a nightly-only experimental API. (round_char_boundary)

Finds the closest x not exceeding index where is_char_boundary(x) is true.

This method can help you truncate a string so that it’s still valid UTF-8, but doesn’t exceed a given number of bytes. Note that this is done purely at the character level and can still visually split graphemes, even though the underlying characters aren’t @@ -187,7 +187,7 @@

§Examples
let closest = s.floor_char_boundary(13); assert_eq!(closest, 10); assert_eq!(&s[..closest], "❤️🧡");
-
source

pub fn ceil_char_boundary(&self, index: usize) -> usize

🔬This is a nightly-only experimental API. (round_char_boundary)

Finds the closest x not below index where is_char_boundary(x) is true.

+
source

pub fn ceil_char_boundary(&self, index: usize) -> usize

🔬This is a nightly-only experimental API. (round_char_boundary)

Finds the closest x not below index where is_char_boundary(x) is true.

If index is greater than the length of the string, this returns the length of the string.

This method is the natural complement to floor_char_boundary. See that method for more details.

@@ -200,12 +200,12 @@
§Examples
let closest = s.ceil_char_boundary(13); assert_eq!(closest, 14); assert_eq!(&s[..closest], "❤️🧡💛");
-
1.0.0 · source

pub fn as_bytes(&self) -> &[u8]

Converts a string slice to a byte slice. To convert the byte slice back +

1.0.0 · source

pub fn as_bytes(&self) -> &[u8]

Converts a string slice to a byte slice. To convert the byte slice back into a string slice, use the from_utf8 function.

§Examples
let bytes = "bors".as_bytes();
 assert_eq!(b"bors", bytes);
-
1.0.0 · source

pub fn as_ptr(&self) -> *const u8

Converts a string slice to a raw pointer.

+
1.0.0 · source

pub fn as_ptr(&self) -> *const u8

Converts a string slice to a raw pointer.

As string slices are a slice of bytes, the raw pointer points to a u8. This pointer will be pointing to the first byte of the string slice.

@@ -214,7 +214,7 @@
§Examples
§Examples
let s = "Hello";
 let ptr = s.as_ptr();
-
1.20.0 · source

pub fn get<I>(&self, i: I) -> Option<&<I as SliceIndex<str>>::Output>
where +

1.20.0 · source

pub fn get<I>(&self, i: I) -> Option<&<I as SliceIndex<str>>::Output>
where I: SliceIndex<str>,

Returns a subslice of str.

This is the non-panicking alternative to indexing the str. Returns None whenever equivalent indexing operation would panic.

@@ -229,7 +229,7 @@
§Examples
// out of bounds assert!(v.get(..42).is_none());
-
1.20.0 · source

pub unsafe fn get_unchecked<I>(&self, i: I) -> &<I as SliceIndex<str>>::Output
where +

1.20.0 · source

pub unsafe fn get_unchecked<I>(&self, i: I) -> &<I as SliceIndex<str>>::Output
where I: SliceIndex<str>,

Returns an unchecked subslice of str.

This is the unchecked alternative to indexing the str.

§Safety
@@ -249,7 +249,7 @@
§Examples
assert_eq!("∈", v.get_unchecked(4..7)); assert_eq!("🌏", v.get_unchecked(7..11)); }
-
1.0.0 · source

pub unsafe fn slice_unchecked(&self, begin: usize, end: usize) -> &str

👎Deprecated since 1.29.0: use get_unchecked(begin..end) instead

Creates a string slice from another string slice, bypassing safety +

1.0.0 · source

pub unsafe fn slice_unchecked(&self, begin: usize, end: usize) -> &str

👎Deprecated since 1.29.0: use get_unchecked(begin..end) instead

Creates a string slice from another string slice, bypassing safety checks.

This is generally not recommended, use with caution! For a safe alternative see str and Index.

@@ -277,7 +277,7 @@
§Examples
unsafe { assert_eq!("world", s.slice_unchecked(7, 12)); }
-
1.4.0 · source

pub fn split_at(&self, mid: usize) -> (&str, &str)

Divide one string slice into two at an index.

+
1.4.0 · source

pub fn split_at(&self, mid: usize) -> (&str, &str)

Divide one string slice into two at an index.

The argument, mid, should be a byte offset from the start of the string. It must also be on the boundary of a UTF-8 code point.

The two slices returned go from the start of the string slice to mid, @@ -295,7 +295,7 @@

§Examplesassert_eq!("Per", first); assert_eq!(" Martin-Löf", last);
-
1.80.0 · source

pub fn split_at_checked(&self, mid: usize) -> Option<(&str, &str)>

Divide one string slice into two at an index.

+
1.80.0 · source

pub fn split_at_checked(&self, mid: usize) -> Option<(&str, &str)>

Divide one string slice into two at an index.

The argument, mid, should be a valid byte offset from the start of the string. It must also be on the boundary of a UTF-8 code point. The method returns None if that’s not the case.

@@ -312,7 +312,7 @@
§Examplesassert_eq!(None, s.split_at_checked(13)); // Inside “ö” assert_eq!(None, s.split_at_checked(16)); // Beyond the string length
-
1.0.0 · source

pub fn chars(&self) -> Chars<'_>

Returns an iterator over the chars of a string slice.

+
1.0.0 · source

pub fn chars(&self) -> Chars<'_>

Returns an iterator over the chars of a string slice.

As a string slice consists of valid UTF-8, we can iterate through a string slice by char. This method returns such an iterator.

It’s important to remember that char represents a Unicode Scalar @@ -348,7 +348,7 @@

§Examplesassert_eq!(Some('\u{0306}'), chars.next()); assert_eq!(None, chars.next());
-
1.0.0 · source

pub fn char_indices(&self) -> CharIndices<'_>

Returns an iterator over the chars of a string slice, and their +

1.0.0 · source

pub fn char_indices(&self) -> CharIndices<'_>

Returns an iterator over the chars of a string slice, and their positions.

As a string slice consists of valid UTF-8, we can iterate through a string slice by char. This method returns an iterator of both @@ -388,7 +388,7 @@

§Examplesassert_eq!(Some((4, 's')), char_indices.next()); assert_eq!(None, char_indices.next());
-
1.0.0 · source

pub fn bytes(&self) -> Bytes<'_>

An iterator over the bytes of a string slice.

+
1.0.0 · source

pub fn bytes(&self) -> Bytes<'_>

An iterator over the bytes of a string slice.

As a string slice consists of a sequence of bytes, we can iterate through a string slice by byte. This method returns such an iterator.

§Examples
@@ -400,7 +400,7 @@
§Examplesassert_eq!(Some(b's'), bytes.next()); assert_eq!(None, bytes.next());
-
1.1.0 · source

pub fn split_whitespace(&self) -> SplitWhitespace<'_>

Splits a string slice by whitespace.

+
1.1.0 · source

pub fn split_whitespace(&self) -> SplitWhitespace<'_>

Splits a string slice by whitespace.

The iterator returned will return string slices that are sub-slices of the original string slice, separated by any amount of whitespace.

‘Whitespace’ is defined according to the terms of the Unicode Derived @@ -430,7 +430,7 @@

§Examples
assert_eq!("".split_whitespace().next(), None);
 assert_eq!("   ".split_whitespace().next(), None);
-
1.34.0 · source

pub fn split_ascii_whitespace(&self) -> SplitAsciiWhitespace<'_>

Splits a string slice by ASCII whitespace.

+
1.34.0 · source

pub fn split_ascii_whitespace(&self) -> SplitAsciiWhitespace<'_>

Splits a string slice by ASCII whitespace.

The iterator returned will return string slices that are sub-slices of the original string slice, separated by any amount of ASCII whitespace.

To split by Unicode Whitespace instead, use split_whitespace.

@@ -458,7 +458,7 @@
§Examples
assert_eq!("".split_ascii_whitespace().next(), None);
 assert_eq!("   ".split_ascii_whitespace().next(), None);
-
1.0.0 · source

pub fn lines(&self) -> Lines<'_>

An iterator over the lines of a string, as string slices.

+
1.0.0 · source

pub fn lines(&self) -> Lines<'_>

An iterator over the lines of a string, as string slices.

Lines are split at line endings that are either newlines (\n) or sequences of a carriage return followed by a line feed (\r\n).

Line terminators are not included in the lines returned by the iterator.

@@ -492,8 +492,8 @@
§Examplesassert_eq!(Some("baz"), lines.next()); assert_eq!(None, lines.next());
-
1.0.0 · source

pub fn lines_any(&self) -> LinesAny<'_>

👎Deprecated since 1.4.0: use lines() instead now

An iterator over the lines of a string.

-
1.8.0 · source

pub fn encode_utf16(&self) -> EncodeUtf16<'_>

Returns an iterator of u16 over the string encoded as UTF-16.

+
1.0.0 · source

pub fn lines_any(&self) -> LinesAny<'_>

👎Deprecated since 1.4.0: use lines() instead now

An iterator over the lines of a string.

+
1.8.0 · source

pub fn encode_utf16(&self) -> EncodeUtf16<'_>

Returns an iterator of u16 over the string encoded as UTF-16.

§Examples
let text = "Zażółć gęślą jaźń";
 
@@ -501,8 +501,8 @@ 
§Exampleslet utf16_len = text.encode_utf16().count(); assert!(utf16_len <= utf8_len);
-
1.0.0 · source

pub fn contains<'a, P>(&'a self, pat: P) -> bool
where - P: Pattern<'a>,

Returns true if the given pattern matches a sub-slice of +

1.0.0 · source

pub fn contains<P>(&self, pat: P) -> bool
where + P: Pattern,

Returns true if the given pattern matches a sub-slice of this string slice.

Returns false if it does not.

The pattern can be a &str, char, a slice of chars, or a @@ -512,8 +512,8 @@

§Examplesassert!(bananas.contains("nana")); assert!(!bananas.contains("apples"));
-
1.0.0 · source

pub fn starts_with<'a, P>(&'a self, pat: P) -> bool
where - P: Pattern<'a>,

Returns true if the given pattern matches a prefix of this +

1.0.0 · source

pub fn starts_with<P>(&self, pat: P) -> bool
where + P: Pattern,

Returns true if the given pattern matches a prefix of this string slice.

Returns false if it does not.

The pattern can be a &str, in which case this function will return true if @@ -533,9 +533,9 @@

§Examples// Note that both of these assert successfully. assert!(bananas.starts_with(&['b', 'a', 'n', 'a'])); assert!(bananas.starts_with(&['a', 'b', 'c', 'd']));
-
1.0.0 · source

pub fn ends_with<'a, P>(&'a self, pat: P) -> bool
where - P: Pattern<'a>, - <P as Pattern<'a>>::Searcher: ReverseSearcher<'a>,

Returns true if the given pattern matches a suffix of this +

1.0.0 · source

pub fn ends_with<P>(&self, pat: P) -> bool
where + P: Pattern, + <P as Pattern>::Searcher<'a>: for<'a> ReverseSearcher<'a>,

Returns true if the given pattern matches a suffix of this string slice.

Returns false if it does not.

The pattern can be a &str, char, a slice of chars, or a @@ -545,8 +545,8 @@

§Examplesassert!(bananas.ends_with("anas")); assert!(!bananas.ends_with("nana"));
-
1.0.0 · source

pub fn find<'a, P>(&'a self, pat: P) -> Option<usize>
where - P: Pattern<'a>,

Returns the byte index of the first character of this string slice that +

1.0.0 · source

pub fn find<P>(&self, pat: P) -> Option<usize>
where + P: Pattern,

Returns the byte index of the first character of this string slice that matches the pattern.

Returns None if the pattern doesn’t match.

The pattern can be a &str, char, a slice of chars, or a @@ -573,9 +573,9 @@

§Exampleslet x: &[_] = &['1', '2']; assert_eq!(s.find(x), None);
-
1.0.0 · source

pub fn rfind<'a, P>(&'a self, pat: P) -> Option<usize>
where - P: Pattern<'a>, - <P as Pattern<'a>>::Searcher: ReverseSearcher<'a>,

Returns the byte index for the first character of the last match of the pattern in +

1.0.0 · source

pub fn rfind<P>(&self, pat: P) -> Option<usize>
where + P: Pattern, + <P as Pattern>::Searcher<'a>: for<'a> ReverseSearcher<'a>,

Returns the byte index for the first character of the last match of the pattern in this string slice.

Returns None if the pattern doesn’t match.

The pattern can be a &str, char, a slice of chars, or a @@ -600,8 +600,8 @@

§Exampleslet x: &[_] = &['1', '2']; assert_eq!(s.rfind(x), None);
-
1.0.0 · source

pub fn split<'a, P>(&'a self, pat: P) -> Split<'a, P>
where - P: Pattern<'a>,

An iterator over substrings of this string slice, separated by +

1.0.0 · source

pub fn split<P>(&self, pat: P) -> Split<'_, P>
where + P: Pattern,

An iterator over substrings of this string slice, separated by characters matched by a pattern.

The pattern can be a &str, char, a slice of chars, or a function or closure that determines if a character matches.

@@ -674,8 +674,8 @@
§Examples
assert_eq!(d, &["a", "b", "c"]);

Use split_whitespace for this behavior.

-
1.51.0 · source

pub fn split_inclusive<'a, P>(&'a self, pat: P) -> SplitInclusive<'a, P>
where - P: Pattern<'a>,

An iterator over substrings of this string slice, separated by +

1.51.0 · source

pub fn split_inclusive<P>(&self, pat: P) -> SplitInclusive<'_, P>
where + P: Pattern,

An iterator over substrings of this string slice, separated by characters matched by a pattern. Differs from the iterator produced by split in that split_inclusive leaves the matched part as the terminator of the substring.

@@ -692,9 +692,9 @@
§Examples
let v: Vec<&str> = "Mary had a little lamb\nlittle lamb\nlittle lamb.\n"
     .split_inclusive('\n').collect();
 assert_eq!(v, ["Mary had a little lamb\n", "little lamb\n", "little lamb.\n"]);
-
1.0.0 · source

pub fn rsplit<'a, P>(&'a self, pat: P) -> RSplit<'a, P>
where - P: Pattern<'a>, - <P as Pattern<'a>>::Searcher: ReverseSearcher<'a>,

An iterator over substrings of the given string slice, separated by +

1.0.0 · source

pub fn rsplit<P>(&self, pat: P) -> RSplit<'_, P>
where + P: Pattern, + <P as Pattern>::Searcher<'a>: for<'a> ReverseSearcher<'a>,

An iterator over substrings of the given string slice, separated by characters matched by a pattern and yielded in reverse order.

The pattern can be a &str, char, a slice of chars, or a function or closure that determines if a character matches.

@@ -721,8 +721,8 @@
§Examples
let v: Vec<&str> = "abc1defXghi".rsplit(|c| c == '1' || c == 'X').collect();
 assert_eq!(v, ["ghi", "def", "abc"]);
-
1.0.0 · source

pub fn split_terminator<'a, P>(&'a self, pat: P) -> SplitTerminator<'a, P>
where - P: Pattern<'a>,

An iterator over substrings of the given string slice, separated by +

1.0.0 · source

pub fn split_terminator<P>(&self, pat: P) -> SplitTerminator<'_, P>
where + P: Pattern,

An iterator over substrings of the given string slice, separated by characters matched by a pattern.

The pattern can be a &str, char, a slice of chars, or a function or closure that determines if a character matches.

@@ -745,9 +745,9 @@
§Exampleslet v: Vec<&str> = "A.B:C.D".split_terminator(&['.', ':'][..]).collect(); assert_eq!(v, ["A", "B", "C", "D"]);
-
1.0.0 · source

pub fn rsplit_terminator<'a, P>(&'a self, pat: P) -> RSplitTerminator<'a, P>
where - P: Pattern<'a>, - <P as Pattern<'a>>::Searcher: ReverseSearcher<'a>,

An iterator over substrings of self, separated by characters +

1.0.0 · source

pub fn rsplit_terminator<P>(&self, pat: P) -> RSplitTerminator<'_, P>
where + P: Pattern, + <P as Pattern>::Searcher<'a>: for<'a> ReverseSearcher<'a>,

An iterator over substrings of self, separated by characters matched by a pattern and yielded in reverse order.

The pattern can be a &str, char, a slice of chars, or a function or closure that determines if a character matches.

@@ -770,8 +770,8 @@
§Exampleslet v: Vec<&str> = "A.B:C.D".rsplit_terminator(&['.', ':'][..]).collect(); assert_eq!(v, ["D", "C", "B", "A"]);
-
1.0.0 · source

pub fn splitn<'a, P>(&'a self, n: usize, pat: P) -> SplitN<'a, P>
where - P: Pattern<'a>,

An iterator over substrings of the given string slice, separated by a +

1.0.0 · source

pub fn splitn<P>(&self, n: usize, pat: P) -> SplitN<'_, P>
where + P: Pattern,

An iterator over substrings of the given string slice, separated by a pattern, restricted to returning at most n items.

If n substrings are returned, the last substring (the nth substring) will contain the remainder of the string.

@@ -800,9 +800,9 @@
§Examples
let v: Vec<&str> = "abc1defXghi".splitn(2, |c| c == '1' || c == 'X').collect();
 assert_eq!(v, ["abc", "defXghi"]);
-
1.0.0 · source

pub fn rsplitn<'a, P>(&'a self, n: usize, pat: P) -> RSplitN<'a, P>
where - P: Pattern<'a>, - <P as Pattern<'a>>::Searcher: ReverseSearcher<'a>,

An iterator over substrings of this string slice, separated by a +

1.0.0 · source

pub fn rsplitn<P>(&self, n: usize, pat: P) -> RSplitN<'_, P>
where + P: Pattern, + <P as Pattern>::Searcher<'a>: for<'a> ReverseSearcher<'a>,

An iterator over substrings of this string slice, separated by a pattern, starting from the end of the string, restricted to returning at most n items.

If n substrings are returned, the last substring (the nth substring) @@ -828,24 +828,24 @@

§Examples
let v: Vec<&str> = "abc1defXghi".rsplitn(2, |c| c == '1' || c == 'X').collect();
 assert_eq!(v, ["ghi", "abc1def"]);
-
1.52.0 · source

pub fn split_once<'a, P>(&'a self, delimiter: P) -> Option<(&'a str, &'a str)>
where - P: Pattern<'a>,

Splits the string on the first occurrence of the specified delimiter and +

1.52.0 · source

pub fn split_once<P>(&self, delimiter: P) -> Option<(&str, &str)>
where + P: Pattern,

Splits the string on the first occurrence of the specified delimiter and returns prefix before delimiter and suffix after delimiter.

§Examples
assert_eq!("cfg".split_once('='), None);
 assert_eq!("cfg=".split_once('='), Some(("cfg", "")));
 assert_eq!("cfg=foo".split_once('='), Some(("cfg", "foo")));
 assert_eq!("cfg=foo=bar".split_once('='), Some(("cfg", "foo=bar")));
-
1.52.0 · source

pub fn rsplit_once<'a, P>(&'a self, delimiter: P) -> Option<(&'a str, &'a str)>
where - P: Pattern<'a>, - <P as Pattern<'a>>::Searcher: ReverseSearcher<'a>,

Splits the string on the last occurrence of the specified delimiter and +

1.52.0 · source

pub fn rsplit_once<P>(&self, delimiter: P) -> Option<(&str, &str)>
where + P: Pattern, + <P as Pattern>::Searcher<'a>: for<'a> ReverseSearcher<'a>,

Splits the string on the last occurrence of the specified delimiter and returns prefix before delimiter and suffix after delimiter.

§Examples
assert_eq!("cfg".rsplit_once('='), None);
 assert_eq!("cfg=foo".rsplit_once('='), Some(("cfg", "foo")));
 assert_eq!("cfg=foo=bar".rsplit_once('='), Some(("cfg=foo", "bar")));
-
1.2.0 · source

pub fn matches<'a, P>(&'a self, pat: P) -> Matches<'a, P>
where - P: Pattern<'a>,

An iterator over the disjoint matches of a pattern within the given string +

1.2.0 · source

pub fn matches<P>(&self, pat: P) -> Matches<'_, P>
where + P: Pattern,

An iterator over the disjoint matches of a pattern within the given string slice.

The pattern can be a &str, char, a slice of chars, or a function or closure that determines if a character matches.

@@ -861,9 +861,9 @@
§Exampleslet v: Vec<&str> = "1abc2abc3".matches(char::is_numeric).collect(); assert_eq!(v, ["1", "2", "3"]);
-
1.2.0 · source

pub fn rmatches<'a, P>(&'a self, pat: P) -> RMatches<'a, P>
where - P: Pattern<'a>, - <P as Pattern<'a>>::Searcher: ReverseSearcher<'a>,

An iterator over the disjoint matches of a pattern within this string slice, +

1.2.0 · source

pub fn rmatches<P>(&self, pat: P) -> RMatches<'_, P>
where + P: Pattern, + <P as Pattern>::Searcher<'a>: for<'a> ReverseSearcher<'a>,

An iterator over the disjoint matches of a pattern within this string slice, yielded in reverse order.

The pattern can be a &str, char, a slice of chars, or a function or closure that determines if a character matches.

@@ -878,8 +878,8 @@
§Exampleslet v: Vec<&str> = "1abc2abc3".rmatches(char::is_numeric).collect(); assert_eq!(v, ["3", "2", "1"]);
-
1.5.0 · source

pub fn match_indices<'a, P>(&'a self, pat: P) -> MatchIndices<'a, P>
where - P: Pattern<'a>,

An iterator over the disjoint matches of a pattern within this string +

1.5.0 · source

pub fn match_indices<P>(&self, pat: P) -> MatchIndices<'_, P>
where + P: Pattern,

An iterator over the disjoint matches of a pattern within this string slice as well as the index that the match starts at.

For matches of pat within self that overlap, only the indices corresponding to the first match are returned.

@@ -900,9 +900,9 @@
§Exampleslet v: Vec<_> = "ababa".match_indices("aba").collect(); assert_eq!(v, [(0, "aba")]); // only the first `aba`
-
1.5.0 · source

pub fn rmatch_indices<'a, P>(&'a self, pat: P) -> RMatchIndices<'a, P>
where - P: Pattern<'a>, - <P as Pattern<'a>>::Searcher: ReverseSearcher<'a>,

An iterator over the disjoint matches of a pattern within self, +

1.5.0 · source

pub fn rmatch_indices<P>(&self, pat: P) -> RMatchIndices<'_, P>
where + P: Pattern, + <P as Pattern>::Searcher<'a>: for<'a> ReverseSearcher<'a>,

An iterator over the disjoint matches of a pattern within self, yielded in reverse order along with the index of the match.

For matches of pat within self that overlap, only the indices corresponding to the last match are returned.

@@ -922,14 +922,14 @@
§Exampleslet v: Vec<_> = "ababa".rmatch_indices("aba").collect(); assert_eq!(v, [(2, "aba")]); // only the last `aba`
-
1.0.0 · source

pub fn trim(&self) -> &str

Returns a string slice with leading and trailing whitespace removed.

+
1.0.0 · source

pub fn trim(&self) -> &str

Returns a string slice with leading and trailing whitespace removed.

‘Whitespace’ is defined according to the terms of the Unicode Derived Core Property White_Space, which includes newlines.

§Examples
let s = "\n Hello\tworld\t\n";
 
 assert_eq!("Hello\tworld", s.trim());
-
1.30.0 · source

pub fn trim_start(&self) -> &str

Returns a string slice with leading whitespace removed.

+
1.30.0 · source

pub fn trim_start(&self) -> &str

Returns a string slice with leading whitespace removed.

‘Whitespace’ is defined according to the terms of the Unicode Derived Core Property White_Space, which includes newlines.

§Text directionality
@@ -949,7 +949,7 @@
§Exampleslet s = " עברית "; assert!(Some('ע') == s.trim_start().chars().next());
-
1.30.0 · source

pub fn trim_end(&self) -> &str

Returns a string slice with trailing whitespace removed.

+
1.30.0 · source

pub fn trim_end(&self) -> &str

Returns a string slice with trailing whitespace removed.

‘Whitespace’ is defined according to the terms of the Unicode Derived Core Property White_Space, which includes newlines.

§Text directionality
@@ -969,7 +969,7 @@
§Exampleslet s = " עברית "; assert!(Some('ת') == s.trim_end().chars().rev().next());
-
1.0.0 · source

pub fn trim_left(&self) -> &str

👎Deprecated since 1.33.0: superseded by trim_start

Returns a string slice with leading whitespace removed.

+
1.0.0 · source

pub fn trim_left(&self) -> &str

👎Deprecated since 1.33.0: superseded by trim_start

Returns a string slice with leading whitespace removed.

‘Whitespace’ is defined according to the terms of the Unicode Derived Core Property White_Space.

§Text directionality
@@ -990,7 +990,7 @@
§Exampleslet s = " עברית"; assert!(Some('ע') == s.trim_left().chars().next());
-
1.0.0 · source

pub fn trim_right(&self) -> &str

👎Deprecated since 1.33.0: superseded by trim_end

Returns a string slice with trailing whitespace removed.

+
1.0.0 · source

pub fn trim_right(&self) -> &str

👎Deprecated since 1.33.0: superseded by trim_end

Returns a string slice with trailing whitespace removed.

‘Whitespace’ is defined according to the terms of the Unicode Derived Core Property White_Space.

§Text directionality
@@ -1011,9 +1011,9 @@
§Exampleslet s = "עברית "; assert!(Some('ת') == s.trim_right().chars().rev().next());
-
1.0.0 · source

pub fn trim_matches<'a, P>(&'a self, pat: P) -> &'a str
where - P: Pattern<'a>, - <P as Pattern<'a>>::Searcher: DoubleEndedSearcher<'a>,

Returns a string slice with all prefixes and suffixes that match a +

1.0.0 · source

pub fn trim_matches<P>(&self, pat: P) -> &str
where + P: Pattern, + <P as Pattern>::Searcher<'a>: for<'a> DoubleEndedSearcher<'a>,

Returns a string slice with all prefixes and suffixes that match a pattern repeatedly removed.

The pattern can be a char, a slice of chars, or a function or closure that determines if a character matches.

@@ -1028,8 +1028,8 @@
§ExamplesA more complex pattern, using a closure:

assert_eq!("1foo1barXX".trim_matches(|c| c == '1' || c == 'X'), "foo1bar");
-
1.30.0 · source

pub fn trim_start_matches<'a, P>(&'a self, pat: P) -> &'a str
where - P: Pattern<'a>,

Returns a string slice with all prefixes that match a pattern +

1.30.0 · source

pub fn trim_start_matches<P>(&self, pat: P) -> &str
where + P: Pattern,

Returns a string slice with all prefixes that match a pattern repeatedly removed.

The pattern can be a &str, char, a slice of chars, or a function or closure that determines if a character matches.

@@ -1044,8 +1044,8 @@
§Exampleslet x: &[_] = &['1', '2']; assert_eq!("12foo1bar12".trim_start_matches(x), "foo1bar12");
-
1.45.0 · source

pub fn strip_prefix<'a, P>(&'a self, prefix: P) -> Option<&'a str>
where - P: Pattern<'a>,

Returns a string slice with the prefix removed.

+
1.45.0 · source

pub fn strip_prefix<P>(&self, prefix: P) -> Option<&str>
where + P: Pattern,

Returns a string slice with the prefix removed.

If the string starts with the pattern prefix, returns the substring after the prefix, wrapped in Some. Unlike trim_start_matches, this method removes the prefix exactly once.

If the string does not start with prefix, returns None.

@@ -1055,9 +1055,9 @@
§Examples
assert_eq!("foo:bar".strip_prefix("foo:"), Some("bar"));
 assert_eq!("foo:bar".strip_prefix("bar"), None);
 assert_eq!("foofoo".strip_prefix("foo"), Some("foo"));
-
1.45.0 · source

pub fn strip_suffix<'a, P>(&'a self, suffix: P) -> Option<&'a str>
where - P: Pattern<'a>, - <P as Pattern<'a>>::Searcher: ReverseSearcher<'a>,

Returns a string slice with the suffix removed.

+
1.45.0 · source

pub fn strip_suffix<P>(&self, suffix: P) -> Option<&str>
where + P: Pattern, + <P as Pattern>::Searcher<'a>: for<'a> ReverseSearcher<'a>,

Returns a string slice with the suffix removed.

If the string ends with the pattern suffix, returns the substring before the suffix, wrapped in Some. Unlike trim_end_matches, this method removes the suffix exactly once.

If the string does not end with suffix, returns None.

@@ -1067,9 +1067,9 @@
§Examples
assert_eq!("bar:foo".strip_suffix(":foo"), Some("bar"));
 assert_eq!("bar:foo".strip_suffix("bar"), None);
 assert_eq!("foofoo".strip_suffix("foo"), Some("foo"));
-
1.30.0 · source

pub fn trim_end_matches<'a, P>(&'a self, pat: P) -> &'a str
where - P: Pattern<'a>, - <P as Pattern<'a>>::Searcher: ReverseSearcher<'a>,

Returns a string slice with all suffixes that match a pattern +

1.30.0 · source

pub fn trim_end_matches<P>(&self, pat: P) -> &str
where + P: Pattern, + <P as Pattern>::Searcher<'a>: for<'a> ReverseSearcher<'a>,

Returns a string slice with all suffixes that match a pattern repeatedly removed.

The pattern can be a &str, char, a slice of chars, or a function or closure that determines if a character matches.

@@ -1089,8 +1089,8 @@
§ExamplesA more complex pattern, using a closure:

assert_eq!("1fooX".trim_end_matches(|c| c == '1' || c == 'X'), "1foo");
-
1.0.0 · source

pub fn trim_left_matches<'a, P>(&'a self, pat: P) -> &'a str
where - P: Pattern<'a>,

👎Deprecated since 1.33.0: superseded by trim_start_matches

Returns a string slice with all prefixes that match a pattern +

1.0.0 · source

pub fn trim_left_matches<P>(&self, pat: P) -> &str
where + P: Pattern,

👎Deprecated since 1.33.0: superseded by trim_start_matches

Returns a string slice with all prefixes that match a pattern repeatedly removed.

The pattern can be a &str, char, a slice of chars, or a function or closure that determines if a character matches.

@@ -1105,9 +1105,9 @@
§Exampleslet x: &[_] = &['1', '2']; assert_eq!("12foo1bar12".trim_left_matches(x), "foo1bar12");
-
1.0.0 · source

pub fn trim_right_matches<'a, P>(&'a self, pat: P) -> &'a str
where - P: Pattern<'a>, - <P as Pattern<'a>>::Searcher: ReverseSearcher<'a>,

👎Deprecated since 1.33.0: superseded by trim_end_matches

Returns a string slice with all suffixes that match a pattern +

1.0.0 · source

pub fn trim_right_matches<P>(&self, pat: P) -> &str
where + P: Pattern, + <P as Pattern>::Searcher<'a>: for<'a> ReverseSearcher<'a>,

👎Deprecated since 1.33.0: superseded by trim_end_matches

Returns a string slice with all suffixes that match a pattern repeatedly removed.

The pattern can be a &str, char, a slice of chars, or a function or closure that determines if a character matches.

@@ -1245,12 +1245,32 @@
§ExamplesUsing to_string:

assert_eq!("❤\n!".escape_unicode().to_string(), "\\u{2764}\\u{a}\\u{21}");
-
1.0.0 · source

pub fn replace<'a, P>(&'a self, from: P, to: &str) -> String
where - P: Pattern<'a>,

Replaces all matches of a pattern with another string.

+
source

pub fn substr_range(&self, substr: &str) -> Option<Range<usize>>

🔬This is a nightly-only experimental API. (substr_range)

Returns the range that a substring points to.

+

Returns None if substr does not point within self.

+

Unlike str::find, this does not search through the string. +Instead, it uses pointer arithmetic to find where in the string +substr is derived from.

+

This is useful for extending str::split and similar methods.

+

Note that this method may return false positives (typically either +Some(0..0) or Some(self.len()..self.len())) if substr is a +zero-length str that points at the beginning or end of another, +independent, str.

+
§Examples
+
#![feature(substr_range)]
+
+let data = "a, b, b, a";
+let mut iter = data.split(", ").map(|s| data.substr_range(s).unwrap());
+
+assert_eq!(iter.next(), Some(0..1));
+assert_eq!(iter.next(), Some(3..4));
+assert_eq!(iter.next(), Some(6..7));
+assert_eq!(iter.next(), Some(9..10));
+
1.0.0 · source

pub fn replace<P>(&self, from: P, to: &str) -> String
where + P: Pattern,

Replaces all matches of a pattern with another string.

replace creates a new String, and copies the data from this string slice into it. While doing so, it attempts to find matches of a pattern. If it finds any, it replaces them with the replacement string slice.

-
§Examples
+
§Examples

Basic usage:

let s = "this is old";
@@ -1261,12 +1281,12 @@ 
§Examples
let s = "this is old";
 assert_eq!(s, s.replace("cookie monster", "little lamb"));
-
1.16.0 · source

pub fn replacen<'a, P>(&'a self, pat: P, to: &str, count: usize) -> String
where - P: Pattern<'a>,

Replaces first N matches of a pattern with another string.

+
1.16.0 · source

pub fn replacen<P>(&self, pat: P, to: &str, count: usize) -> String
where + P: Pattern,

Replaces first N matches of a pattern with another string.

replacen creates a new String, and copies the data from this string slice into it. While doing so, it attempts to find matches of a pattern. If it finds any, it replaces them with the replacement string slice at most count times.

-
§Examples
+
§Examples

Basic usage:

let s = "foo foo 123 foo";
@@ -1283,7 +1303,7 @@ 
§ExamplesSince some characters can expand into multiple characters when changing the case, this function returns a String instead of modifying the parameter in-place.

-
§Examples
+
§Examples

Basic usage:

let s = "HELLO";
@@ -1310,7 +1330,7 @@ 
§ExamplesSince some characters can expand into multiple characters when changing the case, this function returns a String instead of modifying the parameter in-place.

-
§Examples
+
§Examples

Basic usage:

let s = "hello";
@@ -1329,7 +1349,7 @@ 
§Examples
1.16.0 · source

pub fn repeat(&self, n: usize) -> String

Creates a new String by repeating a string n times.

§Panics

This function will panic if the capacity would overflow.

-
§Examples
+
§Examples

Basic usage:

assert_eq!("abc".repeat(4), String::from("abcabcabcabc"));
@@ -1344,7 +1364,7 @@
§ExamplesTo uppercase the value in-place, use make_ascii_uppercase.

To uppercase ASCII characters in addition to non-ASCII characters, use to_uppercase.

-
§Examples
+
§Examples
let s = "Grüße, Jürgen ❤";
 
 assert_eq!("GRüßE, JüRGEN ❤", s.to_ascii_uppercase());
@@ -1355,7 +1375,7 @@
§ExamplesTo lowercase the value in-place, use make_ascii_lowercase.

To lowercase ASCII characters in addition to non-ASCII characters, use to_lowercase.

-
§Examples
+
§Examples
let s = "Grüße, Jürgen ❤";
 
 assert_eq!("grüße, jürgen ❤", s.to_ascii_lowercase());
@@ -1414,8 +1434,8 @@
§ExamplesFromIterator<char>,
Encode the hex strict representing self into the result. Upper case letters are used (e.g. F9B4CA)
source§

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

§

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
§

impl<T> ToSmolStr for T
where - T: Display + ?Sized,

§

fn to_smolstr(&self) -> SmolStr

source§

impl<T> ToString for T
where - T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where + T: Display + ?Sized,

§

fn to_smolstr(&self) -> SmolStr

source§

impl<T> ToString for T
where + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

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

§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

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

§

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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where diff --git a/snapshots/master/docs/rust/slint_interpreter/struct.SharedVector.html b/snapshots/master/docs/rust/slint_interpreter/struct.SharedVector.html index 8641f8010..3ea6744fa 100644 --- a/snapshots/master/docs/rust/slint_interpreter/struct.SharedVector.html +++ b/snapshots/master/docs/rust/slint_interpreter/struct.SharedVector.html @@ -1,4 +1,4 @@ -SharedVector in slint_interpreter - Rust

Struct slint_interpreter::SharedVector

#[repr(C)]
pub struct SharedVector<T> { /* private fields */ }
Expand description

(Re-export from corelib.) +

Struct slint_interpreter::SharedVector

#[repr(C)]
pub struct SharedVector<T> { /* private fields */ }
Expand description

(Re-export from corelib.) SharedVector holds a reference-counted read-only copy of [T].

Implementations§

§

impl<T> SharedVector<T>

pub fn with_capacity(capacity: usize) -> SharedVector<T>

Create a new empty array with a pre-allocated capacity in number of items

pub fn len(&self) -> usize

Number of elements in the array

@@ -1115,13 +1115,71 @@
§Exampleslet idx = s.partition_point(|&x| x <= num); s.insert(idx, num); assert_eq!(s, [0, 1, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 42, 55]);
-
1.80.0 · source

pub fn as_flattened(&self) -> &[T]

Takes a &[[T; N]], and flattens it to a &[T].

+
source

pub fn elem_offset(&self, element: &T) -> Option<usize>

🔬This is a nightly-only experimental API. (substr_range)

Returns the index that an element reference points to.

+

Returns None if element does not point within the slice or if it points between elements.

+

This method is useful for extending slice iterators like slice::split.

+

Note that this uses pointer arithmetic and does not compare elements. +To find the index of an element via comparison, use +.iter().position() instead.

§Panics
+

Panics if T is zero-sized.

+
§Examples
+

Basic usage:

+ +
#![feature(substr_range)]
+
+let nums: &[u32] = &[1, 7, 1, 1];
+let num = &nums[2];
+
+assert_eq!(num, &1);
+assert_eq!(nums.elem_offset(num), Some(2));
+

Returning None with an in-between element:

+ +
#![feature(substr_range)]
+
+let arr: &[[u32; 2]] = &[[0, 1], [2, 3]];
+let flat_arr: &[u32] = arr.as_flattened();
+
+let ok_elm: &[u32; 2] = flat_arr[0..2].try_into().unwrap();
+let weird_elm: &[u32; 2] = flat_arr[1..3].try_into().unwrap();
+
+assert_eq!(ok_elm, &[0, 1]);
+assert_eq!(weird_elm, &[1, 2]);
+
+assert_eq!(arr.elem_offset(ok_elm), Some(0)); // Points to element 0
+assert_eq!(arr.elem_offset(weird_elm), None); // Points between element 0 and 1
+
source

pub fn subslice_range(&self, subslice: &[T]) -> Option<Range<usize>>

🔬This is a nightly-only experimental API. (substr_range)

Returns the range of indices that a subslice points to.

+

Returns None if subslice does not point within the slice or if it points between elements.

+

This method does not compare elements. Instead, this method finds the location in the slice that +subslice was obtained from. To find the index of a subslice via comparison, instead use +.windows().position().

+

This method is useful for extending slice iterators like slice::split.

+

Note that this may return a false positive (either Some(0..0) or Some(self.len()..self.len())) +if subslice has a length of zero and points to the beginning or end of another, separate, slice.

+
§Panics
+

Panics if T is zero-sized.

+
§Examples
+

Basic usage:

+ +
#![feature(substr_range)]
+
+let nums = &[0, 5, 10, 0, 0, 5];
+
+let mut iter = nums
+    .split(|t| *t == 0)
+    .map(|n| nums.subslice_range(n).unwrap());
+
+assert_eq!(iter.next(), Some(0..0));
+assert_eq!(iter.next(), Some(1..3));
+assert_eq!(iter.next(), Some(4..4));
+assert_eq!(iter.next(), Some(5..6));
+
1.80.0 · source

pub fn as_flattened(&self) -> &[T]

Takes a &[[T; N]], and flattens it to a &[T].

+
§Panics

This panics if the length of the resulting slice would overflow a usize.

This is only possible when flattening a slice of arrays of zero-sized types, and thus tends to be irrelevant in practice. If size_of::<T>() > 0, this will never panic.

-
§Examples
+
§Examples
assert_eq!([[1, 2, 3], [4, 5, 6]].as_flattened(), &[1, 2, 3, 4, 5, 6]);
 
 assert_eq!(
@@ -1136,7 +1194,7 @@ 
§Examplesassert!(empty_slice_of_arrays.as_flattened().is_empty());
1.79.0 · source

pub fn utf8_chunks(&self) -> Utf8Chunks<'_>

Creates an iterator over the contiguous valid UTF-8 ranges of this slice, and the non-UTF-8 fragments in between.

-
§Examples
+
§Examples

This function formats arbitrary but mostly-UTF-8 bytes into Rust source code in the form of a C-string literal (c"...").

@@ -1165,14 +1223,14 @@
§Examples
1.0.0 · source

pub fn to_vec(&self) -> Vec<T>
where T: Clone,

Copies self into a new Vec.

-
§Examples
+
§Examples
let s = [10, 40, 30];
 let x = s.to_vec();
 // Here, `s` and `x` can be modified independently.
source

pub fn to_vec_in<A>(&self, alloc: A) -> Vec<T, A>
where A: Allocator, T: Clone,

🔬This is a nightly-only experimental API. (allocator_api)

Copies self into a new Vec with an allocator.

-
§Examples
+
§Examples
#![feature(allocator_api)]
 
 use std::alloc::System;
@@ -1182,9 +1240,9 @@ 
§Examples// Here, `s` and `x` can be modified independently.
1.40.0 · source

pub fn repeat(&self, n: usize) -> Vec<T>
where T: Copy,

Creates a vector by copying a slice n times.

-
§Panics
+
§Panics

This function will panic if the capacity would overflow.

-
§Examples
+
§Examples

Basic usage:

assert_eq!([1, 2].repeat(3), vec![1, 2, 1, 2, 1, 2]);
@@ -1195,7 +1253,7 @@
§Examples
1.0.0 · source

pub fn concat<Item>(&self) -> <[T] as Concat<Item>>::Output
where [T]: Concat<Item>, Item: ?Sized,

Flattens a slice of T into a single value Self::Output.

-
§Examples
+
§Examples
assert_eq!(["hello", "world"].concat(), "helloworld");
 assert_eq!([[1, 2], [3, 4]].concat(), [1, 2, 3, 4]);
1.3.0 · source

pub fn join<Separator>( @@ -1204,7 +1262,7 @@

§Examples[T] as Join<Separator>>::Output
where [T]: Join<Separator>,

Flattens a slice of T into a single value Self::Output, placing a given separator between each.

-
§Examples
+
§Examples
assert_eq!(["hello", "world"].join(" "), "hello world");
 assert_eq!([[1, 2], [3, 4]].join(&0), [1, 2, 0, 3, 4]);
 assert_eq!([[1, 2], [3, 4]].join(&[0, 0][..]), [1, 2, 0, 0, 3, 4]);
@@ -1214,7 +1272,7 @@
§Examples[T] as Join<Separator>>::Output
where [T]: Join<Separator>,
👎Deprecated since 1.3.0: renamed to join

Flattens a slice of T into a single value Self::Output, placing a given separator between each.

-
§Examples
+
§Examples
assert_eq!(["hello", "world"].connect(" "), "hello world");
 assert_eq!([[1, 2], [3, 4]].connect(&0), [1, 2, 0, 3, 4]);
1.23.0 · source

pub fn to_ascii_uppercase(&self) -> Vec<u8>

Returns a vector containing a copy of this slice where each byte diff --git a/snapshots/master/docs/rust/slint_interpreter/struct.Struct.html b/snapshots/master/docs/rust/slint_interpreter/struct.Struct.html index 833359c52..2c7193be3 100644 --- a/snapshots/master/docs/rust/slint_interpreter/struct.Struct.html +++ b/snapshots/master/docs/rust/slint_interpreter/struct.Struct.html @@ -1,4 +1,4 @@ -Struct in slint_interpreter - Rust