# Xui.Core.Memory

Assembly: **Xui.Core** · [C# declarations](index.cs) · [Assembly overview](../index.md)

## Types

- [`ref struct FillTextInterpolatedStringHandler`](#api-782aab9ec98d3b68)

<a id="api-782aab9ec98d3b68"></a>

## `ref struct FillTextInterpolatedStringHandler`

Low-allocation interpolated string handler for building text in a stack-first inline buffer, spilling to a rented array only when the text exceeds 256 characters.

```csharp
[InterpolatedStringHandler]
public ref struct FillTextInterpolatedStringHandler
{
    public FillTextInterpolatedStringHandler(int literalLength, int formattedCount);
    public void AppendLiteral(string s);
    public void AppendFormatted<T>(T value)
        where T : ISpanFormattable;
    public void AppendFormatted<T>(T value, ReadOnlySpan<char> format)
        where T : ISpanFormattable;
    public void AppendFormatted<T>(T value, int alignment)
        where T : ISpanFormattable;
    public void AppendFormatted<T>(T value, int alignment, ReadOnlySpan<char> format)
        where T : ISpanFormattable;
    public void AppendFormatted(ReadOnlySpan<char> value);
    public void AppendFormatted(string? value);
    public void AppendFormatted(object? value);
    public readonly ReadOnlySpan<char> AsSpan();
    public void Dispose();
}
```

<a id="api-cf2f95b2344fa349"></a>

### [`FillTextInterpolatedStringHandler.FillTextInterpolatedStringHandler(int literalLength, int formattedCount)`](#api-cf2f95b2344fa349)


```csharp
public FillTextInterpolatedStringHandler(int literalLength, int formattedCount);
```

Initializes the handler and allocates or rents a buffer of the appropriate size.

- **`literalLength`** — Total character count of all literal string segments.

- **`formattedCount`** — Number of interpolated holes in the string.

<a id="api-b504488b594889d6"></a>

### [`void FillTextInterpolatedStringHandler.AppendFormatted(object? value)`](#api-b504488b594889d6)


```csharp
public void AppendFormatted(object? value);
```

Appends any object by calling `ToString()`.

<a id="api-8787042222fe7544"></a>

### [`void FillTextInterpolatedStringHandler.AppendFormatted(ReadOnlySpan<char> value)`](#api-8787042222fe7544)


```csharp
public void AppendFormatted(ReadOnlySpan<char> value);
```

Appends a `System.ReadOnlySpan`1` of characters directly.

<a id="api-d1ba1f735bf38a3b"></a>

### [`void FillTextInterpolatedStringHandler.AppendFormatted(string? value)`](#api-d1ba1f735bf38a3b)


```csharp
public void AppendFormatted(string? value);
```

Appends a string value.

<a id="api-501593963963aa37"></a>

### [`void FillTextInterpolatedStringHandler.AppendFormatted<T>(T value)`](#api-501593963963aa37)


```csharp
public void AppendFormatted<T>(T value)
    where T : ISpanFormattable;
```

Appends a span-formattable value using its default format.

<a id="api-6f5defc8aa235854"></a>

### [`void FillTextInterpolatedStringHandler.AppendFormatted<T>(T value, int alignment)`](#api-6f5defc8aa235854)


```csharp
public void AppendFormatted<T>(T value, int alignment)
    where T : ISpanFormattable;
```

Appends a span-formattable value with the specified alignment width.

<a id="api-9e8d8c22a85b9784"></a>

### [`void FillTextInterpolatedStringHandler.AppendFormatted<T>(T value, int alignment, ReadOnlySpan<char> format)`](#api-9e8d8c22a85b9784)


```csharp
public void AppendFormatted<T>(T value, int alignment, ReadOnlySpan<char> format)
    where T : ISpanFormattable;
```

Appends a span-formattable value with the specified format and alignment width.

<a id="api-e7b01f9c79d0909a"></a>

### [`void FillTextInterpolatedStringHandler.AppendFormatted<T>(T value, ReadOnlySpan<char> format)`](#api-e7b01f9c79d0909a)


```csharp
public void AppendFormatted<T>(T value, ReadOnlySpan<char> format)
    where T : ISpanFormattable;
```

Appends a span-formattable value using the specified format string.

<a id="api-a81f75373444a1bb"></a>

### [`void FillTextInterpolatedStringHandler.AppendLiteral(string s)`](#api-a81f75373444a1bb)


```csharp
public void AppendLiteral(string s);
```

Appends a literal string segment to the buffer.

<a id="api-726472e60b217c91"></a>

### [`readonly ReadOnlySpan<char> FillTextInterpolatedStringHandler.AsSpan()`](#api-726472e60b217c91)


```csharp
public readonly ReadOnlySpan<char> AsSpan();
```

Returns the currently accumulated characters as a read-only span.

<a id="api-e7d280850c7b579f"></a>

### [`void FillTextInterpolatedStringHandler.Dispose()`](#api-e7d280850c7b579f)


```csharp
public void Dispose();
```

Returns any rented array buffer back to the pool.

