Trait valence::protocol::Encode

source ·
pub trait Encode {
    // Required method
    fn encode(&self, w: impl Write) -> Result<(), Error>;

    // Provided method
    fn encode_slice(slice: &[Self], w: impl Write) -> Result<(), Error>
       where Self: Sized { ... }
}
Expand description

The Encode trait allows objects to be written to the Minecraft protocol. It is the inverse of Decode.

Deriving

This trait can be implemented automatically for structs and enums by using the Encode derive macro. All components of the type must implement Encode. Components are encoded in the order they appear in the type definition.

For enums, the variant to encode is marked by a leading VarInt discriminant (tag). The discriminant value can be changed using the #[packet(tag = ...)] attribute on the variant in question. Discriminant values are assigned to variants using rules similar to regular enum discriminants.

use valence_protocol::Encode;

#[derive(Encode)]
struct MyStruct<'a> {
    first: i32,
    second: &'a str,
    third: [f64; 3],
}

#[derive(Encode)]
enum MyEnum {
    First,  // tag = 0
    Second, // tag = 1
    #[packet(tag = 25)]
    Third, // tag = 25
    Fourth, // tag = 26
}

let value = MyStruct {
    first: 10,
    second: "hello",
    third: [1.5, 3.14, 2.718],
};

let mut buf = vec![];
value.encode(&mut buf).unwrap();

println!("{buf:?}");

Required Methods§

source

fn encode(&self, w: impl Write) -> Result<(), Error>

Writes this object to the provided writer.

If this type also implements Decode then successful calls to this function returning Ok(()) must always successfully decode using the data that was written to the writer. The exact number of bytes that were originally written must be consumed during the decoding.

Provided Methods§

source

fn encode_slice(slice: &[Self], w: impl Write) -> Result<(), Error>
where Self: Sized,

Like Encode::encode, except that a whole slice of values is encoded.

This method must be semantically equivalent to encoding every element of the slice in sequence with no leading length prefix (which is exactly what the default implementation does), but a more efficient implementation may be used.

This method is important for some types like u8 where the entire slice can be encoded in a single call to write_all. Because impl specialization is unavailable in stable Rust at the time of writing, we must make the slice specialization part of this trait.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl Encode for bool

source§

fn encode(&self, w: impl Write) -> Result<(), Error>

source§

fn encode_slice(slice: &[bool], w: impl Write) -> Result<(), Error>

source§

impl Encode for f32

source§

fn encode(&self, w: impl Write) -> Result<(), Error>

source§

impl Encode for f64

source§

fn encode(&self, w: impl Write) -> Result<(), Error>

source§

impl Encode for i8

source§

fn encode(&self, w: impl Write) -> Result<(), Error>

source§

fn encode_slice(slice: &[i8], w: impl Write) -> Result<(), Error>

source§

impl Encode for i16

source§

fn encode(&self, w: impl Write) -> Result<(), Error>

source§

impl Encode for i32

source§

fn encode(&self, w: impl Write) -> Result<(), Error>

source§

impl Encode for i64

source§

fn encode(&self, w: impl Write) -> Result<(), Error>

source§

impl Encode for i128

source§

fn encode(&self, w: impl Write) -> Result<(), Error>

source§

impl Encode for str

source§

fn encode(&self, w: impl Write) -> Result<(), Error>

source§

impl Encode for u8

source§

fn encode(&self, w: impl Write) -> Result<(), Error>

source§

fn encode_slice(slice: &[u8], w: impl Write) -> Result<(), Error>

source§

impl Encode for u16

source§

fn encode(&self, w: impl Write) -> Result<(), Error>

source§

impl Encode for u32

source§

fn encode(&self, w: impl Write) -> Result<(), Error>

source§

impl Encode for u64

source§

fn encode(&self, w: impl Write) -> Result<(), Error>

source§

impl Encode for u128

source§

fn encode(&self, w: impl Write) -> Result<(), Error>

source§

impl Encode for ()

source§

fn encode(&self, _w: impl Write) -> Result<(), Error>

source§

impl Encode for String

source§

fn encode(&self, w: impl Write) -> Result<(), Error>

source§

impl<'a, B> Encode for Cow<'a, B>
where B: ToOwned + Encode + ?Sized,

source§

fn encode(&self, w: impl Write) -> Result<(), Error>

source§

impl<A> Encode for (A,)
where A: Encode,

source§

fn encode(&self, _w: impl Write) -> Result<(), Error>

source§

impl<A, B> Encode for (A, B)
where A: Encode, B: Encode,

source§

fn encode(&self, _w: impl Write) -> Result<(), Error>

source§

impl<A, B, C> Encode for (A, B, C)
where A: Encode, B: Encode, C: Encode,

source§

fn encode(&self, _w: impl Write) -> Result<(), Error>

source§

impl<A, B, C, D> Encode for (A, B, C, D)
where A: Encode, B: Encode, C: Encode, D: Encode,

source§

fn encode(&self, _w: impl Write) -> Result<(), Error>

source§

impl<A, B, C, D, E> Encode for (A, B, C, D, E)
where A: Encode, B: Encode, C: Encode, D: Encode, E: Encode,

source§

fn encode(&self, _w: impl Write) -> Result<(), Error>

source§

impl<A, B, C, D, E, F> Encode for (A, B, C, D, E, F)
where A: Encode, B: Encode, C: Encode, D: Encode, E: Encode, F: Encode,

source§

fn encode(&self, _w: impl Write) -> Result<(), Error>

source§

impl<A, B, C, D, E, F, G> Encode for (A, B, C, D, E, F, G)
where A: Encode, B: Encode, C: Encode, D: Encode, E: Encode, F: Encode, G: Encode,

source§

fn encode(&self, _w: impl Write) -> Result<(), Error>

source§

impl<A, B, C, D, E, F, G, H> Encode for (A, B, C, D, E, F, G, H)
where A: Encode, B: Encode, C: Encode, D: Encode, E: Encode, F: Encode, G: Encode, H: Encode,

source§

fn encode(&self, _w: impl Write) -> Result<(), Error>

source§

impl<A, B, C, D, E, F, G, H, I> Encode for (A, B, C, D, E, F, G, H, I)
where A: Encode, B: Encode, C: Encode, D: Encode, E: Encode, F: Encode, G: Encode, H: Encode, I: Encode,

source§

fn encode(&self, _w: impl Write) -> Result<(), Error>

source§

impl<A, B, C, D, E, F, G, H, I, J> Encode for (A, B, C, D, E, F, G, H, I, J)
where A: Encode, B: Encode, C: Encode, D: Encode, E: Encode, F: Encode, G: Encode, H: Encode, I: Encode, J: Encode,

source§

fn encode(&self, _w: impl Write) -> Result<(), Error>

source§

impl<A, B, C, D, E, F, G, H, I, J, K> Encode for (A, B, C, D, E, F, G, H, I, J, K)
where A: Encode, B: Encode, C: Encode, D: Encode, E: Encode, F: Encode, G: Encode, H: Encode, I: Encode, J: Encode, K: Encode,

source§

fn encode(&self, _w: impl Write) -> Result<(), Error>

source§

impl<A, B, C, D, E, F, G, H, I, J, K, L> Encode for (A, B, C, D, E, F, G, H, I, J, K, L)
where A: Encode, B: Encode, C: Encode, D: Encode, E: Encode, F: Encode, G: Encode, H: Encode, I: Encode, J: Encode, K: Encode, L: Encode,

source§

fn encode(&self, _w: impl Write) -> Result<(), Error>

source§

impl<K, V> Encode for BTreeMap<K, V>
where K: Encode, V: Encode,

source§

fn encode(&self, w: impl Write) -> Result<(), Error>

source§

impl<K, V, S> Encode for HashMap<K, V, S>
where K: Encode, V: Encode,

source§

fn encode(&self, w: impl Write) -> Result<(), Error>

source§

impl<T> Encode for Option<T>
where T: Encode,

source§

fn encode(&self, w: impl Write) -> Result<(), Error>

source§

impl<T> Encode for &T
where T: Encode + ?Sized,

source§

fn encode(&self, w: impl Write) -> Result<(), Error>

source§

impl<T> Encode for &mut T
where T: Encode + ?Sized,

source§

fn encode(&self, w: impl Write) -> Result<(), Error>

source§

impl<T> Encode for [T]
where T: Encode,

source§

fn encode(&self, w: impl Write) -> Result<(), Error>

source§

impl<T> Encode for Box<T>
where T: Encode + ?Sized,

source§

fn encode(&self, w: impl Write) -> Result<(), Error>

source§

impl<T> Encode for BTreeSet<T>
where T: Encode,

source§

fn encode(&self, w: impl Write) -> Result<(), Error>

source§

impl<T> Encode for Rc<T>
where T: Encode + ?Sized,

source§

fn encode(&self, w: impl Write) -> Result<(), Error>

source§

impl<T> Encode for Arc<T>
where T: Encode + ?Sized,

source§

fn encode(&self, w: impl Write) -> Result<(), Error>

source§

impl<T> Encode for Vec<T>
where T: Encode,

source§

fn encode(&self, w: impl Write) -> Result<(), Error>

source§

impl<T, S> Encode for HashSet<T, S>
where T: Encode,

source§

fn encode(&self, w: impl Write) -> Result<(), Error>

source§

impl<T, const N: usize> Encode for [T; N]
where T: Encode,

Like tuples, fixed-length arrays are encoded and decoded without a VarInt length prefix.

source§

fn encode(&self, w: impl Write) -> Result<(), Error>

Implementors§

source§

impl Encode for BlockEntityKind

source§

impl Encode for BoatKind

source§

impl Encode for CatKind

source§

impl Encode for FrogKind

source§

impl Encode for PaintingKind

source§

impl Encode for Pose

source§

impl Encode for SnifferState

source§

impl Encode for VillagerKind

source§

impl Encode for VillagerProfession

source§

impl Encode for BlockKind

source§

impl Encode for Difficulty

source§

impl Encode for Direction

source§

impl Encode for GameMode

source§

impl Encode for Hand

source§

impl Encode for ItemKind

source§

impl Encode for Particle

Encodes the particle without an ID.

source§

impl Encode for HandshakeNextState

source§

impl Encode for BossBarColor

source§

impl Encode for BossBarDivision

source§

impl Encode for MessageFilterType

source§

impl Encode for ChatSuggestionsAction

source§

impl Encode for ClickMode

source§

impl Encode for ClientCommand

source§

impl Encode for ChatMode

source§

impl Encode for MainArm

source§

impl Encode for Parser

source§

impl Encode for StringArg

source§

impl Encode for ClientStatusC2s

source§

impl Encode for ResourcePackStatusC2s

source§

impl Encode for UpdatePlayerAbilitiesC2s

source§

impl Encode for GameEventKind

source§

impl Encode for FeetOrEyes

source§

impl Encode for IconType

source§

impl Encode for WindowType

source§

impl Encode for PlayerAction

source§

impl Encode for EntityInteraction

source§

impl Encode for RecipeBookId

source§

impl Encode for ScoreboardPosition

source§

impl Encode for ObjectiveRenderType

source§

impl Encode for CraftingShapedCategory

source§

impl Encode for valence::protocol::packets::play::team_s2c::Mode<'_>

source§

impl Encode for TeamColor

source§

impl Encode for UpdateCommandBlockMode

source§

impl Encode for Action

source§

impl Encode for Mirror

source§

impl Encode for valence::protocol::packets::play::update_structure_block_c2s::Mode

source§

impl Encode for Rotation

source§

impl Encode for SoundCategory

source§

impl Encode for SoundId<'_>

source§

impl Encode for EulerAngle

source§

impl Encode for VillagerData

source§

impl Encode for DQuat

source§

impl Encode for DVec2

source§

impl Encode for DVec3

source§

impl Encode for IVec3

source§

impl Encode for Quat

source§

impl Encode for Vec2

source§

impl Encode for Vec3

source§

impl Encode for Vec3A

source§

impl Encode for Vec4

source§

impl Encode for Compound

source§

impl Encode for Uuid

source§

impl Encode for PackedBlockPos

source§

impl Encode for PackedChunkSectionPos

source§

impl Encode for OptGameMode

source§

impl Encode for LoginCompressionS2c

source§

impl Encode for BossBarFlags

source§

impl Encode for ChunkDeltaUpdateEntry

source§

impl Encode for SlotChange

source§

impl Encode for DisplayedSkinParts

source§

impl Encode for Node

source§

impl Encode for AttributeModifier

source§

impl Encode for EquipmentEntry

source§

impl Encode for valence::protocol::packets::play::entity_status_effect_s2c::Flags

source§

impl Encode for LookAtEntity

source§

impl Encode for PlayerAbilitiesFlags

source§

impl Encode for PlayerInputFlags

source§

impl Encode for PlayerPositionLookFlags

source§

impl Encode for TradeOffer

source§

impl Encode for Statistic

source§

impl Encode for BlockBreakingProgressS2c

source§

impl Encode for BlockEventS2c

source§

impl Encode for BlockUpdateS2c

source§

impl Encode for BoatPaddleStateC2s

source§

impl Encode for BundleSplitterS2c

source§

impl Encode for ButtonClickC2s

source§

impl Encode for ChunkLoadDistanceS2c

source§

impl Encode for ChunkRenderDistanceCenterS2c

source§

impl Encode for ClearTitleS2c

source§

impl Encode for ClientCommandC2s

source§

impl Encode for CloseHandledScreenC2s

source§

impl Encode for CloseScreenS2c

source§

impl Encode for CommandTreeS2c

source§

impl Encode for CooldownUpdateS2c

source§

impl Encode for CreativeInventoryActionC2s

source§

impl Encode for DamageTiltS2c

source§

impl Encode for DifficultyS2c

source§

impl Encode for EndCombatS2c

source§

impl Encode for EnterCombatS2c

source§

impl Encode for EntityAnimationS2c

source§

impl Encode for EntityAttachS2c

source§

impl Encode for EntityDamageS2c

source§

impl Encode for EntityEquipmentUpdateS2c

source§

impl Encode for EntityPositionS2c

source§

impl Encode for EntitySetHeadYawS2c

source§

impl Encode for EntitySpawnS2c

source§

impl Encode for EntityStatusEffectS2c

source§

impl Encode for EntityStatusS2c

source§

impl Encode for EntityVelocityUpdateS2c

source§

impl Encode for ExperienceBarUpdateS2c

source§

impl Encode for ExperienceOrbSpawnS2c

source§

impl Encode for FullC2s

source§

impl Encode for GameStateChangeS2c

source§

impl Encode for HandSwingC2s

source§

impl Encode for HealthUpdateS2c

source§

impl Encode for ItemPickupAnimationS2c

source§

impl Encode for JigsawGeneratingC2s

source§

impl Encode for KeepAliveC2s

source§

impl Encode for KeepAliveS2c

source§

impl Encode for LookAndOnGroundC2s

source§

impl Encode for LookAtS2c

source§

impl Encode for MapUpdateS2c<'_>

source§

impl Encode for MessageAcknowledgmentC2s

source§

impl Encode for MoveRelativeS2c

source§

impl Encode for NbtQueryResponseS2c

source§

impl Encode for OnGroundOnlyC2s

source§

impl Encode for OpenHorseScreenS2c

source§

impl Encode for OpenWrittenBookS2c

source§

impl Encode for ParticleS2c<'_>

source§

impl Encode for PickFromInventoryC2s

source§

impl Encode for PlayPingS2c

source§

impl Encode for PlayPongC2s

source§

impl Encode for PlaySoundFromEntityS2c

source§

impl Encode for PlayerAbilitiesS2c

source§

impl Encode for PlayerActionC2s

source§

impl Encode for PlayerActionResponseS2c

source§

impl Encode for PlayerInputC2s

source§

impl Encode for PlayerInteractBlockC2s

source§

impl Encode for PlayerInteractEntityC2s

source§

impl Encode for PlayerInteractItemC2s

source§

impl Encode for PlayerPositionLookS2c

source§

impl Encode for PlayerSpawnPositionS2c

source§

impl Encode for PlayerSpawnS2c

source§

impl Encode for PositionAndOnGroundC2s

source§

impl Encode for QueryBlockNbtC2s

source§

impl Encode for QueryEntityNbtC2s

source§

impl Encode for RecipeCategoryOptionsC2s

source§

impl Encode for RemoveEntityStatusEffectS2c

source§

impl Encode for RotateAndMoveRelativeS2c

source§

impl Encode for RotateS2c

source§

impl Encode for ScreenHandlerPropertyUpdateS2c

source§

impl Encode for SelectMerchantTradeC2s

source§

impl Encode for SetCameraEntityS2c

source§

impl Encode for SetTradeOffersS2c

source§

impl Encode for SignEditorOpenS2c

source§

impl Encode for SimulationDistanceS2c

source§

impl Encode for SpectatorTeleportC2s

source§

impl Encode for StatisticsS2c

source§

impl Encode for StopSoundS2c<'_>

source§

impl Encode for TeleportConfirmC2s

source§

impl Encode for TitleFadeS2c

source§

impl Encode for UnloadChunkS2c

source§

impl Encode for UnlockRecipesS2c<'_>

source§

impl Encode for UpdateBeaconC2s

source§

impl Encode for UpdateDifficultyC2s

source§

impl Encode for UpdateDifficultyLockC2s

source§

impl Encode for UpdateSelectedSlotC2s

source§

impl Encode for UpdateSelectedSlotS2c

source§

impl Encode for VehicleMoveC2s

source§

impl Encode for VehicleMoveS2c

source§

impl Encode for WorldBorderCenterChangedS2c

source§

impl Encode for WorldBorderInitializeS2c

source§

impl Encode for WorldBorderInterpolateSizeS2c

source§

impl Encode for WorldBorderSizeChangedS2c

source§

impl Encode for WorldBorderWarningBlocksChangedS2c

source§

impl Encode for WorldBorderWarningTimeChangedS2c

source§

impl Encode for WorldEventS2c

source§

impl Encode for WorldTimeUpdateS2c

source§

impl Encode for CraftingShapedData<'_>

source§

impl Encode for TeamFlags

source§

impl Encode for UpdateCommandBlockFlags

source§

impl Encode for valence::protocol::packets::play::update_structure_block_c2s::Flags

source§

impl Encode for QueryPingC2s

source§

impl Encode for QueryPongS2c

source§

impl Encode for QueryRequestC2s

source§

impl Encode for BlockPos

source§

impl Encode for BlockState

source§

impl Encode for ByteAngle

source§

impl Encode for ChunkPos

source§

impl Encode for ChunkSectionPos

source§

impl Encode for ItemStack

source§

impl Encode for RawBytes<'_>

source§

impl Encode for Text

source§

impl Encode for VarInt

source§

impl Encode for VarLong

source§

impl Encode for Velocity

source§

impl<'a> Encode for BossBarAction<'a>

source§

impl<'a> Encode for AdvancementTabC2s<'a>

source§

impl<'a> Encode for ObjectiveMode<'a>

source§

impl<'a> Encode for ScoreboardPlayerUpdateAction<'a>

source§

impl<'a> Encode for RecipeData<'a>

source§

impl<'a> Encode for HandshakeC2s<'a>

source§

impl<'a> Encode for LoginDisconnectS2c<'a>

source§

impl<'a> Encode for LoginHelloC2s<'a>

source§

impl<'a> Encode for LoginHelloS2c<'a>

source§

impl<'a> Encode for LoginKeyC2s<'a>

source§

impl<'a> Encode for LoginQueryRequestS2c<'a>

source§

impl<'a> Encode for LoginQueryResponseC2s<'a>

source§

impl<'a> Encode for LoginSuccessS2c<'a>

source§

impl<'a> Encode for AdvancementCriteria<'a>

source§

impl<'a> Encode for AdvancementRequirements<'a>

source§

impl<'a> Encode for MessageSignature<'a>

source§

impl<'a> Encode for ChunkBiome<'a>

source§

impl<'a> Encode for ChunkDataBlockEntity<'a>

source§

impl<'a> Encode for CommandArgumentSignature<'a>

source§

impl<'a> Encode for CommandSuggestionsMatch<'a>

source§

impl<'a> Encode for AttributeProperty<'a>

source§

impl<'a> Encode for Data<'a>

source§

impl<'a> Encode for Icon<'a>

source§

impl<'a> Encode for ChatData<'a>

source§

impl<'a> Encode for BlockEntityUpdateS2c<'a>

source§

impl<'a> Encode for BookUpdateC2s<'a>

source§

impl<'a> Encode for BossBarS2c<'a>

source§

impl<'a> Encode for ChatMessageC2s<'a>

source§

impl<'a> Encode for ChatMessageS2c<'a>

source§

impl<'a> Encode for ChatSuggestionsS2c<'a>

source§

impl<'a> Encode for ChunkBiomeDataS2c<'a>

source§

impl<'a> Encode for ChunkDataS2c<'a>

source§

impl<'a> Encode for ChunkDeltaUpdateS2c<'a>

source§

impl<'a> Encode for ClickSlotC2s<'a>

source§

impl<'a> Encode for ClientSettingsC2s<'a>

source§

impl<'a> Encode for CommandExecutionC2s<'a>

source§

impl<'a> Encode for CommandSuggestionsS2c<'a>

source§

impl<'a> Encode for CraftFailedResponseS2c<'a>

source§

impl<'a> Encode for CraftRequestC2s<'a>

source§

impl<'a> Encode for CustomPayloadC2s<'a>

source§

impl<'a> Encode for CustomPayloadS2c<'a>

source§

impl<'a> Encode for DeathMessageS2c<'a>

source§

impl<'a> Encode for DisconnectS2c<'a>

source§

impl<'a> Encode for EntitiesDestroyS2c<'a>

source§

impl<'a> Encode for EntityAttributesS2c<'a>

source§

impl<'a> Encode for EntityPassengersSetS2c<'a>

source§

impl<'a> Encode for EntityTrackerUpdateS2c<'a>

source§

impl<'a> Encode for ExplosionS2c<'a>

source§

impl<'a> Encode for FeaturesS2c<'a>

source§

impl<'a> Encode for GameJoinS2c<'a>

source§

impl<'a> Encode for GameMessageS2c<'a>

source§

impl<'a> Encode for InventoryS2c<'a>

source§

impl<'a> Encode for LightUpdateS2c<'a>

source§

impl<'a> Encode for OpenScreenS2c<'a>

source§

impl<'a> Encode for OverlayMessageS2c<'a>

source§

impl<'a> Encode for PlaySoundS2c<'a>

source§

impl<'a> Encode for PlayerListHeaderS2c<'a>

source§

impl<'a> Encode for PlayerListS2c<'a>

source§

impl<'a> Encode for PlayerRemoveS2c<'a>

source§

impl<'a> Encode for PlayerRespawnS2c<'a>

source§

impl<'a> Encode for PlayerSessionC2s<'a>

source§

impl<'a> Encode for ProfilelessChatMessageS2c<'a>

source§

impl<'a> Encode for RecipeBookDataC2s<'a>

source§

impl<'a> Encode for RemoveMessageS2c<'a>

source§

impl<'a> Encode for RenameItemC2s<'a>

source§

impl<'a> Encode for RequestCommandCompletionsC2s<'a>

source§

impl<'a> Encode for ResourcePackSendS2c<'a>

source§

impl<'a> Encode for ScoreboardDisplayS2c<'a>

source§

impl<'a> Encode for ScoreboardObjectiveUpdateS2c<'a>

source§

impl<'a> Encode for ScoreboardPlayerUpdateS2c<'a>

source§

impl<'a> Encode for ScreenHandlerSlotUpdateS2c<'a>

source§

impl<'a> Encode for SelectAdvancementTabS2c<'a>

source§

impl<'a> Encode for ServerMetadataS2c<'a>

source§

impl<'a> Encode for SubtitleS2c<'a>

source§

impl<'a> Encode for SynchronizeRecipesS2c<'a>

source§

impl<'a> Encode for SynchronizeTagsS2c<'a>

source§

impl<'a> Encode for TeamS2c<'a>

source§

impl<'a> Encode for TitleS2c<'a>

source§

impl<'a> Encode for UpdateCommandBlockC2s<'a>

source§

impl<'a> Encode for UpdateCommandBlockMinecartC2s<'a>

source§

impl<'a> Encode for UpdateJigsawC2s<'a>

source§

impl<'a> Encode for UpdateSignC2s<'a>

source§

impl<'a> Encode for UpdateStructureBlockC2s<'a>

source§

impl<'a> Encode for Recipe<'a>

source§

impl<'a> Encode for QueryResponseS2c<'a>

source§

impl<'a> Encode for GlobalPos<'a>

source§

impl<'a, AM> Encode for GenericAdvancementUpdateS2c<'a, AM>
where AM: 'a + Encode,

source§

impl<'a, I> Encode for Advancement<'a, I>
where I: Encode,

source§

impl<I> Encode for AdvancementDisplay<'_, I>
where I: Encode,

source§

impl<S> Encode for Property<S>
where S: Encode,

source§

impl<S> Encode for Ident<S>
where S: Encode,

source§

impl<T, const MAX_LEN: usize> Encode for Bounded<&[T], MAX_LEN>
where T: Encode,

source§

impl<T, const N: usize> Encode for FixedArray<T, N>
where T: Encode,

source§

impl<const BIT_COUNT: usize, const BYTE_COUNT: usize> Encode for FixedBitSet<BIT_COUNT, BYTE_COUNT>

source§

impl<const MAX_BYTES: usize> Encode for Bounded<RawBytes<'_>, MAX_BYTES>

Raises an encoding error if the inner slice is longer than MAX_BYTES.

source§

impl<const MAX_CHARS: usize> Encode for Bounded<&str, MAX_CHARS>

source§

impl<const MAX_CHARS: usize> Encode for Bounded<String, MAX_CHARS>