Struct Pretty

Source
pub struct Pretty(pub Node);
Available on crate feature pretty only.
Expand description

A wrapper around Node that is always pretty printed.

Tuple Fields§

§0: Node

Implementations§

Source§

impl Pretty

Source

pub fn into_inner(self) -> Node

Extract the inner node.

Source

pub const fn as_inner(&self) -> &Node

Borrow the inner node.

Trait Implementations§

Source§

impl Clone for Pretty

Source§

fn clone(&self) -> Pretty

Returns a copy of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for Pretty

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for Pretty

Source§

fn default() -> Pretty

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for Pretty

Source§

fn deserialize<__D>( __deserializer: __D, ) -> Result<Pretty, <__D as Deserializer<'de>>::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Display for Pretty

Source§

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

Format as a pretty printed HTML node.

Source§

impl<N> From<N> for Pretty
where N: Into<Node>,

Source§

fn from(node: N) -> Pretty

Create a new pretty wrapper around the given node.

Source§

impl IntoResponse for Pretty

Source§

fn into_response(self) -> Response<UnsyncBoxBody<Bytes, Error>>

Create a response.
Source§

impl PartialEq for Pretty

Source§

fn eq(&self, other: &Pretty) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for Pretty

Source§

fn serialize<__S>( &self, __serializer: __S, ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Eq for Pretty

Source§

impl StructuralPartialEq for Pretty

Auto Trait Implementations§

§

impl Freeze for Pretty

§

impl RefUnwindSafe for Pretty

§

impl Send for Pretty

§

impl Sync for Pretty

§

impl Unpin for Pretty

§

impl UnwindSafe for Pretty

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

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

Source§

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

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

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

Source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
Source§

impl<T, S, B> Handler<IntoResponseHandler, S, B> for T
where T: IntoResponse + Clone + Send + 'static, B: Send + 'static,

Source§

type Future = Ready<Response<UnsyncBoxBody<Bytes, Error>>>

The type of future calling this handler returns.
Source§

fn call( self, _req: Request<B>, _state: S, ) -> <T as Handler<IntoResponseHandler, S, B>>::Future

Call the handler with the given request.
Source§

fn layer<L, NewReqBody>(self, layer: L) -> Layered<L, Self, T, S, B, NewReqBody>
where L: Layer<HandlerService<Self, T, S, B>> + Clone, <L as Layer<HandlerService<Self, T, S, B>>>::Service: Service<Request<NewReqBody>>,

Apply a tower::Layer to the handler. Read more
Source§

fn with_state(self, state: S) -> HandlerService<Self, T, S, B>

Convert the handler into a Service by providing the state
Source§

impl<H, T, B> HandlerWithoutStateExt<T, B> for H
where H: Handler<T, (), B>,

Source§

fn into_service(self) -> HandlerService<H, T, (), B>

Convert the handler into a Service and no state.
Source§

fn into_make_service(self) -> IntoMakeService<HandlerService<H, T, (), B>>

Convert the handler into a MakeService and no state. Read more
Source§

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

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

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

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

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

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

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

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

Source§

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

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<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,