Skip to content

Rename AsBytes to IntoBytes #695

Closed
@joshlf

Description

@joshlf

Progress

  • Decide between ToBytes and IntoBytes
    • Decided to go with IntoBytes so that FromBytes/IntoBytes is symmetrical with stdlib's From/Into
  • Implementation
    • In progress in #700

Description

Now that AsBytes permits UnsafeCells as part of #251, it can be implemented for types which support value-only transmutation (ie, for which fn as_bytes(&self) -> &[u8] where Self: NoCell is not available because Self: !NoCell). Given this change, a more appropriate name for the trait would be IntoBytes. This also brings our pair of FromBytes/IntoBytes into line with the existing pattern of From/Into.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions