Skip to main content

IteratorArray

Struct IteratorArray 

Source
pub struct IteratorArray<'i, I, M = ()>(/* private fields */);
Expand description

Implements SchemaSerialize for an iterator by serializing the elements into a sequence.

A value of this type should only be serialized one. Serializing multiple times will result in an error.

Implementations§

Source§

impl<I> IteratorArray<'_, I>

Source

pub fn new(iter: I) -> Self

Source§

impl<I, M> IteratorArray<'_, I, M>

Source

pub fn with_mapper(iter: I, mapper: M) -> Self

Source§

impl<'i, T> IteratorArray<'i, Box<dyn Iterator<Item = T> + 'i>>

Source

pub fn boxed(iter: impl IntoIterator<Item = T> + 'i) -> Self

Source§

impl<'a, Mapped, T> IteratorArray<'a, Map<Iter<'a, T>, fn(&'a T) -> Mapped>>

Source

pub fn map_slice(slice: &'a [T], map: fn(&'a T) -> Mapped) -> Self

Source§

impl<'a, T> IteratorArray<'a, Iter<'a, T>>

Source

pub fn slice(slice: &'a [T]) -> Self

Trait Implementations§

Source§

impl<'i, I, M> SchemaSerialize for IteratorArray<'i, I, M>
where I: Iterator + 'i, M: IteratorItemMapper<I::Item>,

Source§

fn schema_serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serializes an object of this type. Read more
Source§

fn is_present(&self) -> bool

Determines whether a property of this type should be serialized within a JSON object. Read more
Source§

impl<'i, I, M> ToSchema for IteratorArray<'i, I, M>
where I: Iterator, M: IteratorItemMapper<I::Item>,

Source§

const REQUIRED: bool = true

Determines whether a property of this type may be omitted. Read more
Source§

const ALWAYS_INLINED: bool = <[M::Original] as ToSchema>::ALWAYS_INLINED

Indicates whether self.schema_ref(registry) == self.schema(registry).
Source§

type Original = <[<M as IteratorItemMapper<<I as Iterator>::Item>>::Original] as ToSchema>::Original

A type with a schema that allows the same values as this type. Read more
Source§

fn name() -> Cow<'static, str>

Returns the name to use for adding this schema to the OpenAPI components section.
Source§

fn schema(registry: &mut Registry) -> MaybeRef<Schema>

Returns the schema of this type. Read more
Source§

fn schema_ref(registry: &mut Registry) -> MaybeRef<Schema>

Returns a schema or reference to be used within other schemas for values of this type. Read more

Auto Trait Implementations§

§

impl<'i, I, M = ()> !Freeze for IteratorArray<'i, I, M>

§

impl<'i, I, M = ()> !RefUnwindSafe for IteratorArray<'i, I, M>

§

impl<'i, I, M> Send for IteratorArray<'i, I, M>
where M: Send, I: Send,

§

impl<'i, I, M = ()> !Sync for IteratorArray<'i, I, M>

§

impl<'i, I, M> Unpin for IteratorArray<'i, I, M>
where M: Unpin, I: Unpin,

§

impl<'i, I, M> UnsafeUnpin for IteratorArray<'i, I, M>
where M: UnsafeUnpin, I: UnsafeUnpin,

§

impl<'i, I, M> UnwindSafe for IteratorArray<'i, I, M>
where M: UnwindSafe, I: UnwindSafe,

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> IntoResponse for T

Source§

fn openapi(registry: &mut Registry) -> Responses

Describes the responses generated via the into_response function.
Source§

fn into_response(self) -> Response<Body>

Converts this value into an axum response.
Source§

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

Source§

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>,

Source§

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

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

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

Performs the conversion.
Source§

impl<A, B, T> HttpServerConnExec<A, B> for T
where B: Body,