Search results

There are no results.

markdown.Link

class pub enum Link

A type describing the kind of link something is.

Constructors

Direct

Direct(String)

A direct link, such as [text](link here).

Reference

Reference(String)

A reference link, such as [text][reference-name]

Instance methods

!=

Show source code
Hide source code
fn pub !=(other: T) -> Bool {
  (self == other).false?
}
fn pub !=(other: T) -> Bool

Returns true if self and the given object are not equal to each other.

==

Show source code
Hide source code
fn pub ==(other: ref Link) -> Bool {
  match (self, other) {
    case (Direct(a), Direct(b)) -> a == b
    case (Reference(a), Reference(b)) -> a == b
    case _ -> false
  }
}
fn pub ==(other: ref Link) -> Bool

Returns true if self and the given object are equal to each other.

This operator is used to perform structural equality. This means two objects residing in different memory locations may be considered equal, provided their structure is equal. For example, two different arrays may be considered to have structural equality if they contain the exact same values.

clone

Show source code
Hide source code
fn pub clone -> Link {
  match self {
    case Direct(v) -> Link.Direct(v)
    case Reference(v) -> Link.Reference(v)
  }
}
fn pub clone -> Link

Creates a clone of self.

fmt

Show source code
Hide source code
fn pub fmt(formatter: mut Formatter) {
  match self {
    case Direct(val) -> formatter.tuple('Direct').field(val).finish
    case Reference(val) -> formatter.tuple('Reference').field(val).finish
  }
}
fn pub fmt(formatter: mut Formatter)

Formats self in a human-readable format for debugging purposes.

Implemented traits

std.clone.

Clone

impl Clone[Link] for Link
std.cmp.

Equal

impl Equal[ref Link] for Link
std.fmt.

Format

impl Format for Link